Skip to content

Latest commit

 

History

History
 
 

cilium

Agent Check: Cilium

Overview

This check monitors Cilium through the Datadog Agent. The integration can either collect metrics from the cilium-agent or cilium-operator.

Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.

Installation

The Cilium check is included in the Datadog Agent package, but it requires additional setup steps to expose Prometheus metrics.

  1. In order to enable Prometheus metrics in both the cilium-agent and cilium-operator, deploy Cilium with the following Helm values set according to your version of Cilium:
    • Cilium < v1.8.x: global.prometheus.enabled=true
    • Cilium >= v1.8.x and < v1.9.x: global.prometheus.enabled=true and global.operatorPrometheus.enabled=true
    • Cilium >= 1.9.x: prometheus.enabled=true and operator.prometheus.enabled=true

Or, separately enable Prometheus metrics in the Kubernetes manifests:

  • In the cilium-agent add --prometheus-serve-addr=:9090 to the args section of the Cilium DaemonSet config:

    # [...]
    spec:
      containers:
        - args:
            - --prometheus-serve-addr=:9090
  • In the cilium-operator add --enable-metrics to the args section of the Cilium deployment config:

    # [...]
    spec:
      containers:
        - args:
            - --enable-metrics

Configuration

Host

To configure this check for an Agent running on a host:

  1. Edit the cilium.d/conf.yaml file, in the conf.d/ folder at the root of your Agent's configuration directory to start collecting your Cilium performance data. See the sample cilium.d/conf.yaml for all available configuration options.

    • To collect cilium-agent metrics, enable the agent_endpoint option.
    • To collect cilium-operator metrics, enable the operator_endpoint option.
        instances:
        
            ## @param use_openmetrics - boolean - optional - default: false
            ## Use the latest OpenMetrics V2 implementation for more features and better performance.
            ##
            ## Note: To see the configuration options for the legacy OpenMetrics implementation (Agent 7.33 or older),
            ## https://github.com/DataDog/integrations-core/blob/7.33.x/cilium/datadog_checks/cilium/data/conf.yaml.example
            #
          - use_openmetrics: true # Enables OpenMetrics V2
        
            ## @param agent_endpoint - string - optional
            ## The URL where your application metrics are exposed by Prometheus.
            ## By default, the Cilium integration collects `cilium-agent` metrics.
            ## One of agent_endpoint or operator_endpoint must be provided.
            #
            agent_endpoint: http://localhost:9090/metrics
        
            ## @param operator_endpoint - string - optional
            ## Provide instead of `agent_endpoint` to collect `cilium-operator` metrics.
            ## Cilium operator metrics are exposed on port 6942.
            #
            operator_endpoint: http://localhost:6942/metrics

    NOTE: By default, the use_openmetrics option is enabled in the conf.yaml.example. Set the use_openmetrics configuration option to false to use the OpenMetrics V1 implementation. To view the configuration parameters for OpenMetrics V1, see the conf.yaml.example file.

    You can read more about OpenMetrics V2.

  2. Restart the Agent.

Log collection

Cilium contains two types of logs: cilium-agent and cilium-operator.

  1. Collecting logs is disabled by default in the Datadog Agent. Enable it in your DaemonSet configuration:

      # (...)
        env:
        #  (...)
          - name: DD_LOGS_ENABLED
              value: "true"
          - name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
              value: "true"
      # (...)
  2. Mount the Docker socket to the Datadog Agent through the manifest or mount the /var/log/pods directory if you are not using Docker. For example manifests see the Kubernetes Installation instructions for DaemonSet.

  3. Restart the Agent.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes Log Collection.

To collect cilium-agent metrics and logs:
  • Metric collection
Parameter Value
<INTEGRATION_NAME> "cilium"
<INIT_CONFIG> blank or {}
<INSTANCE_CONFIG> {"agent_endpoint": "http://%%host%%:9090/metrics", "use_openmetrics": "true"}
  • Log collection
Parameter Value
<LOG_CONFIG> {"source": "cilium-agent", "service": "cilium-agent"}
To collect cilium-operator metrics and logs:
  • Metric collection
Parameter Value
<INTEGRATION_NAME> "cilium"
<INIT_CONFIG> blank or {}
<INSTANCE_CONFIG> {"operator_endpoint": "http://%%host%%:6942/metrics", "use_openmetrics": "true"}
  • Log collection
Parameter Value
<LOG_CONFIG> {"source": "cilium-operator", "service": "cilium-operator"}

Validation

Run the Agent's status subcommand and look for cilium under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of all metrics provided by this integration.

Events

The Cilium integration does not include any events.

Service Checks

See service_checks.json for a list of service checks provided by this integration.

Troubleshooting

Need help? Contact Datadog support.