DataDog/datadog-go

Metrics lost?

Closed this issue · 2 comments

epot commented

Hello,

I am using this library to push metrics to the datadog agent. I have a loop iterating on large structures that is calling:

func (c *Client) Gauge(name string, value float64, tags []string, rate float64)

at each iteration. Somehow not all gauge values are pushed to datadog as I see missing points between each run (I added logs so I know I should push those values). Is there any way to troubleshoot what's going on? Should I use another method to be able to "hammer" the agent from time to time?

This is what it looks like on Datadog side: I should have values every minute:
Screenshot 2023-10-20 at 9 40 09 AM

Hey @epot, 👋

Can you try using the Flush function at the end of your loop iteration to force the client to send the metrics to the Agent at this time? There might be a better time to do it I'll let you judge.

Let me know if that doesn't work for you.

epot commented

Hey !

I ended up delaying those calls to spread them, and I no longer have the issue. Thanks for the Flush tip, I'll try it later.

Cheers,
epot