Skip to content

Commit

Permalink
updated docs with code to remove default metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Snarr <sssnarr1@gmail.com>
  • Loading branch information
sss-ng committed Aug 2, 2022
1 parent 748ffb0 commit 21a7e9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 21a7e9a

Please sign in to comment.