Description
metrics is a lightweight Go package from the VictoriaMetrics team for exporting application metrics in the Prometheus text format. It is offered as a simpler alternative to the official Prometheus client_golang library, with few and small dependencies and an easy API. It supports exposing separate metric sets on separate endpoints, histograms that work without bucket tuning, and pushing metrics to VictoriaMetrics or any remote storage that accepts the Prometheus exposition format. TYPE and HELP metadata are off by default and can be enabled with one call. The package was extracted from the VictoriaMetrics source. It deliberately leaves out the more advanced parts of client_golang, and its API is not compatible with it; the README FAQ explains these choices.…
Highlights
- Exports metrics in Prometheus text format
- Minimal, small third-party dependencies
- Separate metric sets on separate endpoints
- Histograms that need no bucket tuning
- Push metrics to VictoriaMetrics or other remote storage
Ratings & Reviews
No ratings yet
Be the first to rate Metrics.
People also visit
Micrometer
An application observability facade for the most popular observability tools
Metrics FAQ
What is this package for?
Instrumenting Go applications and exposing their metrics in the Prometheus text exposition format with a small, simple library.
Is it compatible with prometheus/client_golang?
No. The authors chose a simpler API because they consider client_golang too complex, and advanced client_golang features are not implemented.
How do I get TYPE and HELP lines?
They are not emitted by default. Call ExposeMetadata(true) to generate them for each metric.
How do I do the equivalent of CounterVec?
Use GetOrCreateCounter instead of CounterVec.With.
Can it push metrics instead of being scraped?
Yes. It can push to VictoriaMetrics or any remote storage that accepts the Prometheus text format.
What are the best Metrics alternatives?
Popular alternatives to Metrics include VictoriaMetrics, Client JS and Promster. See all Metrics alternatives




