K6 custom metric not shown in DataDog

My k6 report shows " pipeline_job_runtime…: avg=64.413 min=64.413 med=64.413 max=64.413 p(90)=64.413 p(99.9)=64.413 p(99.99)=64.413 count=1 "

When I go in DataDog I do not see my k6.exchange.pipeline_job_runtime metric to report against, why?

Hi @eric , welcome to the forum :tada: !

Can you please add more details like what versions you have and how you run it? Also please refresh your datadog window as it sometimes caches metrics for me and won’t show new ones.

The problem is with docker since when K6 execution complete I stop/remove datadog docker container because of other Jenkins build not expecting this container. It seems that docker do not flush it’s cache before stopping.

Adding a sleep of 60 second between k6 run and stopping docker did fix my problem. All metrics are always publishing now.

Is there a better solution without a sleep command?

Given the fact that this likely is datadog-agent not flushing it metrics, maybe ask in their support :wink: