---
title: calico
description: Calico is a networking and network security solution for containers.
breadcrumbs: Docs > Integrations > calico
---

# calico
Supported OS Integration version5.3.0
## Overview{% #overview %}

This check monitors [Calico](https://www.tigera.io/project-calico/) through the Datadog Agent.

The Calico check sends metrics concerning network and security in a Kubernetes cluster set up with Calico.

**Minimum Agent version:** 7.36.0

## Setup{% #setup %}

### Installation{% #installation %}

The Calico check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package.

#### Installation with a Kubernetes cluster-based Agent{% #installation-with-a-kubernetes-cluster-based-agent %}

Using annotations:

1. Set up Calico on your cluster.

1. Enable Prometheus metrics using the instructions in [Monitor Calico component metrics](https://docs.tigera.io/calico/3.25/operations/monitor/monitor-component-metrics). Once enabled, you should have a `felix-metrics-svc` service running in your cluster, as well as a `prometheus-pod`.

1. To use Autodiscovery, modify `prometheus-pod`. Add the following snippet to your Prometheus YAML configuration file:

   ```
   metadata:
     [...]
     annotations:
      ad.datadoghq.com/prometheus-pod.check_names: |
      ["openmetrics"]
      ad.datadoghq.com/prometheus-pod.init_configs: |
      [{}]
      ad.datadoghq.com/prometheus-pod.instances: |
        [
           {
              "prometheus_url": "http://<FELIX-SERVICE-IP>:<FELIX-SERVICE-PORT>/metrics",
              "namespace": "calico",
              "metrics": ["*"]
           }
        ]
     spec:
       [....]
   ```

You can find values for `<FELIX-SERVICE-IP>` and `<FELIX-SERVICE-PORT>` by running `kubectl get all -all-namespaces`.

#### Installation with an OS-based Agent{% #installation-with-an-os-based-agent %}

1. Follow [Monitor Calico component metrics](https://docs.tigera.io/calico/3.25/operations/monitor/monitor-component-metrics) until you have a `felix-metrics-svc` service running by using `kubectl get all --all-namespaces`.

1. If you are using minikube, you must forward port 9091 to `felix-metrics-svc`. Run `kubectl port-forward service/felix-metrics-svc 9091:9091 -n kube-system`.

If you are not using minikube, check that `felix-metrics-svc` has an external IP. If the service does not have an external IP, use `kubectl edit svc` to change its type from `ClusterIP` to `LoadBalancer`.

### Configuration{% #configuration %}

Follow the instructions to configure this check for an Agent running on a host. For containerized environments, see the Containerized section.

{% tab title="Host" %}
#### Host{% #host %}

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

1. Edit the `calico.d/conf.yaml` file in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your Calico performance data. The only required parameter is the `openmetrics_endpoint` URL. See the [sample calico.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/calico/datadog_checks/calico/data/conf.yaml.example) for all available configuration options.

1. If you are using minikube, use 'http://localhost:9091/metrics' as your `openmetrics_endpoint` URL. If you are not using minikube, use `http://<FELIX-METRICS-SVC-EXTERNAL-IP>:<PORT>/metrics` as your `openmetrics_endpoint` URL.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

##### Metric collection{% #metric-collection %}

1. The default configuration of your `calico.d/conf.yaml` file activate the collection of your Calico metrics. See the [sample calico.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/calico/datadog_checks/calico/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

##### Log collection{% #log-collection %}

Since Calico structure is set up in a Kubernetes cluster, it is built with deployments, pods, and services. The Kubernetes integration fetches logs from containers.

After setting up the [Kubernetes](https://docs.datadoghq.com/agent/kubernetes) integration, Calico logs become available in the Datadog Log Explorer.

Collecting logs is disabled by default in the Datadog Agent. Enable it in your `datadog.yaml` file:

```yaml
logs_enabled: true
```

{% /tab %}

{% tab title="Containerized" %}
#### Containerized{% #containerized %}

For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/docker/integrations/?tab=docker) for guidance on applying the parameters below.

##### Metric collection{% #metric-collection %}

| Parameter            | Value                                            |
| -------------------- | ------------------------------------------------ |
| `<INTEGRATION_NAME>` | `calico`                                         |
| `<INIT_CONFIG>`      | blank or `{}`                                    |
| `<INSTANCE_CONFIG>`  | `{openmetrics_endpoint: <OPENMETRICS_ENDPOINT>}` |

##### Log collection{% #log-collection %}

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection](https://docs.datadoghq.com/agent/kubernetes/log/?tab=containerinstallation#setup).

| Parameter      | Value                                               |
| -------------- | --------------------------------------------------- |
| `<LOG_CONFIG>` | `{"source": "calico", "service": "<SERVICE_NAME>"}` |

{% /tab %}

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `calico` under the Checks section.

### Metrics{% #metrics %}

|  |
|  |
| **calico.felix.active.local\_endpoints**(gauge)          | Number of active endpoints on this host                      |
| **calico.felix.active.local\_policies**(gauge)           | Number of policies on this host                              |
| **calico.felix.active.local\_selectors**(gauge)          | Number of active selectors on this host                      |
| **calico.felix.active.local\_tags**(gauge)               | Number of active tags on this host [versions < Calico v3.23] |
| **calico.felix.cluster.num\_host\_endpoints**(gauge)     | Total number of host endpoints cluster-wide                  |
| **calico.felix.cluster.num\_hosts**(gauge)               | Total number of Calico hosts in the cluster                  |
| **calico.felix.cluster.num\_workload\_endpoints**(gauge) | Total number of workload endpoints cluster-wide              |
| **calico.felix.int\_dataplane\_failures.count**(count)   | Number of dataplane failures.                                |
| **calico.felix.ipset.calls.count**(count)                | Number of ipset commands executed                            |
| **calico.felix.ipset.errors.count**(count)               | Number of ipset command failures                             |
| **calico.felix.ipsets.calico**(gauge)                    | Number of active Calico IP sets.                             |
| **calico.felix.ipsets.total**(gauge)                     | Total number of active IP sets.                              |
| **calico.felix.iptables.chains**(gauge)                  | Number of active iptables chains.                            |
| **calico.felix.iptables.restore\_calls.count**(count)    | Number of iptables-restore calls.                            |
| **calico.felix.iptables.restore\_errors.count**(count)   | Number of iptables-restore errors.                           |
| **calico.felix.iptables.rules**(gauge)                   | Number of active iptables rules.                             |
| **calico.felix.iptables.save\_calls.count**(count)       | Number of iptables-save calls.                               |
| **calico.felix.iptables.save\_errors.count**(count)      | Number of iptables-save errors.                              |

### Events{% #events %}

The Calico integration does not include any events.

### Service Checks{% #service-checks %}

See [service_checks.json](https://github.com/DataDog/integrations-core/blob/master/calico/assets/service_checks.json) for a list of service checks provided by this integration.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).

## Further Reading{% #further-reading %}

- [Monitor Calico with Datadog](https://www.datadoghq.com/blog/monitor-calico-with-datadog/)
