-
Notifications
You must be signed in to change notification settings - Fork 123
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
Conversation
Deploying logfire-docs with
|
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 |
There was a problem hiding this 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
andopentelemetry-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 |
There was a problem hiding this comment.
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.
No description provided.