---
title: KrakenD
description: >-
  Monitor KrakenD gateway performance by collecting key metrics and logs for
  full visibility.
breadcrumbs: Docs > Integrations > KrakenD
---

# KrakenD
Supported OS Integration version1.0.0  KrakenD dashboard (light mode)KrakenD dashboard (dark mode)
## Overview{% #overview %}

This check monitors [KrakenD](https://www.krakend.io/) through the Datadog Agent.

KrakenD is a high-performance API gateway that provides a single entry point for microservices. This integration collects metrics using KrakenD's [OpenTelemetry exporter with Prometheus format](https://www.krakend.io/docs/telemetry/prometheus/) and supports [log collection](https://docs.datadoghq.com/logs/log_collection/) for comprehensive monitoring.

### What this integration monitors{% #what-this-integration-monitors %}

The integration collects metrics across multiple [layers](https://www.krakend.io/docs/telemetry/opentelemetry-layers-metrics/) of the KrakenD gateway:

- **HTTP Server Layer**: Request durations, response sizes, and status codes for client-facing traffic
- **Proxy Layer**: Processing times and performance metrics for KrakenD's internal proxy operations
- **Backend Layer**: Connection times, response durations, error rates, DNS resolution, TLS handshakes, timeouts, and connection details for upstream service calls
- **Go Runtime**: Garbage collection, memory usage, goroutines, and Go-specific performance metrics
- **System Process**: CPU usage, memory consumption, file descriptors, and network I/O

### Deployment support{% #deployment-support %}

This integration works with KrakenD in both containerized (Docker, Kubernetes) and traditional deployment environments.

## Setup{% #setup %}

**For Metrics:**

The KrakenD integration uses the OpenTelemetry component in KrakenD with a Prometheus exporter to parse and emit metrics to Datadog. Make sure that your KrakenD installation is configured appropriately following the [instructions provided by KrakenD](https://www.krakend.io/docs/telemetry/opentelemetry/) and use the `prometheus` exporter.

The snippet below configures KrakenD to emit metrics for all [layers](https://www.krakend.io/docs/telemetry/opentelemetry-layers-metrics/) including Go and process metrics, exposing the Prometheus metrics endpoint on port 9090 on all network interfaces (`0.0.0.0`). The specific endpoint URL you configure in the integration as the `openmetrics_endpoint` option depends on your deployment:

- **Same host**: `http://localhost:9090/metrics`
- **Docker containers and Kubernetes**: With Autodiscovery you can use the template variable `%%host%%`: `http://%%host%%:9090/metrics`.

```json
{
   "extra_config": {
      "telemetry/opentelemetry": {
         "service_name": "krakend-gateway",
         "service_version": "1.0.0",
         "exporters": {
               "prometheus": [
                  {
                     "name": "krakend_metrics",
                     "port": 9090,
                     "listen_ip": "0.0.0.0",
                     "process_metrics": true,
                     "go_metrics": true
                  }
               ]
         },
         "layers": {
               "global": {
                  "disable_metrics": false
               },
               "proxy": {
                  "disable_metrics": false
               },
               "backend": {
                  "metrics": {
                     "disable_stage": false,
                     "round_trip": true,
                     "read_payload": true,
                     "detailed_connection": true,
                     "static_attributes": [
                           {
                              "key": "backend_type",
                              "value": "test_api"
                           }
                     ]
                  }
               }
         }
      }
   }
}
```

In KrakenD, emitting Go and process metrics is optional and can be disabled by setting `go_metrics` and `process_metrics` to `false`. For debugging purposes, to emit these metrics but not send them to Datadog, you can set the same options to `false` in the integration configuration. By default, they are enabled to respect the configuration set up in KrakenD.

To configure the integration with KrakenD deployed on a host:

1. Edit the `krakend.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your KrakenD performance data. See the sample [`krakend.d/conf.yaml`](https://github.com/DataDog/integrations-core/blob/master/krakend/datadog_checks/krakend/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).

For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance.

**For Logs:**

Ensure the agent is configured to load logs following the instructions about [Log Collection and Integrations](https://docs.datadoghq.com/logs/log_collection/).

To enable collection of KrakenD access and application logs, uncomment this section in the integration configuration file, replacing `<SERVICE>` with the service to associate the logs with:

```yaml
logs:
  - type: docker
    source: krakend
    service: <SERVICE>
```

Alternatively, in containerized environments, you can use Autodiscovery (for example, see [Docker](https://docs.datadoghq.com/containers/docker/log) or [Kubernetes](https://docs.datadoghq.com/containers/kubernetes/log/)) to add the logs configuration through annotations to the container or node where KrakenD is running.

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

### Metrics{% #metrics %}

|  |
|  |
| **krakend.api.backend\_duration.bucket**(count)                                | The number of backend requests within a duration bucket defined by the `upper_bound` tag. This includes the entire time spent on backend processing and data manipulation. |
| **krakend.api.backend\_duration.count**(count)                                 | The total number of backend requests.                                                                                                                                      |
| **krakend.api.backend\_duration.sum**(count)                                   | The sum of durations for all backend requests.*Shown as second*                                                                                                            |
| **krakend.api.go.gc\_duration\_seconds.count**(count)                          | A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.                                                                                   |
| **krakend.api.go.gc\_duration\_seconds.quantile**(gauge)                       | A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.*Shown as second*                                                                  |
| **krakend.api.go.gc\_duration\_seconds.sum**(count)                            | A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.*Shown as second*                                                                  |
| **krakend.api.go.gc\_gogc\_percent**(gauge)                                    | Heap size target percentage configured by the user, otherwise 100.*Shown as percent*                                                                                       |
| **krakend.api.go.gc\_gomemlimit\_bytes**(gauge)                                | Go runtime memory limit configured by the user, otherwise math.MaxInt64.*Shown as byte*                                                                                    |
| **krakend.api.go.goroutines**(gauge)                                           | Number of goroutines that currently exist.                                                                                                                                 |
| **krakend.api.go.info**(gauge)                                                 | Information about the Go environment.                                                                                                                                      |
| **krakend.api.go.memstats.alloc\_bytes**(gauge)                                | Number of bytes allocated and still in use.*Shown as byte*                                                                                                                 |
| **krakend.api.go.memstats.buck\_hash\_sys\_bytes**(gauge)                      | Number of bytes used by the profiling bucket hash table.*Shown as byte*                                                                                                    |
| **krakend.api.go.memstats.frees.count**(count)                                 | Total number of frees.                                                                                                                                                     |
| **krakend.api.go.memstats.gc\_sys\_bytes**(gauge)                              | Number of bytes used for garbage collection system metadata.*Shown as byte*                                                                                                |
| **krakend.api.go.memstats.heap\_alloc\_bytes**(gauge)                          | Number of heap bytes allocated and still in use.*Shown as byte*                                                                                                            |
| **krakend.api.go.memstats.heap\_idle\_bytes**(gauge)                           | Number of heap bytes waiting to be used.*Shown as byte*                                                                                                                    |
| **krakend.api.go.memstats.heap\_inuse\_bytes**(gauge)                          | Number of heap bytes that are in use.*Shown as byte*                                                                                                                       |
| **krakend.api.go.memstats.heap\_objects**(gauge)                               | Number of allocated objects.                                                                                                                                               |
| **krakend.api.go.memstats.heap\_released\_bytes**(gauge)                       | Number of heap bytes released to OS.*Shown as byte*                                                                                                                        |
| **krakend.api.go.memstats.heap\_sys\_bytes**(gauge)                            | Number of heap bytes obtained from system.*Shown as byte*                                                                                                                  |
| **krakend.api.go.memstats.last\_gc\_time\_seconds**(gauge)                     | Number of seconds since 1970 of last garbage collection.*Shown as second*                                                                                                  |
| **krakend.api.go.memstats.mallocs.count**(count)                               | Total number of mallocs.                                                                                                                                                   |
| **krakend.api.go.memstats.mcache\_inuse\_bytes**(gauge)                        | Number of bytes in use by mcache structures.*Shown as byte*                                                                                                                |
| **krakend.api.go.memstats.mcache\_sys\_bytes**(gauge)                          | Number of bytes used for mcache structures obtained from system.*Shown as byte*                                                                                            |
| **krakend.api.go.memstats.mspan\_inuse\_bytes**(gauge)                         | Number of bytes in use by mspan structures.*Shown as byte*                                                                                                                 |
| **krakend.api.go.memstats.mspan\_sys\_bytes**(gauge)                           | Number of bytes used for mspan structures obtained from system.*Shown as byte*                                                                                             |
| **krakend.api.go.memstats.next\_gc\_bytes**(gauge)                             | Number of heap bytes when next garbage collection will take place.*Shown as byte*                                                                                          |
| **krakend.api.go.memstats.other\_sys\_bytes**(gauge)                           | Number of bytes used for other system allocations.*Shown as byte*                                                                                                          |
| **krakend.api.go.memstats.stack\_inuse\_bytes**(gauge)                         | Number of bytes in use by the stack allocator.*Shown as byte*                                                                                                              |
| **krakend.api.go.memstats.stack\_sys\_bytes**(gauge)                           | Number of bytes obtained from system for stack allocator.*Shown as byte*                                                                                                   |
| **krakend.api.go.memstats.sys\_bytes**(gauge)                                  | Number of bytes obtained from system.*Shown as byte*                                                                                                                       |
| **krakend.api.go.sched\_gomaxprocs\_threads**(gauge)                           | The current runtime.GOMAXPROCS setting.                                                                                                                                    |
| **krakend.api.go.threads**(gauge)                                              | Number of OS threads created.                                                                                                                                              |
| **krakend.api.http\_client.duration.bucket**(count)                            | The number of requests to the backend within a duration bucket defined by the `upper_bound` tag. This measures the time until the first byte of the response is received.  |
| **krakend.api.http\_client.duration.count**(count)                             | The total number of HTTP client requests.                                                                                                                                  |
| **krakend.api.http\_client.duration.sum**(count)                               | The sum of durations for all HTTP client requests.*Shown as second*                                                                                                        |
| **krakend.api.http\_client.request\_canceled.count**(count)                    | Total number of canceled HTTP client requests.                                                                                                                             |
| **krakend.api.http\_client.request\_dns\_duration.bucket**(count)              | The number of DNS lookups within a duration bucket defined by the `upper_bound` tag.                                                                                       |
| **krakend.api.http\_client.request\_dns\_duration.count**(count)               | The total number of DNS lookups.                                                                                                                                           |
| **krakend.api.http\_client.request\_dns\_duration.sum**(count)                 | The sum of durations for all DNS lookups.*Shown as second*                                                                                                                 |
| **krakend.api.http\_client.request\_failed.count**(count)                      | Total number of failed HTTP client requests.                                                                                                                               |
| **krakend.api.http\_client.request\_get\_conn\_duration.bucket**(count)        | The number of backend connections within a duration bucket defined by the `upper_bound` tag. This excludes data processing time.                                           |
| **krakend.api.http\_client.request\_get\_conn\_duration.count**(count)         | The total number of successful backend connections.                                                                                                                        |
| **krakend.api.http\_client.request\_get\_conn\_duration.sum**(count)           | The sum of durations for all backend connections.*Shown as second*                                                                                                         |
| **krakend.api.http\_client.request\_read\_errors.count**(count)                | Total number of errors reading the response body.                                                                                                                          |
| **krakend.api.http\_client.request\_size.count**(count)                        | Total size of HTTP client requests.*Shown as byte*                                                                                                                         |
| **krakend.api.http\_client.request\_started.count**(count)                     | Total number of started HTTP client requests.                                                                                                                              |
| **krakend.api.http\_client.request\_timedout.count**(count)                    | Total number of timed out HTTP client requests.                                                                                                                            |
| **krakend.api.http\_client.request\_tls\_duration.bucket**(count)              | The number of TLS handshakes within a negotiation duration bucket defined by the `upper_bound` tag.                                                                        |
| **krakend.api.http\_client.request\_tls\_duration.count**(count)               | The total number of TLS handshakes for HTTP client requests.                                                                                                               |
| **krakend.api.http\_client.request\_tls\_duration.sum**(count)                 | The sum of durations for all TLS handshakes for HTTP client requests.*Shown as second*                                                                                     |
| **krakend.api.http\_client.response\_no\_content\_length.count**(count)        | Total number of HTTP client responses with no content length.                                                                                                              |
| **krakend.api.http\_client.response\_read\_size.count**(count)                 | Total size of HTTP client responses read.*Shown as byte*                                                                                                                   |
| **krakend.api.http\_client.response\_read\_size\_hist.bucket**(count)          | The number of backend responses within a size bucket defined by the `upper_bound` tag.                                                                                     |
| **krakend.api.http\_client.response\_read\_size\_hist.count**(count)           | The total number of backend response reads.                                                                                                                                |
| **krakend.api.http\_client.response\_read\_size\_hist.sum**(count)             | The total read size of all backend responses.*Shown as byte*                                                                                                               |
| **krakend.api.http\_client.response\_read\_time\_hist\_seconds.bucket**(count) | The number of backend response reads within a time bucket defined by the `upper_bound` tag.                                                                                |
| **krakend.api.http\_client.response\_read\_time\_hist\_seconds.count**(count)  | The total number of backend response reads.                                                                                                                                |
| **krakend.api.http\_client.response\_read\_time\_hist\_seconds.sum**(count)    | The total time spent reading all backend responses.*Shown as second*                                                                                                       |
| **krakend.api.http\_client.response\_read\_time\_seconds.count**(count)        | Total time spent reading HTTP client responses.*Shown as second*                                                                                                           |
| **krakend.api.http\_server.duration.bucket**(count)                            | The number of requests served by KrakenDwithin a duration bucket defined by the `upper_bound` tag. This includes the total request processing time.                        |
| **krakend.api.http\_server.duration.count**(count)                             | The total number of requests received by the KrakenD endpoint.                                                                                                             |
| **krakend.api.http\_server.duration.sum**(count)                               | The sum of durations for all requests received by the KrakenD endpoint.*Shown as second*                                                                                   |
| **krakend.api.http\_server.response\_size.bucket**(count)                      | The number of requests within a response size bucket defined by the `upper_bound` tag.*Shown as byte*                                                                      |
| **krakend.api.http\_server.response\_size.count**(count)                       | The total number of requests received by the KrakenD endpoint.                                                                                                             |
| **krakend.api.http\_server.response\_size.sum**(count)                         | The sum of sizes for all responses.*Shown as byte*                                                                                                                         |
| **krakend.api.otel\_scope\_info**(gauge)                                       | Instrumentation Scope metadata.                                                                                                                                            |
| **krakend.api.process.cpu\_seconds.count**(count)                              | Total user and system CPU time spent in seconds.*Shown as second*                                                                                                          |
| **krakend.api.process.max\_fds**(gauge)                                        | Maximum number of open file descriptors.                                                                                                                                   |
| **krakend.api.process.network\_receive\_bytes.count**(count)                   | Number of bytes received by the process over the network.*Shown as byte*                                                                                                   |
| **krakend.api.process.network\_transmit\_bytes.count**(count)                  | Number of bytes sent by the process over the network.*Shown as byte*                                                                                                       |
| **krakend.api.process.open\_fds**(gauge)                                       | Number of open file descriptors.                                                                                                                                           |
| **krakend.api.process.resident\_memory\_bytes**(gauge)                         | Resident memory size in bytes.*Shown as byte*                                                                                                                              |
| **krakend.api.process.start\_time\_seconds**(gauge)                            | Start time of the process since unix epoch in seconds.*Shown as second*                                                                                                    |
| **krakend.api.process.virtual\_memory\_bytes**(gauge)                          | Virtual memory size in bytes.*Shown as byte*                                                                                                                               |
| **krakend.api.process.virtual\_memory\_max\_bytes**(gauge)                     | Maximum amount of virtual memory available in bytes.*Shown as byte*                                                                                                        |
| **krakend.api.proxy\_duration.bucket**(count)                                  | The number of proxy requests within a duration bucket defined by the `upper_bound` tag.                                                                                    |
| **krakend.api.proxy\_duration.count**(count)                                   | The total number of proxy requests.                                                                                                                                        |
| **krakend.api.proxy\_duration.sum**(count)                                     | The sum of durations for all proxy requests.*Shown as second*                                                                                                              |

## Uninstallation{% #uninstallation %}

To disable the integration, rename the configuration file from `krakend.yaml` to `krakend.yaml.example`. Alternatively, if you are running a containerized environment, you can remove the annotation used to enable the integration.

## Support{% #support %}

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