News New Look, Same Vision: KrakenD’s Website Redesign

You are viewing a previous version of KrakenD Enterprise Edition (v2.6), go to the latest version

Document updated on Feb 3, 2023

Jaeger Telemetry Integration - KrakenD API Gateway

The KrakenD exporter to Jaeger allows you to submit spans to an OpenTelemtry Collector (HTTP or gRPC) automatically.

Jaeger is an open-source, end-to-end distributed tracing system that allows you to monitor and troubleshoot transactions in complex distributed systems. Use Jaeger when you want to see the complete flow of a user request through KrakenD and its connected services.

Jaeger configuration

To add Jaeger, configure a new exporter to the OpenTelemetry settings. For instance:

{
    "version": 3,
    "extra_config": {
        "telemetry/opentelemetry": {
            "service_name": "my_krakend_service",
            "metric_reporting_period": 1,
            "trace_sample_rate": 0.15,
            "layers": {
                "global": {
                    "report_headers": true
                },
                "proxy": {
                    "report_headers": true
                },
                "backend": {
                    "metrics": {
                        "disable_stage": true
                    },
                    "traces": {
                        "disable_stage": false,
                        "round_trip": true,
                        "read_payload": true,
                        "detailed_connection": true,
                        "report_headers": true
                    }
                }
            },
            "exporters": {
                "otlp": [
                    {
                        "name": "local_jaeger",
                        "host": "jaeger",
                        "port": 4317,
                        "use_http": false,
                        "disable_metrics": true
                    }
                ]
            }
        }
    }
}

The fields relative to the exporter are:

Fields of "telemetry/opentelemetry": { "exporters":{} }
* required fields

otlp array
The list of OTLP exporters you want to use. Set at least one object to push metrics and traces to an external collector using OTLP.
Each item is an object with the following properties:
disable_metrics boolean
Disable metrics in this exporter (leaving only traces if any). It won’t report any metrics when the flag is true.
Defaults to false
disable_traces boolean
Disable traces in this exporter (leaving only metrics if any). It won’t report any metrics when the flag is true.
Defaults to false
host string
The host where you want to push the data. It can be a sidecar or a remote collector.
name string
A unique name to identify this exporter.
Examples: "local_prometheus" , "remote_grafana"
port integer
A custom port to send the data. The port defaults to 4317 for gRPC unless you enable use_http, which defaults to 4318.
Defaults to 4317
use_http boolean
Whether this exporter uses HTTP instead of gRPC.

But as you can see there is a layers attribute in the example configuration that defines settings for all exporters (not only Jaeger). See the layers options.

Also notice that port 4317 and "use_http": false are set, meaning that gRPC communication is used. Change to 4318 and the flag to true for HTTP communication.

Jaeger demo environment

You can test this setup by running the All in One official Jaeger image and opening the necessary ports. For instance:

version: "3"
services:
  krakend:
    image: krakend/krakend-ee:2.6
    volumes:
      - "./:/etc/krakend"
    ports:
      - "8080:8080"
  jaeger:
    image: jaegertracing/all-in-one:1.54
    environment:
      COLLECTOR_ZIPKIN_HOST_PORT: ":9411"
    ports:
      - "5778:5778" # serve configs
      - "16686:16686" # serve frontend UI
      - "4317:4317"   # otlp grpc: we remap this to be able to run other envs
      - "4318:4318"   # otlp http: we reamp this to be able to run other envs
    deploy:
      resources:
        limits:
          memory: 4096M # Adjust according to your setup
Scarf

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.

See all support channels