Using the OpenTelemetry Python SDK
How to send data to Opik using the OpenTelemetry Python SDK
This guide shows you how to directly instrument your Python applications with the OpenTelemetry SDK to send trace data to Opik.
Installation
First, install the required OpenTelemetry packages:
Full Example
Here’s a complete example that demonstrates how to instrument a chatbot application with OpenTelemetry and send the traces to Opik:
Using thread_id
as a span attribute allows you to group related spans into a single conversational thread. Created threads can be used to evaluate multi-turn conversations as described in the Multi-turn conversations guide.