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:
- Cilium and Hubble: By default, all Cilium and Hubble metrics are collected. For an overview of metrics that are collected, see the Cilium documentation.
- Additional eBPF metrics: The following metrics are collected for traffic that is sent or received by the workloads in your cluster. Note that Gloo Network must be installed in the cluster to receive these metrics.
ebpf_solo_io_num_conn
: The number of connections between workloads.ebpf_solo_io_bytes_sent
: The number of bytes that were sent for each workload.ebpf_solo_io_bytes_recv
: The number of bytes that were received for each workload.ebpf_solo_io_http_responses
: The number of HTTP responses for each workload.
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.
-
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 withhubble_
andcilium_
.filter/cilium: metrics: include: match_type: regexp metric_names: - hubble_.* - cilium_.* - ebpf_solo_io_.*
-
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
-
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
-
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
-
Verify that the collector agent pods restarted and that they are in a
Running
state.kubectl get pods -n gloo-mesh | grep collector-agent
-
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.
-
Get the Cilium and Hubble metrics that you want to collect. For an overview of supported metrics, see the Cilium documentation.
-
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, thecilium_node_connectivity_status
andcilium_node_connectivity_latency_seconds
metrics are collected. Then, add your custom processor to themetrics/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
-
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
-
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
-
Verify that the collector agent pods restarted and that they are in a
Running
state.kubectl get pods -n gloo-mesh | grep collector-agent
-
Optional: To monitor your Cilium CNI, import the Cilium dashboard.