eager-pager-29628
12/03/2025, 4:18 PMtall-airline-16756
12/03/2025, 4:18 PMtall-airline-16756
12/03/2025, 4:19 PMLogData was removed from opentelemetry.sdk._logs in OpenTelemetry Python SDK v1.20.0, so code or a dependency expecting LogData fails to import.
Two simple fixes — pick one that fits your project:
• Pin the OpenTelemetry SDK to a version that still provides LogData (quickest fix):
a. In your Dockerfile or requirements, install a compatible SDK, for example:
RUN pip install "opentelemetry-sdk<1.20.0"
1. Rebuild the image.
• Update code/dependencies to the newer API (longer-term fix):
a. Replace imports of LogData with LogRecord and update any log-related code to the new API:
from opentelemetry.sdk._logs import LogRecord
1. Ensure any third-party packages (e.g., livekit-agents) you use are compatible with OpenTelemetry ≥1.20.0 or upgrade them if newer releases support the new logging API.
If you want, tell me:
• which packages/versions you install in your Dockerfile (your pip install line or requirements.txt), and
• whether you prefer pinning or updating code — I’ll give the exact Dockerfile changes or the code refactor steps. Sources: How to Send Logs from the JavaScript SDK to Providers like Datadog | Observability data hooks | LiveKit docseager-pager-29628
12/03/2025, 4:19 PMtall-airline-16756
12/03/2025, 4:20 PMlivekit-agents when it imports LogData from OpenTelemetry.
Two practical options:
• If you want the fastest fix, pin OpenTelemetry to a pre-1.20 release that still provides LogData. Add or update in your Dockerfile (or requirements):
RUN pip install "opentelemetry-sdk<1.20.0"
Then rebuild the image.
• If you prefer a long-term fix, update to OpenTelemetry ≥1.20.0 and make sure livekit-agents (or any package importing LogData) is updated or refactored to use LogRecord instead. That requires either:
◦ Upgrading livekit-agents to a version that supports the new logging API, or
◦ Editing the telemetry code to replace LogData imports/usages with LogRecord and adapt any call sites.
Tell me which you prefer and paste the pip install line(s) or your requirements.txt from the Dockerfile — I’ll give the exact Dockerfile change or the minimal code edits you’ll need.cuddly-cartoon-47334
12/04/2025, 5:40 AMtall-airline-16756
12/04/2025, 5:41 AMLogData.
• In your Dockerfile (or requirements.txt) add:
RUN pip install "opentelemetry-sdk<1.20.0"
• Rebuild the image. This resolves the import inside livekit-agents immediately.
Option B — Long-term fix (recommended if you can change code or upgrade packages)
• Upgrade OpenTelemetry to >=1.20.0 and ensure livekit-agents (or any package importing LogData) is updated to a version that uses LogRecord instead of LogData.
• Or edit the telemetry code to replace:
from opentelemetry.sdk._logs import LogData
with
from opentelemetry.sdk._logs import LogRecord
and adjust uses to match the new API.
Tell me which option you want to apply and paste the pip install line(s)` or your requirements.txt from the Dockerfile — I’ll give the exact Dockerfile change or the minimal code edits and commands to rebuild.