Set up Jaeger with OpenTelemetry
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
Tracing environment variables
Set the following Jaeger tracing variables before you configure the Data Plane:
export KONG_TRACING_INSTRUMENTATIONS=all
export KONG_TRACING_SAMPLING_RATE=1.0
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 -
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"
curl -X POST "http://localhost:8000/anything" \
-H "Accept: application/json"\
-H "Content-Type: application/json"
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
Clean up Konnect environment
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.