On this page
Overview
prometheus/client_golang is the official Prometheus client library for Go applications. It provides Counter, Gauge, Histogram, Summary, and custom Collector instrumentation plus promhttp handlers for scrape endpoints. A separate package also implements a Prometheus HTTP API client.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Instrument application state with metric types and collectors
Counters, gauges, histograms, summaries, and custom collectors can be registered to expose request counts, latency, queue depth, and other runtime data in the Prometheus model.
Sources: [2]
Expose scrape endpoints with promhttp and query Prometheus through its HTTP API
The instrumentation library includes HTTP handlers for Prometheus scraping, while the api/prometheus package provides a client for querying Prometheus HTTP APIs.
Sources: [2]
Best fit
Fits Go services standardizing metrics on the Prometheus/OpenMetrics ecosystem
It is useful for APIs, workers, and batch processes feeding runtime metrics into Prometheus and downstream dashboards or alerting systems.
Sources: [2]
Before adoption
v1.24.1 declares Go 1.25 and experimental surfaces are not fully protected by SemVer
The v1.24.1 go.mod declares Go 1.25, and the README supports the two most recent major Go releases. Experimental surfaces such as the HTTP API client may make breaking changes without a major version bump. Version 1.24.1 also fixes a promhttp panic on requests with a nil URL.
Official sources
- [1]prometheus/client_golang — GitHub repository(2026-10-06)
- [2]client_golang v1.24.1 — README(2026-10-06)
- [3]client_golang v1.24.1 — go.mod(2026-10-06)
- [4]client_golang v1.24.1 release(2026-10-06)
- [5]client_golang Apache-2.0 license(2026-10-06)
Supplemental curator note
This is the standard Go client for exposing Prometheus metrics. Metric-label cardinality and collector lifecycle directly affect operational cost, so keep label values bounded and make registration and HTTP-handler wiring explicit during application startup.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/prometheus/client_golang.git - 2
Enter the repository
cd client_golang - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
6,037 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 56
- Open PRs
- 55
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 6,037
- Forks
- 1,325
- Watchers
- 71
- Open issues
- 89
- Contributors
- 250
- Owner type
- Organization
- Primary language
- Go
- License
- Apache-2.0
- Repository last updated
- Oct 5, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Micrometer4,908 Stars
2 shared tag(s) · 2 shared category(s)
instrument JVM application metrics through a vendor-neutral API
Java - OpenTelemetry Python2,656 Stars
2 shared tag(s) · 2 shared category(s)
instrument Python traces, metrics, and logs through the OpenTelemetry API and SDK
Python - OpenTelemetry Java2,457 Stars
2 shared tag(s) · 2 shared category(s)
embed OpenTelemetry APIs, SDKs, and OTLP exporters for traces, metrics, and logs in Java
Java - Sentry Cocoa1,124 Stars
2 shared tag(s) · 2 shared category(s)
capture errors, crashes, and performance context from Apple applications with the official Sentry SDK
Swift - uptimepage40 Stars
2 shared tag(s) · 2 shared category(s)
run monitoring, status pages, and on-call workflows from one self-hostable service
Rust - Prometheus66,386 Stars
5 shared tag(s) · 1 shared category(s) · Same language
monitor and alert on time-series metrics with PromQL and pull-based collection
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.