Prometheus Go client library
This library requires Go1.9 or later.
Important note about releases, versioning, tagging, and stability
In this repository, we used to mostly ignore the many coming and going dependency management tools for Go and instead wait for a tool that most of the community would converge on. Our bet is that this tool has arrived now in the form of Go Modules.
To make full use of what Go Modules are offering, the previous versioning roadmap for this repository had to be changed. In particular, Go Modules finally provide a way for incompatible versions of the same package to coexist in the same binary. For that, however, the versions must be tagged with different major versions of 1 or greater (following Semantic Versioning). Thus, we decided to abandon the original plan of introducing a lot of breaking changes before releasing v1 of this repository, mostly driven by the widespread use this repository already has and the relatively stable state it is in.
To leverage the mechanism Go Modules offers for a transition between major version, the current plan is the following:
- The v0.9.x series of releases will see a small number of bugfix releases to deal with a few remaining minor issues (#543, #542, #539).
- After that, all features currently marked as deprecated will be removed, and the result will be released as v1.0.0.
- The planned breaking changes previously gathered as part of the v0.10 milestone will now go into the v2 milestone. The v2 development happens in a separate branch for the time being. v2 releases off that branch will happen once sufficient stability is reached. v1 and v2 will coexist for a while to enable a convenient transition.
- The API client in prometheus/client_golang/api/… is still considered experimental. While it will be tagged alongside the rest of the code according to the plan above, we cannot strictly guarantee semver semantics for it.
contains simple examples of instrumented code.
Client for the Prometheus HTTP API
model packages has been moved to
text packages are now contained in
Contributing and community
Package api provides clients for the HTTP APIs.
|Package api provides clients for the HTTP APIs.|
Package v1 provides bindings to the Prometheus HTTP API v1: http://prometheus.io/docs/querying/api/
|Package v1 provides bindings to the Prometheus HTTP API v1: http://prometheus.io/docs/querying/api/|
A simple example exposing fictional RPC latencies with different types of random distributions (uniform, normal, and exponential) as Prometheus metrics.
|A simple example exposing fictional RPC latencies with different types of random distributions (uniform, normal, and exponential) as Prometheus metrics.|
A minimal example of how to include Prometheus instrumentation.
|A minimal example of how to include Prometheus instrumentation.|
Package prometheus is the core instrumentation package.
|Package prometheus is the core instrumentation package.|
Package graphite provides a bridge to push Prometheus metrics to a Graphite server.
|Package graphite provides a bridge to push Prometheus metrics to a Graphite server.|
Package promauto provides constructors for the usual Prometheus metrics that return them already registered with the global registry (prometheus.DefaultRegisterer).
|Package promauto provides constructors for the usual Prometheus metrics that return them already registered with the global registry (prometheus.DefaultRegisterer).|
Package promhttp provides tooling around HTTP servers and clients.
|Package promhttp provides tooling around HTTP servers and clients.|
Package push provides functions to push metrics to a Pushgateway.
|Package push provides functions to push metrics to a Pushgateway.|
Package testutil provides helpers to test code using the prometheus package of client_golang.
|Package testutil provides helpers to test code using the prometheus package of client_golang.|