MCPcopy
hub / github.com/prometheus/client_golang / NewSummaryVec

Method NewSummaryVec

prometheus/summary.go:570–587  ·  view source on GitHub ↗

NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.

(opts SummaryVecOpts)

Source from the content-addressed store, hash-verified

568
569// NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.
570func (v2) NewSummaryVec(opts SummaryVecOpts) *SummaryVec {
571 for _, ln := range opts.VariableLabels.labelNames() {
572 if ln == quantileLabel {
573 panic(errQuantileLabelNotAllowed)
574 }
575 }
576 desc := V2.NewDesc(
577 BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
578 opts.Help,
579 opts.VariableLabels,
580 opts.ConstLabels,
581 )
582 return &SummaryVec{
583 MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
584 return newSummary(desc, opts.SummaryOpts, lvs...)
585 }),
586 }
587}
588
589// GetMetricWithLabelValues returns the Summary for the given slice of label
590// values (same order as the variable labels in Desc). If that combination of

Callers 3

NewSummaryVecFunction · 0.45
WrapHandlerMethod · 0.45
instrumentHandlerFuncFunction · 0.45

Calls 5

BuildFQNameFunction · 0.85
NewMetricVecFunction · 0.85
newSummaryFunction · 0.85
NewDescMethod · 0.80
labelNamesMethod · 0.65

Tested by

no test coverage detected