DataDog / serilog-sinks-datadog-logs

Serilog Sink that sends log events to Datadog https://www.datadoghq.com/
Apache License 2.0
62 stars 42 forks source link

Provide an option to handle ingestion failure #50

Closed yuwaMSFT2 closed 1 year ago

yuwaMSFT2 commented 4 years ago

For applications that want to handle the logs reliably, they need to have a way to know any ingestion failures. In current code base, after the datadog sink retries several times, it gives up and discard the data (with a error tracing). This gives difficulty for the application to handle the error.

Is it possible to add a callback on ingestion failure?

ogaca-dd commented 4 years ago

Hi @yuwaMSFT2 ,

I have opened a new PR: https://github.com/DataDog/serilog-sinks-datadog-logs/pull/51. You can get the list of LogEvent that are not sent successfully (CannotSendLogEventException.LogEvents).

Does it help you for this issue?

yuwaMSFT2 commented 4 years ago

Thanks @ogaca-dd! Yes this will help for sure!

ogaca-dd commented 4 years ago

Serilog.Sinks.Datadog.Logs 0.3.3 includes https://github.com/DataDog/serilog-sinks-datadog-logs/pull/51 which help in handling ingestion failure.