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

Function NewDesc

prometheus/desc.go:78–80  ·  prometheus/desc.go::NewDesc

NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc and will be reported on registration time. variableLabels and constLabels can be nil if no such labels should be set. fqName must not be empty. variableLabels only contain the label names. Their label values are variable

(fqName, help string, variableLabels []string, constLabels Labels)

Source from the content-addressed store, hash-verified

76// For constLabels, the label values are constant. Therefore, they are fully
77// specified in the Desc. See the Collector example for a usage pattern.
78func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc {
79 return V2.NewDesc(fqName, help, UnconstrainedLabels(variableLabels), constLabels)
80}
81
82// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc
83// and will be reported on registration time. variableLabels and constLabels can

Calls 2

UnconstrainedLabelsTypeAlias · 0.85
NewDescMethod · 0.80