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 Lightstep 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:

  • Configure Cilium to use the Prometheus exporter.
  • Configure the Collector to use the Cilium endpoint as a scrape target for the Prometheus receiver.
  • Enable the integration by adding it to a pipeline.

Prerequisites

Configure Cilium reporting

When running Cilium with Hubble and a Cilium operator in Kubernetes environment, you can export Prometheus metrics from:

  • Prometheus
  • The Cilium Operator
  • Hubble

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 cilim-agent.

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.

More details about using Cilium with the Prometheus exporter can be found here.

Configure the Collector receiver

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.

Enable the Collector receiver

Once the Cilium receiver is configured, enable it by adding it to one or more pipelines as described in the Collector configuration documentation.

Validate metrics are reporting to Lightstep

You can validate that the metrics are reporting to Lightstep from the Metric details section of the Project Settings page.

  1. Open the Project settings page and scroll to the Metric details section.

  2. Search for Cilium metric names. Search for metric

    See the Cilium docs for a complete list of emitted metrics.

  3. If needed, click on the metric to edit the description and how the units are displayed in Lightstep.

Create a dashboard for the metrics

Use the Lightstep Terraform Provider to create a dashboard for the metrics.

Additional resources