From 147c9d1ac01ae0c36446d1dee79aae85aaf98a6e Mon Sep 17 00:00:00 2001 From: Chris Marchbanks Date: Mon, 22 Jan 2024 17:00:28 -0700 Subject: [PATCH] Update documentation for disabling _created metrics (#992) Signed-off-by: Chris Marchbanks --- docs/content/instrumenting/_index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/content/instrumenting/_index.md b/docs/content/instrumenting/_index.md index 7f282737..13bbc6b6 100644 --- a/docs/content/instrumenting/_index.md +++ b/docs/content/instrumenting/_index.md @@ -13,4 +13,8 @@ on how to use them. By default counters, histograms, and summaries export an additional series suffixed with `_created` and a value of the unix timestamp for when the metric was created. If this information is not helpful, it can be disabled by setting -the environment variable `PROMETHEUS_DISABLE_CREATED_SERIES=True`. \ No newline at end of file +the environment variable `PROMETHEUS_DISABLE_CREATED_SERIES=True` or in code: +```python +from prometheus_client import disable_created_metrics +disable_created_metrics() +```