The OpenTelemetry Collector, when configured with a Prometheus receiver, provides an integration with Cilium to scrape Prometheus metrics. The Collector uses the Prometheus Receiver to fetch metrics from the configured path in the Cilium configuration file. From there, the metrics are processed and exported to Cloud Observability. This integration also includes using Kubernetes operators for both the Collector and Cilium - the Cilium Operator ensures that services requiring monitoring expose relevant metrics.
To complete the integration, you will:
See also Use Prometheus with an OpenTelemetry Collector on
(Cloud Observability documentation)
When running Cilium with Hubble and a Cilium operator in Kubernetes environment, you can export Prometheus metrics from:
You need to enable metrics for each of these and optionally configure ports (if you can’t use the default).
Following are the Cilium settings needed to publish the metrics at the default
ports on a service called
1 2 3 prometheus.enabled=true operator.prometheus.enabled=true hubble.prometheus.enabled=true
You can find additional details, such as how to configure custom ports and using other configuration formats, see the Cilium documentation.
In the Collector configuration file, configure the Prometheus receiver to use the Cilium Prometheus endpoint as a scrape target.
This example uses the service names and ports sent in the Cilium Operator.
1 2 3 4 5 6 7 8 9 10 receivers: prometheus: config: scrape_configs: - job_name: 'otel-cilium-eg' static_configs: - targets: - cilium-agent.kube-system.svc.cluster.local:9962 - cilium-agent.kube-system.svc.cluster.local:9963 - hubble-metrics.kube-system.svc.cluster.local:9965
The OpenTelemetry repo’s readme provides additional details about Prometheus receiver configuration.
More details about the Prometheus scrape configuration can be found here.
Once the Cilium receiver is configured, enable it by adding it to one or more pipelines as described in the Collector configuration documentation.
You can validate that metrics are reporting to Cloud Observability on the Metrics details page in Project settings.
In Cloud Observability, click Project settings > Metric details.
Search for Cilium metric names.
See the Cilium docs for a complete list of emitted metrics.
If needed, click on the metric to edit the description and how the units are displayed in Cloud Observability.
For a more complete example that’s ready to run, see the Cilium integration in Cloud Observability OpenTelemetry Examples.
OpenTelemetry Operator documentation
Updated Dec 1, 2022