From 21a7e9a4546574c0ca81177656381510e84377a6 Mon Sep 17 00:00:00 2001 From: Sam Snarr <38705645+sss-ng@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:54:38 -0400 Subject: [PATCH] updated docs with code to remove default metrics Signed-off-by: Sam Snarr --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b25a55b7..5d0c96bf 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,18 @@ metadata about the JVM in use is also included. This information is available as labels on the `python_info` metric. The value of the metric is 1, since it is the labels that carry information. +### Disabling Default Collector metrics + +By default the collected `process`, `gc`, and `platform` collector metrics are exported. +If this information is not helpful, it can be disabled using the following: +```python +import prometheus_client + +prometheus_client.REGISTRY.unregister(prometheus_client.GC_COLLECTOR) +prometheus_client.REGISTRY.unregister(prometheus_client.PLATFORM_COLLECTOR) +prometheus_client.REGISTRY.unregister(prometheus_client.PROCESS_COLLECTOR) +``` + ## Exporting There are several options for exporting metrics.