fix(traceloop-sdk): bump logging instrumentation to support newer otel versions#3339
fix(traceloop-sdk): bump logging instrumentation to support newer otel versions#3339
Conversation
WalkthroughRaised the minimum version of the opentelemetry-instrumentation-logging dependency in packages/traceloop-sdk/pyproject.toml from >=0.50b0 to >=0.57b0. No other files or exported/public entities were changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Assessment against linked issues
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 17e2559 in 45 seconds. Click for details.
- Reviewed
13lines of code in1files - Skipped
1files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/traceloop-sdk/pyproject.toml:32
- Draft comment:
Dependency bump: Confirm that updating to '>=0.57b0' for opentelemetry-instrumentation-logging resolves the removed 'std_to_otel' issue and aligns with other OTEL dependencies. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_1JLCYwVB0Rdq11f5
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
packages/traceloop-sdk/poetry.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
packages/traceloop-sdk/pyproject.toml(1 hunks)
| opentelemetry-exporter-otlp-proto-http = "^1.28.0" | ||
| opentelemetry-exporter-otlp-proto-grpc = "^1.28.0" | ||
| opentelemetry-instrumentation-logging = ">=0.50b0" | ||
| opentelemetry-instrumentation-logging = ">=0.57b0" |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Bumping logging instrumentation is the right direction; consider constraining the upper bound and verify no direct std_to_otel usage.
- The import failures reported in 🐛 Bug Report: traceloop-sdk==0.45.5 fails to import with OpenTelemetry due to removed std_to_otel dependency #3338 stem from upstream changes around
std_to_otelinopentelemetry._logs; newer OTEL releases have hidden/renamed that helper, so older logging instrumentation breaks. Moving toopentelemetry-instrumentation-logging0.57b0 aligns with the latest contrib releases and should restore compatibility. (github.com, pypi.org) - Poetry’s
^1.28.0constraints foropentelemetry-{api,sdk,exporter-*}already allow installing OTEL 1.34.x and newer 1.x, so this single bump should be sufficient if the breakage was solely in the logging instrumentation. (github.com, opentelemetry.netlify.app)
Two actionable suggestions:
- Add an upper bound to avoid unexpected breakage from future 0.58+ changes until we explicitly validate them.
- Add CI checks to ensure our codebase never imports
std_to_otel(or any private_logssymbols) directly.
Proposed diff for the dependency line:
-opentelemetry-instrumentation-logging = ">=0.57b0"
+opentelemetry-instrumentation-logging = ">=0.57b0,<0.58"Optional follow-ups:
- Consider aligning other
opentelemetry-instrumentation-*minimums to>=0.57b0for consistency (they already allow it via>=0.50b0, so not blocking). - Update the PR checklist: add a regression test that simply
import traceloop.sdkpasses under a matrix of OTEL versions (e.g., 1.28.x and 1.34.x). The docs show logs APIs evolving; having a smoke test will catch drift early. (opentelemetry-python.readthedocs.io, opentelemetry-python-contrib.readthedocs.io)
Run the following to confirm we’re not relying on removed/hidden APIs and to surface any accidental imports:
If you want, I can open a follow-up PR to add the import smoke test and the grep-based guard in CI.
🏁 Script executed:
#!/bin/bash
# 1) Search for direct or indirect usage of std_to_otel or private _logs imports
rg -n --hidden -S '\bstd_to_otel\b|\bfrom\s+opentelemetry\._logs\b|\bimport\s+opentelemetry\._logs\b' -C2
# 2) Spot-check that our dependency bump is present only in traceloop-sdk
rg -n 'opentelemetry-instrumentation-logging\s*=\s*".*"' -C2
# 3) If you have a local Python available, optionally validate resolution against a newer OTEL (example):
# NOTE: Not executed in this sandbox; run locally.
# poetry lock && poetry run python -c "import traceloop.sdk; print('import ok')"Length of output: 1303
Prevent future OTEL logging instrumentation breakage and add CI guard
No direct imports of std_to_otel or opentelemetry._logs were found across the codebase, and the only occurrence of
opentelemetry-instrumentation-logging = ">=0.57b0" is in packages/traceloop-sdk/pyproject.toml. To lock in compatibility and guard against future upstream changes, please:
• In packages/traceloop-sdk/pyproject.toml, add an upper bound on the logging instrumentation.
• Introduce a CI check (e.g., a grep in your pipeline) to prevent any accidental imports of private OTEL logging helpers (std_to_otel, opentelemetry._logs, etc.).
Proposed diff for the dependency line:
--- packages/traceloop-sdk/pyproject.toml
+++ packages/traceloop-sdk/pyproject.toml
@@ -30,7 +30,7 @@
opentelemetry-exporter-otlp-proto-http = "^1.28.0"
opentelemetry-exporter-otlp-proto-grpc = "^1.28.0"
-opentelemetry-instrumentation-logging = ">=0.57b0"
+opentelemetry-instrumentation-logging = ">=0.57b0,<0.58"
opentelemetry-instrumentation-requests = ">=0.50b0"
opentelemetry-instrumentation-sqlalchemy = ">=0.50b0"Optional follow-ups:
- Align other
opentelemetry-instrumentation-*minima to>=0.57b0for consistency (they already allow it via>=0.50b0). - Add a smoke test in your CI matrix to verify
import traceloop.sdkunder OTEL versions 1.28.x and 1.34.x.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| opentelemetry-instrumentation-logging = ">=0.57b0" | |
| opentelemetry-exporter-otlp-proto-http = "^1.28.0" | |
| opentelemetry-exporter-otlp-proto-grpc = "^1.28.0" | |
| opentelemetry-instrumentation-logging = ">=0.57b0,<0.58" | |
| opentelemetry-instrumentation-requests = ">=0.50b0" | |
| opentelemetry-instrumentation-sqlalchemy = ">=0.50b0" |
🤖 Prompt for AI Agents
In packages/traceloop-sdk/pyproject.toml around line 32, the
opentelemetry-instrumentation-logging dependency should be tightened to prevent
future breaking changes and a CI guard added: change the version specifier to
include an upper bound (e.g., ">=0.57b0,<0.58" or similar stable upper bound
your team prefers) to lock compatibility, and add a CI pipeline step that greps
the repo for prohibited private OTEL imports (std_to_otel, opentelemetry._logs,
etc.) and fails the job if any matches are found; optionally consider aligning
other opentelemetry-instrumentation-* minima to >=0.57b0 and adding a CI smoke
test importing traceloop.sdk against target OTEL versions.
Fixes #3338
feat(instrumentation): ...orfix(instrumentation): ....Important
Update
opentelemetry-instrumentation-loggingversion inpyproject.tomlto>=0.57b0for newer OpenTelemetry support.opentelemetry-instrumentation-loggingversion inpyproject.tomlfrom>=0.50b0to>=0.57b0to support newer OpenTelemetry versions.This description was created by
for 17e2559. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit