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

< 8000 div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
Skip to content

Commit fcce8b4

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 fcce8b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ 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+
255267
### Disabling `_created` metrics
256268

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

0 commit comments

Comments
 (0)
0