8000 Add documentation for how to export exemplars · draftcode/client_python@742b8b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 742b8b2

Browse files
committed
Add documentation for how to export exemplars
Expand our exemplar documentation to include information for how to use the appropriate exposition code and mention the feature flag required in Prometheus to ingest exemplars. Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
1 parent 4d68ba1 commit 742b8b2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ h = Histogram('request_latency_seconds', 'Description of histogram')
252252
h.observe(4.7, {'trace_id': 'abc123'})
253253
```
254254

255+
Exemplars are only rendered in the OpenMetrics exposition format. If using the
256+
HTTP server or apps in this library, content negotiation can be used to specify
257+
OpenMetrics (which is done by default in Prometheus). Otherwise it will be
258+
necessary to use `generate_latest` from
259+
`prometheus_client.openmetrics.exposition` to view exemplars.
260+
261+
To view exemplars in Prometheus it is also necessary to enable the the
262+
exemplar-storage feature flag:
263+
```
264+
--enable-feature=exemplar-storage
265+
```
266+
Additional information is available in [the Prometheus
267+
documentation](https://prometheus.io/docs/prometheus/latest/feature_flags/#exemplars-storage).
268+
255269
### Disabling `_created` metrics
256270

257271
By default counters, histograms, and summaries export an additional series

0 commit comments

Comments
 (0)
0