8000 updated docs with code to remove default metrics · chnacib/client_python@21a7e9a · GitHub
[go: up one dir, main page]

Skip to content

Commit 21a7e9a

Browse files
committed
updated docs with code to remove default metrics
Signed-off-by: Sam Snarr <sssnarr1@gmail.com>
1 parent 748ffb0 commit 21a7e9a

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
@@ -278,6 +278,18 @@ metadata about the JVM in use is also included. This information is available as
278278
labels on the `python_info` metric. The value of the metric is 1, since it is the
279279
labels that carry information.
280280

281+
### Disabling Default Collector metrics
282+
283+
By default the collected `process`, `gc`, and `platform` collector metrics are exported.
284+
If this information is not helpful, it can be disabled using the following:
285+
```python
286+
import prometheus_client
287+
288+
prometheus_client.REGISTRY.unregister(prometheus_client.GC_COLLECTOR)
289+
prometheus_client.REGISTRY.unregister(prometheus_client.PLATFORM_COLLECTOR)
290+
prometheus_client.REGISTRY.unregister(prometheus_client.PROCESS_COLLECTOR)
291+
```
292+
281293
## Exporting
282294

283295
There are several options for exporting metrics.

0 commit comments

Comments
 (0)
0