Set up Jaeger with OpenTelemetry

Uses: Kong Gateway decK
Minimum Version
Kong Gateway - 3.4
TL;DR

You can use the OpenTelemetry plugin with Jaeger to send analytics and monitoring data to Jaeger dashboards. Set KONG_TRACING_INSTRUMENTATIONS=all and KONG_TRACING_SAMPLING_RATE=1.0. Enable the OTEL plugin with your Jaeger tracing endpoint, and specify the name you want to track the traces by in resource_attributes.service.name.

Prerequisites

Set the following Jaeger tracing variables before you configure the Data Plane:

export KONG_TRACING_INSTRUMENTATIONS=all
export KONG_TRACING_SAMPLING_RATE=1.0
Copied to clipboard!

Enable the OTEL plugin

In this tutorial, we’ll be configuring the OpenTelemetry plugin to send Kong Gateway traces to Jaeger.

Enable the OTEL plugin with Jaeger settings configured:

echo '
_format_version: "3.0"
plugins:
  - name: opentelemetry
    config:
      traces_endpoint: http://${{ env "DECK_JAEGER_HOST" }}:4318/v1/traces
      resource_attributes:
        service.name: kong-dev
' | deck gateway apply -
Copied to clipboard!

For more information about the ports Jaeger uses, see API Ports in the Jaeger documentation.

Validate

Send a POST request to generate traffic that we can use to validate that Jaeger is receiving the traces:

 curl -X POST "$KONNECT_PROXY_URL/anything" \
     -H "Accept: application/json"\
     -H "Content-Type: application/json"
Copied to clipboard!

In the Jaeger UI, search for kong-dev in Service and click Find Traces. You should see a trace for the request you just sent. Sometimes it can take a few seconds to display.

Cleanup

If you created a new control plane and want to conserve your free trial credits or avoid unnecessary charges, delete the new control plane used in this tutorial.

FAQs

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!