Documentation ¶
Overview ¶
Package expvarom implements an OpenMetrics HTTP exporter for the variables from the expvar package.
This is useful for small servers that want to support both packages with simple enough variables, without introducing any dependencies beyond the standard library.
Some functions to add descriptions and map labels are exported for convenience, but their usage is optional.
For more complex usage (like histograms, counters vs. gauges, etc.), use the OpenMetrics libraries directly.
The exporter uses the text-based format, as documented in: https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format https://github.com/OpenObservability/OpenMetrics/blob/master/specification/OpenMetrics.md
Note the adoption of that format as OpenMetrics' one isn't finalized yet, and it is possible that it will change in the future.
Backwards compatibility is NOT guaranteed, until the format is fully standarized.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetricsHandler ¶
func MetricsHandler(w http.ResponseWriter, r *http.Request)
MetricsHandler implements an http.HandlerFunc which serves the registered metrics, using the OpenMetrics text-based format.
Types ¶
This section is empty.