You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(crossplane-observability): derive the provider job label from the PodMonitor the chart ships
`crossplane.providers.job` defaulted to `crossplane-providers` — a plausible-looking
name that no PodMonitor can ever produce. Prometheus-operator derives a PodMonitor's
job label as `<namespace>/<name>`, so the chart's own provider scrape lands under
`crossplane-system/<release>-crossplane-observability-providers`, and the 11 rules
filtering on `job="crossplane-providers"` matched nothing. Enabling
`providerPodMonitor` therefore produced a working scrape and still-empty rules, with
nothing anywhere reporting a problem.
Fixed the way the core half already works — by deriving the coupling instead of asking
two settings to agree. `crossplane.core.job` names the Service, so core is
self-consistent by construction; `crossplane.providers.job` now defaults to empty,
meaning "the PodMonitor this chart ships", and is computed from the rendered object.
An explicit value still wins, which is the case that matters when a platform scrape
already covers the provider pods.
Guarded so it cannot regress: validate.sh step 1c walks the all-enabled render and
asserts every shipped monitor's job label is one the rules actually query — a
ServiceMonitor's being the Service name, a PodMonitor's being `<namespace>/<name>`.
Confirmed it fails on the old default before the fix. The promtool unit tests render
with an explicit job so their fixtures stay independent of the release name; they test
rule logic, step 1c tests the wiring.
This is the second half of making the addon work without per-cluster values: the
saap-catalog wrapper currently carries
`job: crossplane-system/crossplane-providers-and-functions`, which describes one
cluster's hand-applied PodMonitor and is wrong everywhere else. With this it can drop
the override entirely.
Refs SA-8539, #283
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| `crossplane.providers.job` | *empty* → derived from the chart's own PodMonitor | only when another scrape already covers the provider pods, e.g. `crossplane-system/crossplane-providers-and-functions` |
88
88
| `crossplane.core.serviceMonitorSelector` | `{name:crossplane, component:metrics}` | match your metrics Service labels (only if you enable the chart's monitor) |
89
89
| `crossplane.providers.selector` | `pkg.crossplane.io/revision: Exists` | match your provider pods (only if you enable the chart's monitor) |
90
90
| `grafana.instanceSelector` | `{app: grafana}` | your instance's labels, e.g. `{dashboards: crossplane}` |
@@ -93,6 +93,11 @@ The `job` values are the important ones — **the alert/recording expressions fi
93
93
so if they don't match what your Prometheus assigns, rules evaluate to empty. Find them with
94
94
`count by (job)({__name__=~"crossplane_managed_resource_.+"})`.
95
95
96
+
If you let the chart own the scrape (the `prometheus.monitors.*` toggles above), you do **not**
97
+
need to set either job value: the core Service is named after `crossplane.core.job`, and
98
+
`crossplane.providers.job`left empty is derived from the PodMonitor the chart renders. Both
99
+
couplings are asserted by `./tests/validate.sh`, so they cannot drift apart silently.
100
+
96
101
**Grafana gotchas (grafana-operator):** to change `grafana.instanceSelector` you must also null
97
102
the default key, because Helm deep-merges maps — e.g. `--set grafana.instanceSelector.app=null
98
103
--set grafana.instanceSelector.dashboards=crossplane`. And `spec.instanceSelector` is
@@ -219,7 +224,7 @@ These need cluster/Grafana context an agent can't safely guess:
| `crossplane.providers.job` | `""` | `job` label provider metrics land under. Empty means "the PodMonitor this chart ships", whose job label prometheus-operator derives as `<namespace>/<name>` — computed rather than restated, since a wrong guess renders fine and matches nothing. Set it only when another scrape already covers the provider pods (and then keep `providerPodMonitor` off). |
223
228
| `crossplane.inventory.enabled` | `false` | Enable Claim/inventory rules (needs an exporter — see [example](docs/resource-state-metrics-example.yaml)). |
0 commit comments