Open mary2501 opened 4 weeks ago
Additional information: if I use the datadog library on the CDK, which adds a lambda layer (https://docs.datadoghq.com/serverless/libraries_integrations/cdk/), I don't have this problem.
My guess since the issue is that your lambda ends quickly is because the logs are sent in an async fashion outside the normal execution flow:
So if you have something like pino.info("test")
and your lambda ends quickly, there is always that chance that the logs don't get sent out because the log send is sent out-of-band, so the async call to send the log may or may not resolve.
but overall, if you're using pino
for this it's prob not a good idea because pino
is async out-of-band by design
for your issue to be resolved, src/DataDogTransport.ts
would have to be refactored to add the ability to await
on the send, and you'd have to use a logging library that is not pino
(or create your own) that you can await on
Hi folks, I found this error: I have a valid configuration for Datadog; when I send the datadog's log, if the lambda execution is too fast, this log will not be sent. I tried using the same configuration and adding a
sleep
instruction, and the log was sent correctly.Would anyone be able to help me find a solution? I also tried without success:
sendImmediate: true
on the option transportsendIntervalMs: 1
on the option transport