Skip to content

Commit 71fb75d

Browse files
authored
Merge pull request #827 from sss-ng/docs/remove-default-metrics
updated docs with code to remove default metrics
2 parents e6b9ebf + 21a7e9a commit 71fb75d

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)