Unable to export the metrics to datadog on latest k6 version 0.53.0

I upgraded to the latest k6 versions in my system and installed the Datadog agent.

when I’m executing the below command getting the below errors. can you please help me with what I did wrong

Command:
K6_OTEL_GRPC_EXPORTER_INSECURE=true K6_OTEL_METRIC_PREFIX=k6_ k6 run --tag test-id=Perf123 -o experimental-opentelemetry scripts/k6_loadtest.js

Error:
failed to upload metrics: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:4317: connect: connection refused"

Hi @Naveen !

So the error message stays that k6 wasn’t able to connect to the receiver.

By default, the k6’s experimental opentelemetry output tries to connect to local port 4317 and use gRPC for the metrics export. Could you confirm that your datadog agent is configured to support receiving metrics via gRPC on the 4317 port?

HI @olegbespalov I have installed datadog agent with the below command

DOCKER_CONTENT_TRUST=1 \
docker run --rm -d \
    --name datadog \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -v /proc/:/host/proc/:ro \
    -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
    -e DD_SITE="datadoghq.com" \
    -e DD_API_KEY=API_KEY \
    -e DD_HISTOGRAM_PERCENTILES='0.75 0.90 0.95 0.99' \
    -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=1 \
    -p 8125:8125/udp \
    datadog/agent:latest```

How do I check that Datadog configuration and whether it supports receiving metrics via gRPC on the 4317 port?

Not only the GRPC command when I executed with the below command also I’m getting the same error
Command:

K6_OTEL_HTTP_EXPORTER_INSECURE=true K6_OTEL_METRIC_PREFIX=k6_ k6 run --tag test-id=Perf123 -o experimental-opentelemetry scripts/k6_loadtest.js

Error:

failed to upload metrics: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = “transport: Error while dialing: dial tcp 127.0.0.1:4317: connect: connection refused”

Can you please help me out of this?

Hi @Naveen !

From what I’ve seen, it’s not installation; it’s just running the datadog’s agent container. And as far as I can tell, it only exposes port 8125 (it’s usually StatsD port).

I don’t have experience with the configuration of the Datadog agent, but there is a documentation page that probably should help you OTLP Ingestion by the Datadog Agent

Cheers!