You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add built-in extension to export metric for Prometheus. For example:
// NewCollector returns a collector that exports metrics about current version// information.funcNewCollector(programstring) prometheus.Collector {
returnprometheus.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 { return1 },
)
}
The text was updated successfully, but these errors were encountered:
Description
Add built-in extension to export metric for Prometheus. For example:
The text was updated successfully, but these errors were encountered: