Describe your questionI have a node server on Docker using vercel ai-sdk with langfuse setup (not self-hosted). Locally, I can get every traces on langfuse dashboard, but when the docker is deployed on ECS, absolutely no data is sent to langfuse. Even debug mode active doesn't log anything in Cloudwatch (all logs are shown locally). The code is the same and all env variables are correct. Is anyone had trouble linking langfuse and ECS ? Here are what I tried and didn't work :
Langfuse Cloud or Self-Hosted?Langfuse Cloud If Self-HostedNo response If Langfuse CloudNo response SDK and integration versionsNo response Pre-Submission Checklist
|
Replies: 3 comments 7 replies
|
ECS containers receive SIGTERM before shutdown, but your app isn't flushing traces before terminating. Add a graceful shutdown handler: const gracefulShutdown = async () => {
await langfuseSpanProcessor.forceFlush();
await sdk.shutdown();
process.exit(0);
};
process.on("SIGTERM", gracefulShutdown);Also verify your ECS security group allows outbound HTTPS (port 443) to reach Langfuse Cloud, and check that |
|
I forced a testSpan manually with the use of trace.getTracer() and context.with() to create a test span with trace and context from "@opentelemetry/api". It's working well locally, but still nothing when deployed. |
|
For anyone else experiencing the same issue, I found the cause. I had imported Sentry somewhere in the project. I wasn't using it, but I had imported it. Locally, everything worked fine, but on ECS, Sentry was overwriting Langfuse's opentelemetry configuration. That's why I had no logs or errors because Sentry was absorbing everything. 👉 I discovered this by manually creating a scope and console.log that scope. I found that the processor was Sentry's and not Langfuse's, as it was locally. I just delete Sentry import, and everything was just fine. |
For anyone else experiencing the same issue, I found the cause.
I had imported Sentry somewhere in the project. I wasn't using it, but I had imported it. Locally, everything worked fine, but on ECS, Sentry was overwriting Langfuse's opentelemetry configuration.
That's why I had no logs or errors because Sentry was absorbing everything.
👉 I discovered this by manually creating a scope and console.log that scope. I found that the processor was Sentry's and not Langfuse's, as it was locally.
I just delete Sentry import, and everything was just fine.