datadog lambda扩展日志延迟

发布于 2025-02-10 22:56:59 字数 473 浏览 2 评论 0原文

我试图使用datadog扩展程序从AWS lambda发送日志。

它有效,但是发送的日志被发送,直到关闭lambda(与调用结束相对),该日志在DataDog内出现在日志之前会导致约10分钟的延迟。

Lambda的当前环境变量如下:

DD_API_KEY_SECRET_ARN = secert_arn
DD_CAPTURE_LAMBDA_PAYLOAD = true
DD_ENV = dev
DD_FLUSH_TO_LOG = false
DD_LAMBDA_HANDLER = index.handler
DD_LOG_LEVEL = debug
DD_LOGS_INJECTION = true
DD_SERVERLESS_LOGS_ENABLED = true
DD_SERVICE = MyService
DD_SITE = datadoghq.com
DD_TRACE_ENABLED = true
DD_VERSION  $LATEST

Im trying to send logs from AWS Lambda using Datadog extension.

It works but the logs arent being sent until the lambda is shut down (as opposed to the end of invocation) which leads to ~10min delay before logs appear within Datadog.

The current environment variables for the lambda are as follows:

DD_API_KEY_SECRET_ARN = secert_arn
DD_CAPTURE_LAMBDA_PAYLOAD = true
DD_ENV = dev
DD_FLUSH_TO_LOG = false
DD_LAMBDA_HANDLER = index.handler
DD_LOG_LEVEL = debug
DD_LOGS_INJECTION = true
DD_SERVERLESS_LOGS_ENABLED = true
DD_SERVICE = MyService
DD_SITE = datadoghq.com
DD_TRACE_ENABLED = true
DD_VERSION  $LATEST

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

油焖大侠 2025-02-17 22:56:59

您应该看看这个问题:
https://github.com/datadadog/datadag-lambda-lambda-bambda-extension/issues/issues/sissues/sissues/ 29

让我从中引用答案:

嗨@Stalar,谢谢您的联系。

这是一种基于lambda扩展的方式和
Lambda日志API工作。功能完成后,
扩展被冷冻直到下一次调用。但是,没有
确保我们当时已收到日志。日志可能会到达
随后的函数调用。此外,如果您的话
重复调用功能,我们将转到
定期冲洗日志以减少开销,这可能意味着
日志不会在每一个之后立即出现在datadog中
调用。

我们与AWS保持联系,以解决这一问题
问题。

让我知道您是否还有其他问题!

You should take a look at this issue:
https://github.com/DataDog/datadog-lambda-extension/issues/29

Let me quote an answer from it:

Hi @stalar, thanks for reaching out.

This is a known behavior based on the way Lambda Extensions and the
Lambda Logs API work. Once your function finishes running, the
extension is frozen until the next invocation. However, there isn't a
guarantee that we have received logs at that time. Logs may arrive on
the subsequent invocation of the function. Furthermore, if your
function is invoked repeatedly, we will switch to a strategy of
periodically flushing logs to reduce overhead, which may mean that
logs do not immediately appear in Datadog after each and every
invocation.

We are in touch with AWS about possible improvements to resolve this
issue.

Let me know if you have any further questions!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文