---
title: Traefik Mesh
description: Tracks metrics related to Traefik Mesh
breadcrumbs: Docs > Integrations > Traefik Mesh
---

# Traefik Mesh
Supported OS Integration version3.3.0
## Overview{% #overview %}

Traefik Mesh is a lightweight and easy-to-deploy service mesh that offers advanced traffic management, security, and observability features for microservices applications, leveraging the capabilities of Traefik Proxy. With Datadog's Traefik integration, you can:

- Obtain insights into the traffic entering your service mesh.
- Gain critical insights into the performance, reliability, and security of individual services within your mesh which ensures your services are operating efficiently while also helping to identify and resolve issues quickly.
- Gain detailed insights into the internal traffic flows within your service mesh which helps monitor performance and ensure reliability.

This check monitors [Traefik Mesh](https://traefik.io/) through the Datadog Agent.

**Minimum Agent version:** 7.54.1

## Setup{% #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](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance on applying these instructions.

### Installation{% #installation %}

Starting from Agent release v7.55.0, the Traefik Mesh check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package. No additional installation is needed on your server.

**Note**: This check requires Agent v7.55.0 or later.

### Configuration{% #configuration %}

Traefik Mesh can be configured to expose Prometheus-formatted metrics. The Datadog Agent can collect these metrics using the integration described below. Follow the instructions to configure data collection for your Traefik Mesh instances. For the required configurations to expose the Prometheus metrics, see the [Observability page in the official Traefik Mesh documentation](https://doc.traefik.io/traefik/observability/metrics/overview/).

In addition, a small subset of metrics can be collected by communicating with different API endpoints. Specifically:

- `/api/version`: Version information on the Traefik proxy.
- `/api/status/nodes`: Ready status of nodes visible by the Traefik [controller](https://doc.traefik.io/traefik-mesh/api/).
- `/api/status/readiness`: Ready status of the Traefik controller.

**Note**: This check uses [OpenMetrics](https://docs.datadoghq.com/integrations/openmetrics/) for metric collection, which requires Python 3.

#### Containerized{% #containerized %}

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

Make sure that the Prometheus-formatted metrics are exposed in your Traefik Mesh cluster. You can configure and customize this by following the instructions on the [Observability page in the official Traefik Mesh documentation](https://doc.traefik.io/traefik/observability/metrics/overview/). In order for the Agent to start collecting metrics, the Traefik Mesh pods need to be annotated. For more information about annotations, refer to the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance. You can find additional configuration options by reviewing the [`traefik_mesh.d/conf.yaml` sample](https://github.com/DataDog/integrations-core/blob/master/traefik_mesh/datadog_checks/traefik_mesh/data/conf.yaml.example).

**Note**: The following metrics can only be collected if they are available. Some metrics are generated only when certain actions are performed.

When configuring the Traefik Mesh check, you can use the following parameters:

- `openmetrics_endpoint`: This parameter should be set to the location where the Prometheus-formatted metrics are exposed. The default port is `8082`, but it can be configured using the `--entryPoints.metrics.address`. In containerized environments, `%%host%%` can be used for [host autodetection](https://docs.datadoghq.com/agent/kubernetes/integrations/).
- `traefik_proxy_api_endpooint:` This parameter is optional. The default port is `8080` and can be configured using `--entryPoints.traefik.address`. In containerized environments, `%%host%%` can be used for [host autodetection](https://docs.datadoghq.com/agent/kubernetes/integrations/).
- `traefik_controller_api_endpoint`: This parameter is optional. The default port is set to `9000`.

#### Traefik Proxy{% #traefik-proxy %}

```yaml
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/<CONTAINER_NAME>.checks: |
      {
        "traefik_mesh": {
          "init_config": {},
          "instances": [
            {
              "openmetrics_endpoint": "http://%%host%%:8082/metrics",
              "traefik_proxy_api_endpoint": "http://%%host%%:8080"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: <CONTAINER_NAME>
# (...)
```

#### Traefik Controller{% #traefik-controller %}

```yaml
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/<CONTAINER_NAME>.checks: |
      {
        "traefik_mesh": {
          "init_config": {},
          "instances": [
            {
              "traefik_controller_api_endpoint": "http://%%host%%:9000"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: <CONTAINER_NAME>
# (...)
```

See the [sample traefik_mesh.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/traefik_mesh/datadog_checks/traefik_mesh/data/conf.yaml.example) for all available configuration options.

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

*Available for Agent versions >6.0*

Traefik Mesh logs can be collected from the different Traefik Mesh pods through Kubernetes. Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection](https://docs.datadoghq.com/containers/kubernetes/log/).

See the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance on applying the parameters below.

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

### Validation{% #validation %}

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

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **traefik\_mesh.config.last\_reload.failure**(gauge)                | The last config reload failure                                                                                                             |
| **traefik\_mesh.config.last\_reload.success**(gauge)                | The last config reload success                                                                                                             |
| **traefik\_mesh.config.reloads.count**(count)                       | The total count of configuration reloads                                                                                                   |
| **traefik\_mesh.config.reloads.failure.count**(count)               | The total count of configuration reload failures                                                                                           |
| **traefik\_mesh.entrypoint.open\_connections**(gauge)               | Deprecated in Traefik v3. Use traefik_mesh.open_connections instead. The current count of open connections on an entrypoint                |
| **traefik\_mesh.entrypoint.request.duration.seconds.bucket**(count) | Request processing duration histogram on an entrypoint*Shown as second*                                                                    |
| **traefik\_mesh.entrypoint.request.duration.seconds.count**(count)  | Request processing duration histogram on an entrypoint*Shown as second*                                                                    |
| **traefik\_mesh.entrypoint.request.duration.seconds.sum**(count)    | Request processing duration histogram on an entrypoint*Shown as second*                                                                    |
| **traefik\_mesh.entrypoint.requests.bytes.count**(count)            | The total size of HTTP requests in bytes handled by an entrypoint                                                                          |
| **traefik\_mesh.entrypoint.requests.count**(count)                  | The total count of HTTP requests received by an entrypoint                                                                                 |
| **traefik\_mesh.entrypoint.requests.tls.count**(count)              | The total count of HTTPS requests received by an entrypoint                                                                                |
| **traefik\_mesh.entrypoint.responses.bytes.count**(count)           | The total size of HTTP responses in bytes handled by an entrypoint                                                                         |
| **traefik\_mesh.go.gc.duration.seconds.count**(count)               | The summary count of garbage collection cycles in the Traefik Mesh instance*Shown as second*                                               |
| **traefik\_mesh.go.gc.duration.seconds.quantile**(gauge)            | The summary of the pause duration of garbage collection cycles in the Traefik Mesh instance*Shown as second*                               |
| **traefik\_mesh.go.gc.duration.seconds.sum**(count)                 | The sum of the pause duration of garbage collection cycles in the Traefik Mesh instance*Shown as second*                                   |
| **traefik\_mesh.go.goroutines**(gauge)                              | The number of goroutines that currently exist in the Traefik Mesh instance                                                                 |
| **traefik\_mesh.go.info**(gauge)                                    | A metric containing the Go version as a tag                                                                                                |
| **traefik\_mesh.go.memstats.alloc\_bytes**(gauge)                   | The number of bytes allocated and still in use by the Traefik Mesh instance*Shown as byte*                                                 |
| **traefik\_mesh.go.memstats.alloc\_bytes.count**(count)             | The total number of bytes allocated - even if freed - for the Traefik Mesh instance*Shown as byte*                                         |
| **traefik\_mesh.go.memstats.buck\_hash.sys\_bytes**(gauge)          | The number of bytes used by the profiling bucket hash table in the Traefik Mesh instance*Shown as byte*                                    |
| **traefik\_mesh.go.memstats.frees.count**(count)                    | The total number of frees in the Traefik Mesh instance                                                                                     |
| **traefik\_mesh.go.memstats.gc.cpu\_fraction**(gauge)               | The fraction of this program's available CPU time used by the GC since the program started in the Traefik Mesh instance*Shown as fraction* |
| **traefik\_mesh.go.memstats.gc.sys\_bytes**(gauge)                  | The number of bytes used for garbage collection system metadata in the Traefik Mesh instance*Shown as byte*                                |
| **traefik\_mesh.go.memstats.heap.alloc\_bytes**(gauge)              | The number of heap bytes allocated and still in use in the Traefik Mesh instance*Shown as byte*                                            |
| **traefik\_mesh.go.memstats.heap.idle\_bytes**(gauge)               | The number of heap bytes waiting to be used in the Traefik Mesh instance*Shown as byte*                                                    |
| **traefik\_mesh.go.memstats.heap.inuse\_bytes**(gauge)              | The number of heap bytes that are in use in the Traefik Mesh instance*Shown as byte*                                                       |
| **traefik\_mesh.go.memstats.heap.objects**(gauge)                   | The number of allocated objects in the Traefik Mesh instance*Shown as object*                                                              |
| **traefik\_mesh.go.memstats.heap.released\_bytes**(gauge)           | The number of heap bytes released to the OS in the Traefik Mesh instance*Shown as byte*                                                    |
| **traefik\_mesh.go.memstats.heap.sys\_bytes**(gauge)                | The number of heap bytes obtained from system in the Traefik Mesh instance*Shown as byte*                                                  |
| **traefik\_mesh.go.memstats.last\_gc\_time.seconds**(gauge)         | The number of seconds since 1970 of last garbage collection in the Traefik Mesh instance                                                   |
| **traefik\_mesh.go.memstats.lookups.count**(count)                  | The number of pointer lookups                                                                                                              |
| **traefik\_mesh.go.memstats.mallocs.count**(count)                  | The number of mallocs                                                                                                                      |
| **traefik\_mesh.go.memstats.mcache.inuse\_bytes**(gauge)            | The number of bytes in use by mcache structures in the Traefik Mesh instance*Shown as byte*                                                |
| **traefik\_mesh.go.memstats.mcache.sys\_bytes**(gauge)              | The number of bytes used for mcache structures obtained from system in the Traefik Mesh instance*Shown as byte*                            |
| **traefik\_mesh.go.memstats.mspan.inuse\_bytes**(gauge)             | The number of bytes in use by mspan structures in the Traefik Mesh instance*Shown as byte*                                                 |
| **traefik\_mesh.go.memstats.mspan.sys\_bytes**(gauge)               | The number of bytes used for mspan structures obtained from system in the Traefik Mesh instance*Shown as byte*                             |
| **traefik\_mesh.go.memstats.next.gc\_bytes**(gauge)                 | The number of heap bytes when next garbage collection takes place in the Traefik Mesh instance*Shown as byte*                              |
| **traefik\_mesh.go.memstats.other.sys\_bytes**(gauge)               | The number of bytes used for other system allocations in the Traefik Mesh instance*Shown as byte*                                          |
| **traefik\_mesh.go.memstats.stack.inuse\_bytes**(gauge)             | The number of bytes in use by the stack allocator in the Traefik Mesh instance*Shown as byte*                                              |
| **traefik\_mesh.go.memstats.stack.sys\_bytes**(gauge)               | The number of bytes obtained from system for stack allocator in the Traefik Mesh instance*Shown as byte*                                   |
| **traefik\_mesh.go.memstats.sys\_bytes**(gauge)                     | The number of bytes obtained from system in the Traefik Mesh instance*Shown as byte*                                                       |
| **traefik\_mesh.go.threads**(gauge)                                 | The number of OS threads created in the Traefik Mesh instance*Shown as thread*                                                             |
| **traefik\_mesh.node.ready**(gauge)                                 | The current count of ready nodes in the Traefik Mesh instance                                                                              |
| **traefik\_mesh.open\_connections**(gauge)                          | Traefik v3 only. The current count of open connections partitioned by entrypoint router and service                                        |
| **traefik\_mesh.process.cpu.seconds.count**(count)                  | The total user and system CPU time spent in seconds in the Traefik Mesh instance*Shown as second*                                          |
| **traefik\_mesh.process.max\_fds**(gauge)                           | The maximum number of open file descriptors in the Traefik Mesh instance*Shown as file*                                                    |
| **traefik\_mesh.process.open\_fds**(gauge)                          | The number of open file descriptors in the Traefik Mesh instance*Shown as file*                                                            |
| **traefik\_mesh.process.resident\_memory.bytes**(gauge)             | The resident memory size in bytes in the Traefik Mesh instance*Shown as byte*                                                              |
| **traefik\_mesh.process.start\_time.seconds**(gauge)                | The start time of the process since unix epoch in seconds in the Traefik Mesh instance*Shown as second*                                    |
| **traefik\_mesh.process.virtual\_memory.bytes**(gauge)              | The virtual memory size in bytes in the Traefik Mesh instance*Shown as byte*                                                               |
| **traefik\_mesh.process.virtual\_memory.max\_bytes**(gauge)         | The maximum amount of virtual memory available in bytes in the Traefik Mesh instance*Shown as byte*                                        |
| **traefik\_mesh.router.open\_connections**(gauge)                   | Deprecated in Traefik v3. Use traefik_mesh.open_connections instead. The current count of open connections for a router                    |
| **traefik\_mesh.router.request.duration.seconds.bucket**(count)     | Request processing duration histogram for a router*Shown as second*                                                                        |
| **traefik\_mesh.router.request.duration.seconds.count**(count)      | Request processing duration histogram for a router*Shown as second*                                                                        |
| **traefik\_mesh.router.request.duration.seconds.sum**(count)        | Request processing duration histogram for a router*Shown as second*                                                                        |
| **traefik\_mesh.router.requests.bytes.count**(count)                | The total size of HTTP requests in bytes handled by a router*Shown as byte*                                                                |
| **traefik\_mesh.router.requests.count**(count)                      | The total count of HTTP requests handled by a router                                                                                       |
| **traefik\_mesh.router.requests.tls.count**(count)                  | The total count of HTTPS requests handled by a router                                                                                      |
| **traefik\_mesh.router.responses.bytes.count**(count)               | The total size of HTTP responses in bytes handled by a router*Shown as byte*                                                               |
| **traefik\_mesh.service.open\_connections**(gauge)                  | Deprecated in Traefik v3. Use traefik_mesh.open_connections instead. The current count of open connections for a service                   |
| **traefik\_mesh.service.request.duration.seconds.bucket**(count)    | Request processing duration histogram for a service*Shown as second*                                                                       |
| **traefik\_mesh.service.request.duration.seconds.count**(count)     | Request processing duration histogram for a service*Shown as second*                                                                       |
| **traefik\_mesh.service.request.duration.seconds.sum**(count)       | Request processing duration histogram for a service*Shown as second*                                                                       |
| **traefik\_mesh.service.requests.bytes.count**(count)               | The total size of HTTP requests in bytes handled by a service*Shown as byte*                                                               |
| **traefik\_mesh.service.requests.count**(count)                     | The total count of HTTP requests received by a service                                                                                     |

### Events{% #events %}

The Traefik Mesh integration does not include any events.

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

**traefik\_mesh.openmetrics.health**

Returns `CRITICAL` if the Agent is unable to connect to the Traefik Mesh OpenMetrics endpoint, otherwise returns `OK`.

*Statuses: ok, critical*

**traefik\_mesh.controller.ready**

Returns `OK` if the `/api/status/readiness` for the Mesh Controller returns 200, otherwise returns `CRITICAL`.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

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