Skip to content

Add operator monitoring and Prometheus metrics #33

@slauger

Description

@slauger

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

  1. Enable metrics server in the operator manager setup (controller-runtime provides this)
  2. Register custom metrics using prometheus/client_golang
  3. Expose metrics port (default: 8080) in the operator Deployment
  4. Add ServiceMonitor template to the Helm chart (for Prometheus Operator)
  5. Add PodMonitor template as alternative (for environments without ServiceMonitor CRD)
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions