Summary
The operator should expose Prometheus metrics for observability. This includes both controller-runtime default metrics and custom business metrics.
Proposed Metrics
Controller-Runtime Defaults (already available via controller-runtime)
These are automatically exposed when a metrics server is enabled:
controller_runtime_reconcile_total - Total reconciliations per controller
controller_runtime_reconcile_errors_total - Reconciliation errors
controller_runtime_reconcile_time_seconds - Reconciliation duration
workqueue_depth - Work queue depth
Custom Business Metrics
| Metric |
Type |
Labels |
Description |
openvox_config_info |
Gauge |
name, namespace, phase |
Config resource info |
openvox_ca_ready |
Gauge |
name, namespace |
CA readiness (0/1) |
openvox_ca_crl_refresh_total |
Counter |
name, namespace |
CRL refresh count |
openvox_ca_crl_refresh_errors_total |
Counter |
name, namespace |
CRL refresh errors |
openvox_certificate_status |
Gauge |
name, namespace, phase |
Certificate status |
openvox_server_replicas_desired |
Gauge |
name, namespace |
Desired server replicas |
openvox_server_replicas_ready |
Gauge |
name, namespace |
Ready server replicas |
openvox_pool_endpoints |
Gauge |
name, namespace |
Pool endpoint count |
Implementation Steps
- Enable metrics server in the operator manager setup (controller-runtime provides this)
- Register custom metrics using
prometheus/client_golang
- Expose metrics port (default: 8080) in the operator Deployment
- Add ServiceMonitor template to the Helm chart (for Prometheus Operator)
- Add PodMonitor template as alternative (for environments without ServiceMonitor CRD)
- Document available metrics and example Grafana dashboard
Helm Chart Changes
- Add
metrics.enabled value (default: true)
- Add
metrics.port value (default: 8080)
- Add optional
ServiceMonitor template
- Add optional
PodMonitor template
- Expose metrics port in the operator Service
References
Summary
The operator should expose Prometheus metrics for observability. This includes both controller-runtime default metrics and custom business metrics.
Proposed Metrics
Controller-Runtime Defaults (already available via controller-runtime)
These are automatically exposed when a metrics server is enabled:
controller_runtime_reconcile_total- Total reconciliations per controllercontroller_runtime_reconcile_errors_total- Reconciliation errorscontroller_runtime_reconcile_time_seconds- Reconciliation durationworkqueue_depth- Work queue depthCustom Business Metrics
openvox_config_infoname,namespace,phaseopenvox_ca_readyname,namespaceopenvox_ca_crl_refresh_totalname,namespaceopenvox_ca_crl_refresh_errors_totalname,namespaceopenvox_certificate_statusname,namespace,phaseopenvox_server_replicas_desiredname,namespaceopenvox_server_replicas_readyname,namespaceopenvox_pool_endpointsname,namespaceImplementation Steps
prometheus/client_golangHelm Chart Changes
metrics.enabledvalue (default: true)metrics.portvalue (default: 8080)ServiceMonitortemplatePodMonitortemplateReferences