Closed jorge-pascual closed 11 months ago
Hi @jorge-pascual
Thanks for raising this. I tried a similar setup and cannot reproduce the issue. However that could be related to my machine or network conditions. I did some debugging, and CloseAndFlush
appears to block until all logs are flushed. If I do not call CloseAndFlush
, logs are indeed dropped when the process terminates (as expected).
I tried to put a Thread.Sleep
in the HTTP client to simulate a slow transaction, and it still correctly blocked until flush. I'll leave this issue open to see if anyone else has similar problems, or if we can get a more reliable repro.
Hi @gh123man
I've simplified the configuration and found that you are right. The Datadog Sink is behaving correctly. The problem was with a "parent" sink that didn't dispose of the child resources.
Thank you for your very fast reply. You can close the issue.
-- Jorge
Great! Glad you found a solution. And no problem 👍
Hello everyone,
I had a suspicion that after a
CloseAndFlush
, events were being lost. I've set up a very simple proof of concept which is essentially a console application that writes some logs and then finishes. Upon running it, I notice that the logs aren’t in DataDog.I’ve used the debugger and after executing
CloseAndFlush
, I see that indeed there's a DataDog thread working and if it terminates, obviously the data it still holds will be lost.Looking at the code in Dispose, I don’t see that it's waiting for the events to finish sending. I'm not sure if this is truly a problem with this sink or with PeriodicBatching.
Has anyone else experienced something similar?
Thank you!