chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Don't set global OpenTelemetry providers

Open lmolkova opened this issue 6 months ago • 2 comments
trafficstars

When I run my app with chainlit run, chainlit configures OTel and sets global tracer provider

https://github.com/Chainlit/chainlit/blob/6ec007032945dfd6a1a608cc3c8074bd2f643d0c/backend/chainlit/telemetry.py#L64-L69

As a result I cannot as a user configure my own OTel pipeline and export my telemetry to a different place. I can work it around with enable_telemetry = false.

But more importantly, https://github.com/Chainlit/chainlit/blob/6ec007032945dfd6a1a608cc3c8074bd2f643d0c/PRIVACY_POLICY.md?plain=1#L9-L18

this is not correct. All telemetry that my code or natively instrumented libraries report to OTel will be sent to that questionable endpoint.

If you want to collect your telemetry, report it on a dedicated tracer that's configured to export to your endpoint, but never ever set the global ones

lmolkova avatar Apr 21 '25 19:04 lmolkova