8000 Upgrade to OpenTelemetry SDK 1.34.0 by alexmojaki · Pull Request #1120 · pydantic/logfire · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upgrade to OpenTelemetry SDK 1.34.0 #1120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 5, 2025
Merged

Upgrade to OpenTelemetry SDK 1.34.0 #1120

merged 11 commits into from
Jun 5, 2025

Conversation

alexmojaki
Copy link
Contributor
@alexmojaki alexmojaki commented Jun 5, 2025

No description provided.

Copy link
cloudflare-workers-and-pages bot commented Jun 5, 2025

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1ab480d
Status: ✅  Deploy successful!
Preview URL: https://f657680b.logfire-docs.pages.dev
Branch Preview URL: https://alex-otel-1-34.logfire-docs.pages.dev

View logs

@alexmojaki alexmojaki changed the title Alex/otel 1.34 Upgrade to OpenTelemetry SDK 1.34.0 Jun 5, 2025
@alexmojaki alexmojaki requested a review from Copilot June 5, 2025 11:35
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Upgrades the project to use OpenTelemetry SDK version 1.34.0 and adapts code/tests to API changes.

  • Bumps opentelemetry-sdk and opentelemetry-exporter-otlp-proto-http upper bounds to <1.35.0
  • Replaces SpanAttributes and other semantic‐convention constants with their string keys
  • Adapts the dynamic batch processor, integrations, and tests to the new scheduling property and attribute names; adds fallback for older httpx instrumentor

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Updated OpenTelemetry SDK and OTLP exporter version ranges
logfire/_internal/tracer.py Switched semantic attribute keys from constants to strings
logfire/_internal/scrubbing.py Removed SpanAttributes imports; replaced with string keys
logfire/_internal/integrations/httpx.py Added meter_provider arg and fallback for older versions
logfire/_internal/integrations/fastapi.py Updated HTTP attribute keys to string literals
logfire/_internal/exporters/dynamic_batch.py Updated schedule delay logic and new batch_processor API
logfire/_internal/exporters/test.py Adjusted exception stacktrace key in test exporter
logfire/_internal/exporters/processor_wrapper.py Replaced semantic constants with string keys
logfire/_internal/db_statement_summary.py Switched DB attributes to string keys
logfire/_internal/config.py Removed semantic imports and updated resource attribute keys
tests/conftest.py Imported GLOBAL_TRACE_PROVIDER to reset trace provider
tests/test_stdlib_logging.py Adjusted coverage pragmas around deprecated log test
tests/test_logfire_api.py Removed Python <3.9 guards for agent instrumentation tests
tests/test_configure.py Updated batch delay assertions and removed old test blocks
tests/otel_integrations/test_openai_agents_mcp.py Updated expected span hierarchy and timestamps
tests/otel_integrations/test_openai_agents.py Reordered and cleaned imports for new Python dependencies
tests/otel_integrations/test_fastapi.py Extended test expectations for HTTP response spans
tests/ 8000 exporters/test_dynamic_batch_span_processor.py Changed delay assertions to use _schedule_delay
.github/workflows/main.yml Removed Python 3.8 job from CI matrix
Comments suppressed due to low confidence (3)

tests/otel_integrations/test_openai_agents_mcp.py:670

  • [nitpick] This very large hard‐coded span expectation block makes the test lengthy and hard to maintain. Consider extracting common assertions into helper functions or parametrizing the input.
{  'name': 'MCP server handle request: tools/list', ... } (large inserted block)

tests/otel_integrations/test_openai_agents_mcp.py:333

  • The updated parent span_id (11) for the 'Responses API with {gen_ai.request.model!r}' span may not reflect the actual instrumentation order; please verify it matches the new span hierarchy.
'parent': {'trace_id': 2, 'span_id': 11, 'is_remote': False},

tests/test_logfire_api.py:169

  • [nitpick] You removed the Python version guard around instrument_pydantic_ai; if this integration truly requires Python ≥3.9, you may want to reintroduce a conditional skip to prevent failures on unsupported interpreters.
if not pydantic_pre_2_5:


def check_delays(exp: TrackingExporter, min_delay: float, max_delay: float) -> None:
for delay in exp.export_delays:
assert min_delay < delay < max_delay, f'delay was {delay}, which is not between {min_delay} and {max_delay}'

# test the default behaviour
exporter = configure_tracking_exporter()
assert get_span_processors()[0].batch_processor._schedule_delay == 0.1 # type: ignore
Copy link
Preview
Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Referencing the private _schedule_delay attribute directly is brittle; consider exposing a public accessor or helper in the DynamicBatchSpanProcessor to assert schedule delays.

Copilot uses AI. Check for mistakes.

@alexmojaki alexmojaki marked this pull request as ready for review June 5, 2025 11:41
@alexmojaki alexmojaki merged commit aabf20e into main Jun 5, 2025
7B09 14 checks passed
@alexmojaki alexmojaki deleted the alex/otel-1.34 branch June 5, 2025 11:42
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
0