Skip to content

Commit 128fce6

Browse files
committed
README: document the OpenTelemetry OTLP push bridge
Adds a short section pointing users at `go.opentelemetry.io/contrib/bridges/prometheus`, which wraps a `prometheus.Registry` so client_golang-instrumented applications can push metrics via OTLP without re-instrumenting against a different metric API. Keeps the upstream recommendation that pull-based `promhttp` is still the default; the bridge is positioned as an additional option for batch jobs and push-only environments. Closes #1495. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
1 parent 42dc83b commit 128fce6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@ The
4848
[`examples` directory](https://github.com/prometheus/client_golang/tree/main/examples)
4949
contains simple examples of instrumented code.
5050

51+
## Pushing metrics via OpenTelemetry OTLP
52+
53+
Applications instrumented with `client_golang` can also export their
54+
metrics via the OpenTelemetry OTLP push protocol without re-instrumenting
55+
against a different metric API. The
56+
[`go.opentelemetry.io/contrib/bridges/prometheus`](https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/prometheus)
57+
module wraps a `prometheus.Registry` as an OpenTelemetry metric producer,
58+
which an OTLP exporter (HTTP or gRPC) can then push to an OTel collector
59+
or OTLP-accepting backend. This is useful for batch jobs or environments
60+
where pull-based `/metrics` scraping is not an option.
61+
62+
Pull-based collection via `promhttp` remains the recommended default for
63+
reliability, central discovery, and failover. The bridge is intended as
64+
an additional option, not a replacement.
65+
66+
See the [bridge's Go reference](https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/prometheus)
67+
and [source](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/bridges/prometheus)
68+
for setup details.
69+
5170
## Client for the Prometheus HTTP API
5271

5372
[![Go Reference](https://pkg.go.dev/badge/github.com/prometheus/client_golang/api.svg)](https://pkg.go.dev/github.com/prometheus/client_golang/api)

0 commit comments

Comments
 (0)