-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Continuing a conversation from the Pydantic Logfire slack: https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1758163028178829
It turns out that a naive configuration of logfire in tandem with lambda_runtime doesn't work well on AWS Lambda. The problem (as I understand it) is that between lambda executions the background thread in which logfire performs exports is frozen and may never complete.
To make this work, I see a couple of options:
- We could make
logfireexport synchronously on every span. This would probably guarantee best behaviour at the cost of performance. One option to mitigate overheads might be to export to a local lambda Extension, which I think can then batch & run the export in the background. - We could potentially introduce a
logfire::flush()global API. This would avoid overheads, but any telemetry exported after the flush call would still be unreliably sent.
Maybe there's more advanced solutions which can combine the best of both.
Metadata
Metadata
Assignees
Labels
No labels