Skip to content

Commit

Permalink
Merge pull request #827 from sss-ng/docs/remove-default-metrics
Browse files Browse the repository at this point in the history
updated docs with code to remove default metrics
  • Loading branch information
csmarchbanks authored Oct 11, 2022
2 parents e6b9ebf + 21a7e9a commit 71fb75d
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 71fb75d

Please sign in to comment.