How do I export application span metrics?
Kong Gateway relies on the OpenTelemetry Collector to calculate the metrics based on the traces the OpenTelemetry plugin generates.
To include span metrics for application traces, configure the collector exporters section of the OpenTelemetry Collector configuration file:
connectors:
spanmetrics:
dimensions:
- name: http.method
default: GET
- name: http.status_code
- name: http.route
exclude_dimensions:
- status.code
metrics_flush_interval: 15s
histogram:
disable: false
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [spanmetrics]
metrics:
receivers: [spanmetrics]
processors: []
exporters: [otlphttp]
I want to use the Dynatrace Collector between Kong Gateway and Dynatrace, how do I configure that?
Make an otel-collector-config.yaml
file with the following configuration:
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
exporters:
otlphttp:
endpoint: "https://{yourEnvironmentId}.live.dynatrace.com/api/v2/otlp"
headers:
"Authorization": "Api-Token <your-api-token>"
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [otlphttp]
logs:
receivers: [otlp]
processors: []
exporters: [otlphttp]
I’m getting a 200 OK
when I make requests, but nothing is showing up in Dynatrace, how do I fix this?
Make sure your API token in Dynatrace has the openTelemetryTrace.ingest
and metrics.ingest
scopes. Sometimes it can take a few minutes for the traces to display in Dynatrace.
I’m getting a Missing authorization parameter., context: ngx.timer
in Kong Gateway logs when I send a request after configuring the OpenTelemetry plugin with Dynatrace, how do I fix this?
This error is because you need to add the Dynatrace API token as an Authorization header when you configure the OpenTelemetry plugin.