Cannot send k6 metrics to datadog agent

  Kiến thức lập trình

In my Github Actions workflow I am running a k6 script that’s supposed to write metrics to Datadog. However I am getting the error

level=error msg="Couldn't flush a batch" error="write udp> write: connection refused"

This is the step in my workflow, it first runs the datadog/agent Docker container exposing port 8125/udp to which k6 then tries to send the metrics to:

  - name: Run k6 script
      DD_API_KEY: ${{ secrets.DD_API_KEY }}
    run: |
      docker run -d 
      --name datadog-k6 
      -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="" 
      -e DD_API_KEY=${{ secrets.DD_API_KEY }} 
      -e DD_TAGS="env:development version:foo" 
      -p 8125:8125/udp 
      k6 run ./k6/test.js 
        -e K6_STATSD_ENABLE_TAGS=true 
        -e K6_STATSD_ADDR="" 
        -o statsd 
      docker stop datadog-k6
      docker rm datadog-k6

I am using a self-hosted runner on Github Actions so it might be a docker-inside-docker issue?

I noticed that the statsd output option is deprecated but I am expecting it to still work

Would it work to send the k6 metrics via HTTP to datadog and does someone have an example for that?


Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website