Skip to content

fix(traceloop-sdk): bump logging instrumentation to support newer otel versions#3339

Merged
nirga merged 3 commits intomainfrom
otel-bug-incompat
Aug 23, 2025
Merged

fix(traceloop-sdk): bump logging instrumentation to support newer otel versions#3339
nirga merged 3 commits intomainfrom
otel-bug-incompat

Conversation

@nirga
Copy link
Copy Markdown
Member

@nirga nirga commented Aug 23, 2025

Fixes #3338

  • I have added tests that cover my changes.
  • If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • (If applicable) I have updated the documentation accordingly.

Important

Update opentelemetry-instrumentation-logging version in pyproject.toml to >=0.57b0 for newer OpenTelemetry support.

  • Dependencies:
    • Update opentelemetry-instrumentation-logging version in pyproject.toml from >=0.50b0 to >=0.57b0 to support newer OpenTelemetry versions.

This description was created by Ellipsis for 17e2559. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Chores
    • Updated the minimum required version of the OpenTelemetry logging instrumentation to 0.57b0.
    • Ensures better compatibility with recent OpenTelemetry releases and reduces potential warnings.
    • No application changes required; users pinned to older versions may need to update dependencies.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 23, 2025

Walkthrough

Raised 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

Cohort / File(s) Summary
Dependency constraints
packages/traceloop-sdk/pyproject.toml
Bump opentelemetry-instrumentation-logging minimum version from >=0.50b0 to >=0.57b0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Ensure traceloop-sdk imports cleanly with current OpenTelemetry versions; resolve missing std_to_otel import error (#3338) No code changes removing or guarding std_to_otel import; only a dependency floor change on instrumentation package.

Poem

I hop through TOML fields so bright,
Nudged a version, set it right.
One tiny bump, a cautious tune—
May logs align with OTel soon.
Thump-thump goes my merge delight,
Carrots cached for build tonight! 🥕

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch otel-bug-incompat

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 17e2559 in 45 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 draft 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 Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 8fefb87 and 17e2559.

⛔ Files ignored due to path filters (1)
  • packages/traceloop-sdk/poetry.lock is 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Bumping logging instrumentation is the right direction; consider constraining the upper bound and verify no direct std_to_otel usage.

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 _logs symbols) 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.57b0 for consistency (they already allow it via >=0.50b0, so not blocking).
  • Update the PR checklist: add a regression test that simply import traceloop.sdk passes 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.57b0 for consistency (they already allow it via >=0.50b0).
  • Add a smoke test in your CI matrix to verify import traceloop.sdk under 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.

Suggested change
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.

@nirga nirga merged commit 79b7715 into main Aug 23, 2025
9 checks passed
@nirga nirga deleted the otel-bug-incompat branch August 23, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: traceloop-sdk==0.45.5 fails to import with OpenTelemetry due to removed std_to_otel dependency

2 participants