Hi Team,
As per the latest version of k6, i updated the version and trying to send a k6 metrics to datadog by using the following command and document. As per this document i didn’t see any data send to datadog
$ K6_OTEL_GRPC_EXPORTER_INSECURE=true K6_OTEL_METRIC_PREFIX=k6_ k6 run --tag test-id=123 -o experimental-opentelemetry examples/script.js```
https://grafana.com/docs/k6/latest/results-output/real-time/opentelemetry/
I saw this documentaion help to resolve that wrong percentiles values issues
https://github.com/grafana/k6/issues/2044#issuecomment-2194455469
how do i connect to otlp and send k6 metrics to datadog
Can any one help here?
Hey @Naveen,
You are not providing the DataDog Agent’s endpoint where you want to send the metrics.
You have to set the K6_OTEL_GRPC_EXPORTER_ENDPOINT or K6_OTEL_HTTP_EXPORTER_ENDPOINT option for it. If you don’t do that then the default value is used as documented on the OpenTelemetry | Grafana k6 documentation page.
Getting the following error while executing this command
K6_OTEL_HTTP_EXPORTER_ENDPOINT=http://xxx.xx.x.x:4318 K6_OTEL_METRIC_PREFIX=k6_ k6 run --tag test-id=Perf123 -o experimental-opentelemetry scripts/test.js
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ / \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| _\ ____/ .io
execution: local
script: scripts/test.js
output: opentelemetry (grpc, localhost:4317)
scenarios: (100.00%) 1 scenario, 5 max VUs, 4m30s max duration (incl. graceful stop):
default: Up to 5 looping VUs for 4m0s over 3 stages (gracefulRampDown: 30s, gracefulStop: 30s)
2024/08/26 17:06:23 failed to upload metrics: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = “transport: authentication handshake failed: tls: first record does not look like a TLS handshake”
2024/08/26 17:06:33 failed to upload metrics: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = “transport: authentication handshake failed: tls: first record does not look like a TLS handshake”
If you are using HTTP then you have to use the K6_OTEL_HTTP_EXPORTER_ENDPOINT and not the gRPC. Furthermore, you’re adding the not required http:// scheme of the protocol.
The correct format should be: