Movatterモバイル変換


[0]ホーム

URL:


client_golang

module
v1.23.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License:Apache-2.0

Details

Repository

github.com/prometheus/client_golang

Links

README

Prometheus Go client library

CIGo Report CardGo ReferenceOpenSSF ScorecardSlack

This is theGo client library forPrometheus. It has two separate parts, one forinstrumenting application code, and one for creating clients that talk to thePrometheus HTTP API.

Version Compatibility

This library supports the two most recent major releases of Go. While it may function with older versions, we only provide fixes and support for the currently supported Go releases.

[!NOTE]See ourRelease Process for details on compatibility and support policies.

Important note about releases and stability

This repository generally followsSemanticVersioning. However, the API client inprometheus/client_golang/api/… is still considered experimental. Breakingchanges of the API client willnot trigger a new major release. The same istrue for selected other new features explicitly marked asEXPERIMENTAL inCHANGELOG.md.

Features that require breaking changes in the stable parts of the repositoryare being batched up and tracked in thev2milestone, but plans for further development of v2 at the moment.

NOTE: The initial v2 attempt is in aseparate branch. We also startedexperimenting on a newprometheus.V2.* APIs inthe 1.x's V2 struct. Help wanted!

Instrumenting applications

Go Reference

Theprometheus directorycontains the instrumentation library. See theguide on the Prometheuswebsite to learn more about instrumenting applications.

Theexamples directorycontains simple examples of instrumented code.

Client for the Prometheus HTTP API

Go Reference

Theapi/prometheus directorycontains the client for thePrometheus HTTP API. It allows youto write Go applications that query time series data from a Prometheusserver. It is still in alpha stage.

Where ismodel,extraction, andtext?

Themodel packages has been moved toprometheus/common/model.

Theextraction andtext packages are now contained inprometheus/common/expfmt.

Contributing and community

See thecontributing guidelines and theCommunity section of the homepage.

client_golang community is also present on the CNCF Slack#prometheus-client_golang.

Directories

PathSynopsis
Package api provides clients for the HTTP APIs.
Package api provides clients for the HTTP APIs.
prometheus/v1
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/
examples
exemplarscommand
gocollectorcommand
A minimal example of how to include Prometheus instrumentation.
A minimal example of how to include Prometheus instrumentation.
middlewarecommand
middleware/httpmiddleware
Package httpmiddleware is adapted from https://github.com/bwplotka/correlator/tree/main/examples/observability/ping/pkg/httpinstrumentation
Package httpmiddleware is adapted from https://github.com/bwplotka/correlator/tree/main/examples/observability/ping/pkg/httpinstrumentation
randomcommand
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.
simplecommand
A minimal example of how to include Prometheus instrumentation.
A minimal example of how to include Prometheus instrumentation.
versioncollectorcommand
A minimal example of how to include Prometheus instrumentation.
A minimal example of how to include Prometheus instrumentation.
expmodule
internal
github.com/golang/gddo/httputil/header
Package header provides functions for parsing HTTP headers.
Package header provides functions for parsing HTTP headers.
Package prometheus is the core instrumentation package.
Package prometheus is the core instrumentation package.
collectors
Package collectors provides implementations of prometheus.Collector to conveniently collect process and Go-related metrics.
Package collectors provides implementations of prometheus.Collector to conveniently collect process and Go-related metrics.
graphite
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.
promauto
Package promauto provides alternative constructors for the fundamental Prometheus metric types and their …Vec and …Func variants.
Package promauto provides alternative constructors for the fundamental Prometheus metric types and their …Vec and …Func variants.
promhttp
Package promhttp provides tooling around HTTP servers and clients.
Package promhttp provides tooling around HTTP servers and clients.
promhttp/zstd
Package zstd activates support for zstd compression.
Package zstd activates support for zstd compression.
push
Package push provides functions to push metrics to a Pushgateway.
Package push provides functions to push metrics to a Pushgateway.
testutil
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.
testutil/promlint
Package promlint provides a linter for Prometheus metrics.
Package promlint provides a linter for Prometheus metrics.
tutorials
whatsupmodule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp