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
feat(crossplane-observability): ship the optional core metrics Service
The chart offers `coreServiceMonitor` but never shipped anything for it to
select. Crossplane core serves /metrics with `metrics.enabled=true`, but
upstream ships no Service in front of that port, so on any cluster without a
hand-applied one the monitor matches nothing and every core rule and panel
evaluates against no data — silently.
Found live on eu-2: the addon deployed clean (14 objects, 21 rules health=ok)
and the dashboard was still empty, because eu-2 has no crossplane-metrics
Service, no ServiceMonitor/PodMonitor and no inventory exporter. us-2 only
works because three unowned `kubectl apply`ed platform objects happen to exist
there. Probing the eu-2 core pod IP directly returned HTTP 200 and 1.84 MB of
metrics, so the data was there all along with nothing to scrape it.
Adds `prometheus.monitors.coreMetricsService` (default off), a headless Service
reproducing the object us-2 proved works. Two couplings are derived rather than
restated, so the pair cannot drift apart:
* the Service name defaults to `crossplane.core.job`, because
prometheus-operator takes a ServiceMonitor's job label from the Service —
the same label the alert and recording expressions filter on;
* its labels are `crossplane.core.serviceMonitorSelector.matchLabels`, so the
monitor this chart ships always matches the Service it ships.
`selector` stays install-specific and must be set per cluster: the upstream
chart labels core pods `release: <helm release name>`, which is `crossplane` on
eu-2 but `crossplane-operator` on us-2.
Verified: rendered Service is label-, port- and headless-identical to us-2's
working hand-applied one; `kubectl apply --dry-run=server` on eu-2 accepts it
and the default selector matches the live core pod. `./tests/validate.sh` green
(25 objects strict-validated, up from 24; 29 rules; 39 panel queries).
Also documents in docs/values-stakater-cloud-example.yaml that "the cluster
already scrapes Crossplane" is a per-cluster assumption, not a Stakater Cloud
guarantee, plus the PodMonitor job-label trap (`<ns>/<podmonitor-name>`, which
does not match the example's `crossplane.providers.job`).
Refs SA-8539, #283
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: crossplane-observability/README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,11 @@ UWM evaluates these `PrometheusRule`s in `thanos-ruler-user-workload`.
52
52
### 2. Crossplane metrics exposed
53
53
54
54
- **Core:** start core with `--set metrics.enabled=true` (Helm) so `/metrics` is served.
55
+
Upstream ships **no Service** in front of that port, so a `ServiceMonitor` has nothing to
56
+
select. Either point `crossplane.core.serviceMonitorSelector` at a metrics Service your
57
+
cluster already has, or let this chart create one with
58
+
`prometheus.monitors.coreMetricsService.enabled=true`(set its `selector` to your core pod
59
+
labels — the upstream chart labels them `app: crossplane`, `release: <release name>`).
55
60
- **Providers:** expose a metrics port on each provider via its `DeploymentRuntimeConfig`.
56
61
Every crossplane-runtime provider emits `crossplane_managed_resource_*` natively
57
62
(ready/synced/TTR/drift) — no external exporter is needed for leaf-MR health.
@@ -61,6 +66,7 @@ Then turn on the scrapers (both default to `false`):
61
66
```yaml
62
67
prometheus:
63
68
monitors:
69
+
coreMetricsService: { enabled: true } # only if the cluster has no metrics Service
64
70
coreServiceMonitor: { enabled: true }
65
71
providerPodMonitor: { enabled: true }
66
72
```
@@ -223,6 +229,8 @@ These need cluster/Grafana context an agent can't safely guess:
223
229
| `grafana.compositeAlerts.enabled` | `false` | Story 4.1 composite alerts as **Grafana-managed** rules (use on UWM instead of the PrometheusRule composite alerts). |
224
230
| `grafana.compositeAlerts.datasourceUid` | `""` | **Required when enabled** — UID of the cross-namespace Prometheus/Thanos datasource in Grafana. |
225
231
| `grafana.namespace` | release ns | Namespace to create the GrafanaDashboard in. |
232
+
| `prometheus.monitors.coreMetricsService.enabled` | `false` | Create the headless metrics Service for Crossplane core (upstream ships none, so `coreServiceMonitor` has nothing to select without it). Its name defaults to `crossplane.core.job` — which is what makes the `job` label match — and its labels to `crossplane.core.serviceMonitorSelector.matchLabels`. |
233
+
| `prometheus.monitors.coreMetricsService.selector` | `{app: crossplane, release: crossplane}` | Pod labels of the Crossplane core Deployment. **Install-specific** — the upstream chart sets `release: <helm release name>`. |
0 commit comments