client_golang is an instrumentation library for Go applications that exports metrics to Prometheus.
The library solves the problem of collecting and exposing application metrics in a format that Prometheus can scrape. It provides two main components: an instrumentation API for adding metrics to application code, and an HTTP API client for querying data from Prometheus servers. Applications use the instrumentation part to define and record metrics like counters, gauges, and histograms, which are then exposed via an HTTP endpoint that Prometheus pulls from periodically.
Developers instrumenting Go applications should choose this library if they want native Prometheus integration with pull-based metric collection. It suits any Go service that needs to expose operational metrics to a Prometheus monitoring system. The library also supports exporting metrics via OpenTelemetry OTLP for environments where pull-based scraping is not feasible, though pull-based collection remains the recommended approach. The HTTP API client for querying Prometheus is still experimental and may see breaking changes without triggering a major version bump.
The project maintains support for the two most recent major releases of Go. Development is proceeding with batched breaking changes tracked toward a v2 milestone, with experimental work on new APIs happening in parallel within the stable release branch. The repository explicitly solicits help on the v2 effort.