Skip to content

Commit 7a95f62

Browse files
docs: adjust remove_empty_groups in prometheus.exporter.process (#4979)
* docs: adjust remove_empty_groups in prometheus.exporter.process * Apply suggestions from code review Co-authored-by: Clayton Cornell <[email protected]> --------- Co-authored-by: Clayton Cornell <[email protected]>
1 parent 6dde629 commit 7a95f62

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/sources/reference/components/prometheus/prometheus.exporter.process.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ You can use the following arguments with `prometheus.exporter.process`:
3636
| `track_children` | `bool` | Whether to track a process' children. | `true` | no |
3737
| `track_threads` | `bool` | Report metrics for a process' individual threads. | `true` | no |
3838

39-
If `remove_empty_groups` is `true`, the process "groups" created by the `matcher` blocks continue to report metrics until {{< param "PRODUCT_NAME" >}} is restarted.
40-
This can cause unbounded growth in metrics being reported and resources consumed by {{< param "PRODUCT_NAME" >}} if the `matcher` blocks' `name` arguments define group names that
41-
may be different for new process instances.
42-
This is the default behavior for backwards compatibility, but we recommend that you set `remove_empty_groups` to `false`.
43-
44-
For example, when `remove_empty_groups` is `true` and the `name` argument for a `matcher` block utilizes the `.PID` of
45-
a process, the `matcher` creates a new process group when a new instance of a process in that `matcher` block is identified.
46-
The previous group continues to report metrics even though no running processes are associated with that group.
39+
If you set `remove_empty_groups` to the default, `false`, the process "groups" created by the `matcher` blocks continue to report metrics even after the processes in that group have stopped running.
40+
This ensures you can see when a process count drops to zero, but it can cause unbounded growth in reported metrics and memory usage if your `matcher` generates dynamic group names, for example, using specific PIDs.
41+
The reporting continues until {{< param "PRODUCT_NAME" >}} is restarted.
42+
43+
When you set `remove_empty_groups` to `true`, process groups are forgotten and stop reporting metrics as soon as they contain no running processes.
44+
Grafana recommends that you set `remove_empty_groups` to `true` if your name argument utilizes unique identifiers like `.PID` or `.StartTime`.
45+
46+
For example, when you set `remove_empty_groups` to `false` and the `name` argument for a `matcher` block utilizes the `.PID` of a process, the `matcher` creates a new process group for every new process instance.
47+
The old process groups continue to report metrics with values of 0, even though no running processes are associated with them, leading to high cardinality.
48+
Set `remove_empty_groups` to `true` to remove the old groups, and prevent the high cardinality.
4749

4850
## Blocks
4951

0 commit comments

Comments
 (0)