Visualize Ambient Code operator metrics on OpenShift using User Workload Monitoring.
Operator (OTel) → OTel Collector → OpenShift Prometheus
↓
OpenShift Console
↓
Grafana (optional)
# Deploy observability
make deploy-observability
# View metrics in OpenShift Console → Observe → Metrics
# Optional: Add Grafana
make add-grafanaFull deployment guide: See components/manifests/observability/README.md
| Metric | Description |
|---|---|
ambient_session_startup_duration |
Time from Pending to Running |
ambient_session_phase_transitions |
Phase transition count |
ambient_sessions_total |
Total sessions created |
ambient_sessions_completed |
Sessions in terminal states |
ambient_reconcile_duration |
Reconciliation performance |
ambient_pod_creation_duration |
Pod provisioning speed |
ambient_session_errors |
Errors during reconciliation |
In OpenShift Console → Observe → Metrics:
# Total sessions created
ambient_sessions_total
# Session creation rate
rate(ambient_sessions_total[5m])
# p95 session startup time
histogram_quantile(0.95, rate(ambient_session_startup_duration_bucket[5m]))
# Error rate by namespace
sum by (namespace) (rate(ambient_session_errors[5m]))
# Sessions by final phase
sum by (final_phase) (increase(ambient_sessions_completed[1h]))
For custom dashboards:
# Deploy Grafana
make add-grafana
# Create route
oc create route edge grafana --service=grafana -n ambient-code
# Get URL
oc get route grafana -n ambient-code -o jsonpath='{.spec.host}'
# Login: admin/adminImport dashboard: Upload components/manifests/observability/dashboards/ambient-operator-dashboard.json
-
Check User Workload Monitoring is enabled:
oc -n openshift-user-workload-monitoring get pod
-
Verify ServiceMonitor exists:
oc get servicemonitor ambient-otel-collector -n ambient-code
-
Check OTel Collector is receiving metrics:
oc logs -l app=otel-collector -n ambient-code | grep -i metric -
Test OTel Collector endpoint:
oc port-forward svc/otel-collector 8889:8889 -n ambient-code curl http://localhost:8889/metrics | grep ambient
-
Check Grafana ServiceAccount has permissions:
oc auth can-i get --subresource=metrics pods \ --as=system:serviceaccount:ambient-code:grafana
-
Test datasource in Grafana UI:
- Configuration → Data Sources → OpenShift Prometheus → Test
If you're not on OpenShift, you need to deploy Prometheus yourself:
kubectl apply -f components/manifests/observability/prometheus.yamlUpdate grafana-datasource-patch.yaml to point to http://prometheus:9090 instead of OpenShift Prometheus.