Skip to content

feat(tracing): migrate to OpenLLMetry, drop LangSmith auto-bridge#14

Merged
dominik-bura merged 2 commits intomainfrom
feat/normalize-obs-vars
Apr 22, 2026
Merged

feat(tracing): migrate to OpenLLMetry, drop LangSmith auto-bridge#14
dominik-bura merged 2 commits intomainfrom
feat/normalize-obs-vars

Conversation

@dominik-bura
Copy link
Copy Markdown
Contributor

@dominik-bura dominik-bura commented Apr 20, 2026

Summary

Swap the SDK's default tracing path from the LangSmith OTel bridge to OpenLLMetry, and expand the auto-instrumentor list to cover AWS Bedrock, Google Vertex AI, Mistral, the OpenAI Agents SDK, and the Claude Agent SDK.

Note: this branch also contains a prior unrelated commit `fix(sdk): normalize observation variables` from `feat/normalize-obs-vars`. Only the last commit on the branch (`feat(tracing): migrate to OpenLLMetry, drop LangSmith auto-bridge`) is part of this change set.

Why

The LangSmith OTel bridge (auto-enabled since 8523ab7) was chosen because OpenLLMetry's LangchainInstrumentor historically didn't capture LangGraph's internal run tree for nested graphs (deepagents subagents). But the LangSmith bridge has an unfixable gap: its OTel exporter never emits tool definitions. Verified empirically against langsmith==0.7.33 source and a test harness — the words "function" and "bind" don't appear in the exporter code, and nothing on the langsmith-sdk issue tracker requests it.

OpenLLMetry's LangchainInstrumentor v0.60.0 now correctly covers LangGraph (create_agent) and deepagents with subagents, and emits the official OTel GenAI semantic conventions (gen_ai.tool.definitions, gen_ai.operation.name, gen_ai.usage.*). A companion PR in promptic (#457) teaches the backend parser to read these keys.

Changes

  • init() no longer auto-enables the LangSmith OTel bridge. The _configure_langsmith_otel() auto-call is removed; _langsmith_tracing_context() itself is kept so users who manually set LANGSMITH_OTEL_ENABLED=true still get their Promptic tags propagated through LangSmith run metadata.
  • _auto_instrument() no longer short-circuits "skip all OpenLLMetry instrumentors when LangSmith is active."
  • _INSTRUMENTORS expanded from 5 → 10: +bedrock, +vertexai, +mistralai, +openai_agents, +claude_agent_sdk. Each has a matching install extra.
  • [langchain] extra bumped to >=0.60.0 and pinned against opentelemetry-instrumentation<0.62b0 as a workaround for upstream openllmetry#4009 until PR #4025 ships.
  • [claude-agent] extra uses the community PyPI package opentelemetry-claude-agent-sdk; the official opentelemetry-python-contrib package of the same name is not yet released.
  • README.md updated to reflect the new auto-detected list and install extras.

What users see

  • LangGraph / deepagents users now get full tool-definition visibility in Promptic's agent-evaluation insights.
  • AWS Bedrock, Vertex AI, Mistral, OpenAI Agents SDK, and Claude Agent SDK users can install their extras and get traced without manual setup.
  • Users who prefer the LangSmith bridge can still opt in via LANGSMITH_TRACING=true LANGSMITH_OTEL_ENABLED=true.

Test plan

  • uv build succeeds with the new extras and pins.
  • End-to-end test harness in companion PR verifies OpenLLMetry captures tool definitions, tool errors, and produces clean trace structure for LangGraph + deepagents.
  • CI passes.

🤖 Generated with Claude Code


Open in Devin Review

Dominik Bura and others added 2 commits April 17, 2026 10:17
The LangSmith OTel bridge we auto-enabled for LangGraph / deepagents
coverage has a critical gap: its OTel exporter never emits tool
definitions (verified against langsmith 0.7.33 source and an empirical
test harness). That broke the unused_tool insight in Promptic's agent
evaluation — tools defined but never called were invisible.

OpenLLMetry's LangchainInstrumentor (v0.60.0) now correctly covers
LangGraph's create_agent and deepagents with subagents, and emits the
official OpenTelemetry GenAI semantic conventions including
gen_ai.tool.definitions, gen_ai.operation.name, and gen_ai.usage.*.

- Remove _configure_langsmith_otel() auto-call in init().
- Remove the "LangSmith active -> skip all OpenLLMetry instrumentors"
  short-circuit in _auto_instrument().  OpenLLMetry instrumentors now
  run by default.
- Bump the [langchain] extra to >=0.60.0 and pin
  opentelemetry-instrumentation<0.62b0 as a workaround for
  openllmetry#4009 (upstream PR #4025 pending).
- Add direct-SDK instrumentors for AWS Bedrock, Google Vertex AI, and
  Mistral to _INSTRUMENTORS plus matching extras.
- Add framework instrumentors for the OpenAI Agents SDK
  (opentelemetry-instrumentation-openai-agents-v2) and Claude Agent SDK
  (opentelemetry-claude-agent-sdk) plus matching extras.
- _langsmith_tracing_context() and its ai_component() injection are kept:
  users who still prefer the LangSmith bridge can opt in by setting
  LANGSMITH_TRACING=true and LANGSMITH_OTEL_ENABLED=true before init(),
  and their Promptic tags will propagate through LangSmith run metadata.
- README: update the auto-detected instrumentor list from 5 names to 10
  and expand the install-extras block to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

TestsPassed ✅SkippedFailed
Test Results48 ran48 passed0 skipped0 failed

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@dominik-bura dominik-bura merged commit 64fd38e into main Apr 22, 2026
3 checks passed
@dominik-bura dominik-bura deleted the feat/normalize-obs-vars branch April 22, 2026 13:06
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.

1 participant