Enable Cilium metrics

If your cluster uses the Cilium CNI, such as when you installed Gloo Network, you can add the filter/cilium processor to your telemetry collector configuration to collect the following metrics:

To customize the Cilium metrics that you want to collect, you can add your own processor to the Gloo OTel pipeline. For more information, see Customize the Cilium metrics collection.

  1. Review the configuration of the filter/cilium processor that is built in to the Gloo OpenTelemetry pipeline. This configuration includes a regex that scrapes all metrics that start with hubble_ and cilium_.

    filter/cilium:
      metrics:
        include:
          match_type: regexp
          metric_names:
            - hubble_.*
            - cilium_.*
            - ebpf_solo_io_.*
    
  2. Follow the steps to set up the pipeline. In your Helm values file, enable the metrics/cilium pipeline that uses the processor that you reviewed in the previous step.

    telemetryCollector:
      enabled: true
    telemetryCollectorCustomization:
      pipelines:
        metrics/cilium:
          enabled: true
       

    Use the following command to upgrade your Gloo Platform installation.

    helm upgrade -i gloo-platform gloo-platform/gloo-platform \
      --namespace gloo-mesh \
      --values gloo-gateway-single.yaml \
      --set telemetryCollector.config.exporters.otlp.endpoint=$TELEMETRY_GATEWAY_ADDRESS \
      --set prometheus.metrics="{+cilium_bpf_map_pressure,+cilium_bpf_syscall_duration_seconds}" \
      --version $UPGRADE_VERSION
    
  3. Verify that the configmap for the collector agent is updated with the values that you set in the values file.

    kubectl get configmap gloo-telemetry-collector-config -n gloo-mesh -o yaml
    
  4. Restart the collector agent daemon set to apply the configmap changes to all of the telemetry collector agent pods.

    kubectl rollout restart -n gloo-mesh daemonset/gloo-telemetry-collector-agent
    
  5. Verify that the collector agent pods restarted and that they are in a Running state.

    kubectl get pods -n gloo-mesh | grep collector-agent
    
  6. Optional: To monitor your Cilium CNI, import the Cilium dashboard.

Customize the Cilium metrics collection

Instead of enabling all Hubble and Cilium metrics that the Cilium agent emits, you can customize the Cilium processor and include only the metrics that you want to collect.

  1. Get the Cilium and Hubble metrics that you want to collect. For an overview of supported metrics, see the Cilium documentation.

  2. Follow the steps to set up the pipeline. In your Helm values file, disable the metrics/cilium pipeline, and create a custom pipeline for the metrics that you want to collect. In the following example, the cilium_node_connectivity_status and cilium_node_connectivity_latency_seconds metrics are collected. Then, add your custom processor to the metrics/cilium pipeline.

    telemetryCollector:
      enabled: true
    telemetryCollectorCustomization:
      extraProcessors:
        filter/cilium-custom:
          metrics:
            include:
              match_type: strict
              metric_names:
                # cilium hubble metrics to include
                - cilium_node_connectivity_status
                - cilium_node_connectivity_latency_seconds
      extraPipelines:
        metrics/cilium-custom:
          receivers:
            - prometheus
          processors:
            - memory_limiter
            - filter/cilium-custom
            - batch
          exporters:
            - otlp
       

    Use the following command to upgrade your Gloo Platform installation.

    helm upgrade -i gloo-platform gloo-platform/gloo-platform \
      --namespace gloo-mesh \
      --values gloo-gateway-single.yaml \
      --set telemetryCollector.config.exporters.otlp.endpoint=$TELEMETRY_GATEWAY_ADDRESS \
      --set prometheus.metrics="{+cilium_bpf_map_pressure,+cilium_bpf_syscall_duration_seconds}" \
      --version $UPGRADE_VERSION
    
  3. Verify that the configmap for the collector agent is updated with the values that you set in the values file.

    kubectl get configmap gloo-telemetry-collector-config -n gloo-mesh -o yaml
    
  4. Restart the collector agent daemon set to apply the configmap changes to all of the telemetry collector agent pods.

    kubectl rollout restart -n gloo-mesh daemonset/gloo-telemetry-collector-agent
    
  5. Verify that the collector agent pods restarted and that they are in a Running state.

    kubectl get pods -n gloo-mesh | grep collector-agent
    
  6. Optional: To monitor your Cilium CNI, import the Cilium dashboard.