Skip to content

Commit 89475d3

Browse files
authored
Raise the OpenTelemetry floor to 1.42 / 0.63b0 and delete its shims (#368)
1 parent 6e5e02b commit 89475d3

4 files changed

Lines changed: 20 additions & 25 deletions

File tree

‎docs/adr/0008-otel-sampling-is-a-sampler-object.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
default), the SDK picks its own sampler, which honours `OTEL_TRACES_SAMPLER` / `OTEL_TRACES_SAMPLER_ARG`,
55
so both the default behaviour and the existing environment-variable path are unchanged; the
66
pass-through needs no conditional, because `TracerProvider(sampler=None)` is identical to omitting
7-
the argument at the declared 1.28 floor and at 1.44 alike.
7+
the argument at the declared 1.42 floor and at 1.44 alike.
88

99
A `float` sample rate mirroring `sentry_traces_sample_rate` was rejected. It buys no dependency
1010
independence, since `opentelemetry_instrumentors` already carries `BaseInstrumentor` and

‎lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
3636
from opentelemetry.metrics import get_meter_provider
3737
from opentelemetry.trace import get_tracer_provider
38-
from opentelemetry.util.http import parse_excluded_urls
3938
from starlette.routing import BaseRoute, Match, Mount, Route
4039
from starlette.types import Scope
4140

@@ -253,8 +252,7 @@ def _instrument_http_app(self, http_application: "StarletteWithLifespan") -> "St
253252
default_span_details=functools.partial(
254253
build_fastmcp_route_details_from_scope, routes=http_application.routes
255254
),
256-
# OpenTelemetryMiddleware only parses a raw string from 0.56b0; the floor is 0.49b0.
257-
excluded_urls=parse_excluded_urls(",".join(self._build_excluded_url_patterns("STARLETTE"))),
255+
excluded_urls=",".join(self._build_excluded_url_patterns("STARLETTE")),
258256
exclude_spans=self.bootstrap_config.opentelemetry_exclude_spans,
259257
tracer_provider=get_tracer_provider(),
260258
meter_provider=get_meter_provider(),

‎lite_bootstrap/instruments/opentelemetry_instrument.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ def on_end(self, span: "ReadableSpan") -> None:
151151
pyroscope.remove_thread_tag(_PYROSCOPE_SPAN_ID_KEY, format_span_id(span.context.span_id))
152152
pyroscope.remove_thread_tag(_PYROSCOPE_SPAN_NAME_KEY, span.name)
153153

154-
def force_flush(self, timeout_millis: int = 30000) -> bool: # noqa: ARG002
155-
return True # pragma: no cover - matters only at the sdk 1.28 floor, whose base returns None
156-
157154

158155
OpenTelemetryConfigT = typing.TypeVar("OpenTelemetryConfigT", bound=OpenTelemetryConfig)
159156

‎pyproject.toml‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ pyroscope = [
5656
"pyroscope-io>=1.0.1",
5757
]
5858
otl = [
59-
# One release train: api/sdk/exporters 1.28 pair with every instrumentation package at
60-
# 0.49b0. 0.49b0 is the first that does not import `pkg_resources`, which setuptools no
61-
# longer ships, so anything older fails at import on a fresh install. The exporters carry
62-
# the floor separately: nothing else constrains them, and left bare they resolve 23 minors
63-
# behind the api they must match.
64-
"opentelemetry-api>=1.28",
65-
"opentelemetry-sdk>=1.28",
66-
"opentelemetry-exporter-otlp-proto-grpc>=1.28",
67-
"opentelemetry-instrumentation>=0.49b0",
59+
# One release train: api/sdk/exporters 1.42 pair with every instrumentation package at
60+
# 0.63b0. 1.42 is the first sdk whose base SpanProcessor.force_flush returns True rather
61+
# than None, which PyroscopeSpanProcessor relies on. The exporters carry the floor
62+
# separately: nothing else constrains them, so left bare they can resolve to a release
63+
# that does not match the api.
64+
"opentelemetry-api>=1.42",
65+
"opentelemetry-sdk>=1.42",
66+
"opentelemetry-exporter-otlp-proto-grpc>=1.42",
67+
"opentelemetry-instrumentation>=0.63b0",
6868
]
6969
otl-http = [
70-
"opentelemetry-api>=1.28",
71-
"opentelemetry-sdk>=1.28",
72-
"opentelemetry-exporter-otlp-proto-http>=1.28",
73-
"opentelemetry-instrumentation>=0.49b0",
70+
"opentelemetry-api>=1.42",
71+
"opentelemetry-sdk>=1.42",
72+
"opentelemetry-exporter-otlp-proto-http>=1.42",
73+
"opentelemetry-instrumentation>=0.63b0",
7474
]
7575
logging = [
7676
# >=21.3 for structlog.stdlib.ProcessorFormatter.remove_processors_meta (LoggingInstrument's
@@ -93,7 +93,7 @@ fastapi-sentry = [
9393
]
9494
fastapi-otl = [
9595
"lite-bootstrap[fastapi,otl]",
96-
"opentelemetry-instrumentation-fastapi>=0.49b0",
96+
"opentelemetry-instrumentation-fastapi>=0.63b0",
9797
]
9898
fastapi-logging = [
9999
"lite-bootstrap[fastapi,logging]",
@@ -129,9 +129,9 @@ litestar-otl = [
129129
"lite-bootstrap[litestar,otl]",
130130
# >=2.22 for litestar.plugins.opentelemetry (LitestarOpenTelemetryInstrument registers its OpenTelemetryPlugin).
131131
"litestar>=2.22",
132-
# Raised from 0.46b0 with the rest of the train: every instrumentation package pins
133-
# `opentelemetry-instrumentation` to its own exact version, so they move together.
134-
"opentelemetry-instrumentation-asgi>=0.49b0",
132+
# Moves with the rest of the train: every instrumentation package pins
133+
# `opentelemetry-instrumentation` to its own exact version.
134+
"opentelemetry-instrumentation-asgi>=0.63b0",
135135
]
136136
litestar-logging = [
137137
"lite-bootstrap[litestar,logging]",
@@ -183,7 +183,7 @@ fastmcp = [
183183
]
184184
fastmcp-otl = [
185185
"lite-bootstrap[fastmcp,otl]",
186-
"opentelemetry-instrumentation-asgi>=0.49b0",
186+
"opentelemetry-instrumentation-asgi>=0.63b0",
187187
]
188188
fastmcp-metrics = [
189189
"lite-bootstrap[fastmcp]",

0 commit comments

Comments
 (0)