Skip to content

Commit e6d2a12

Browse files
docs: Add info about rule block in prometheus.operator.podmonitor docs (#5335)
Update the prometheus.operator.podmonitor docs to add additional clarifying info about rule blocks. Minor tidy for style and active voice. Fixes #4199
1 parent ff508c0 commit e6d2a12

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

docs/sources/reference/components/prometheus/prometheus.operator.podmonitors.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The default configuration assumes {{< param "PRODUCT_NAME" >}} is running inside
2323
You can run it from outside the cluster by supplying connection info in the `client` block, but network level access to Pods is required to scrape metrics from them.
2424

2525
PodMonitors may reference secrets for authenticating to targets to scrape them.
26-
In these cases, the secrets are loaded and refreshed only when the PodMonitor is updated or when this component refreshes its' internal state, which happens on a 5-minute refresh cycle.
26+
In these cases, the secrets are loaded and refreshed only when the PodMonitor is updated or when this component refreshes its internal state, which happens on a 5-minute refresh cycle.
2727

2828
## Usage
2929

@@ -37,11 +37,11 @@ prometheus.operator.podmonitors "<LABEL>" {
3737

3838
You can use the following arguments with `prometheus.operator.podmonitors`:
3939

40-
| Name | Type | Description | Default | Required |
41-
| ----------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------- | ------- | -------- |
42-
| `forward_to` | `list(MetricsReceiver)` | List of receivers to send scraped metrics to. | | yes |
43-
| `namespaces` | `list(string)` | List of namespaces to search for PodMonitor resources. If not specified, all namespaces will be searched. | | no |
44-
| `informer_sync_timeout` | `duration` | Timeout for initial sync of PodMonitor resources. | `"1m"` | no |
40+
| Name | Type | Description | Default | Required |
41+
| ----------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | ------- | -------- |
42+
| `forward_to` | `list(MetricsReceiver)` | List of receivers to send scraped metrics to. | | yes |
43+
| `namespaces` | `list(string)` | List of namespaces to search for PodMonitor resources. If not specified, all namespaces are searched. | | no |
44+
| `informer_sync_timeout` | `duration` | Timeout for initial sync of PodMonitor resources. | `"1m"` | no |
4545

4646
## Blocks
4747

@@ -143,8 +143,14 @@ If {{< param "PRODUCT_NAME" >}} is _not_ running in clustered mode, then the blo
143143

144144
### `rule`
145145

146+
The `rule` block configures relabeling rules to apply to discovered scrape targets.
147+
The `drop` and `keep` actions filter targets, not individual metrics.
148+
To filter or relabel metrics after scraping, use a [`prometheus.relabel`][prometheus.relabel] component.
149+
146150
{{< docs/shared lookup="reference/components/rule-block.md" source="alloy" version="<ALLOY_VERSION>" >}}
147151

152+
[prometheus.relabel]: ../prometheus.relabel/
153+
148154
### `scrape`
149155

150156
{{< docs/shared lookup="reference/components/prom-operator-scrape.md" source="alloy" version="<ALLOY_VERSION>" >}}
@@ -180,12 +186,12 @@ The `operator` argument must be one of the following strings:
180186
* `"Exists"`
181187
* `"DoesNotExist"`
182188

183-
If there are multiple `match_expressions` blocks inside of a `selector` block, they are combined together with AND clauses.
189+
If there are multiple `match_expressions` blocks inside of a `selector` block, they're combined together with AND clauses.
184190

185191
## Exported fields
186192

187193
`prometheus.operator.podmonitors` doesn't export any fields.
188-
It forwards all metrics it scrapes to the receiver configures with the `forward_to` argument.
194+
It forwards all metrics it scrapes to the receiver configured with the `forward_to` argument.
189195

190196
## Component health
191197

@@ -223,7 +229,7 @@ prometheus.operator.podmonitors "pods" {
223229
}
224230
```
225231

226-
This example will limit discovered PodMonitors to ones with the label `team=ops` in a specific namespace: `my-app`.
232+
The following example limits discovered PodMonitors to ones with the label `team=ops` in a specific namespace: `my-app`.
227233

228234
```alloy
229235
prometheus.operator.podmonitors "pods" {

0 commit comments

Comments
 (0)