-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
area/integrationIntegration with external libsIntegration with external libs
Description
Description
Add built-in extension to export metric for Prometheus. For example:
// NewCollector returns a collector that exports metrics about current version
// information.
func NewCollector(program string) prometheus.Collector {
return prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: program,
Name: "build_info",
Help: fmt.Sprintf(
"A metric with a constant '1' value labeled by version, revision, branch, and goversion from which %s was built.",
program,
),
ConstLabels: prometheus.Labels{
"version": Version,
"revision": Revision,
"branch": Branch,
"goversion": GoVersion,
},
},
func() float64 { return 1 },
)
}Metadata
Metadata
Assignees
Labels
area/integrationIntegration with external libsIntegration with external libs
Projects
Status
No status