Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/adr/0008-otel-sampling-is-a-sampler-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
default), the SDK picks its own sampler, which honours `OTEL_TRACES_SAMPLER` / `OTEL_TRACES_SAMPLER_ARG`,
so both the default behaviour and the existing environment-variable path are unchanged; the
pass-through needs no conditional, because `TracerProvider(sampler=None)` is identical to omitting
the argument at the declared 1.28 floor and at 1.44 alike.
the argument at the declared 1.42 floor and at 1.44 alike.

A `float` sample rate mirroring `sentry_traces_sample_rate` was rejected. It buys no dependency
independence, since `opentelemetry_instrumentors` already carries `BaseInstrumentor` and
Expand Down
4 changes: 1 addition & 3 deletions lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
from opentelemetry.metrics import get_meter_provider
from opentelemetry.trace import get_tracer_provider
from opentelemetry.util.http import parse_excluded_urls
from starlette.routing import BaseRoute, Match, Mount, Route
from starlette.types import Scope

Expand Down Expand Up @@ -253,8 +252,7 @@ def _instrument_http_app(self, http_application: "StarletteWithLifespan") -> "St
default_span_details=functools.partial(
build_fastmcp_route_details_from_scope, routes=http_application.routes
),
# OpenTelemetryMiddleware only parses a raw string from 0.56b0; the floor is 0.49b0.
excluded_urls=parse_excluded_urls(",".join(self._build_excluded_url_patterns("STARLETTE"))),
excluded_urls=",".join(self._build_excluded_url_patterns("STARLETTE")),
exclude_spans=self.bootstrap_config.opentelemetry_exclude_spans,
tracer_provider=get_tracer_provider(),
meter_provider=get_meter_provider(),
Expand Down
3 changes: 0 additions & 3 deletions lite_bootstrap/instruments/opentelemetry_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ def on_end(self, span: "ReadableSpan") -> None:
pyroscope.remove_thread_tag(_PYROSCOPE_SPAN_ID_KEY, format_span_id(span.context.span_id))
pyroscope.remove_thread_tag(_PYROSCOPE_SPAN_NAME_KEY, span.name)

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


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

Expand Down
36 changes: 18 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ pyroscope = [
"pyroscope-io>=1.0.1",
]
otl = [
# One release train: api/sdk/exporters 1.28 pair with every instrumentation package at
# 0.49b0. 0.49b0 is the first that does not import `pkg_resources`, which setuptools no
# longer ships, so anything older fails at import on a fresh install. The exporters carry
# the floor separately: nothing else constrains them, and left bare they resolve 23 minors
# behind the api they must match.
"opentelemetry-api>=1.28",
"opentelemetry-sdk>=1.28",
"opentelemetry-exporter-otlp-proto-grpc>=1.28",
"opentelemetry-instrumentation>=0.49b0",
# One release train: api/sdk/exporters 1.42 pair with every instrumentation package at
# 0.63b0. 1.42 is the first sdk whose base SpanProcessor.force_flush returns True rather
# than None, which PyroscopeSpanProcessor relies on. The exporters carry the floor
# separately: nothing else constrains them, so left bare they can resolve to a release
# that does not match the api.
"opentelemetry-api>=1.42",
"opentelemetry-sdk>=1.42",
"opentelemetry-exporter-otlp-proto-grpc>=1.42",
"opentelemetry-instrumentation>=0.63b0",
]
otl-http = [
"opentelemetry-api>=1.28",
"opentelemetry-sdk>=1.28",
"opentelemetry-exporter-otlp-proto-http>=1.28",
"opentelemetry-instrumentation>=0.49b0",
"opentelemetry-api>=1.42",
"opentelemetry-sdk>=1.42",
"opentelemetry-exporter-otlp-proto-http>=1.42",
"opentelemetry-instrumentation>=0.63b0",
]
logging = [
# >=21.3 for structlog.stdlib.ProcessorFormatter.remove_processors_meta (LoggingInstrument's
Expand All @@ -93,7 +93,7 @@ fastapi-sentry = [
]
fastapi-otl = [
"lite-bootstrap[fastapi,otl]",
"opentelemetry-instrumentation-fastapi>=0.49b0",
"opentelemetry-instrumentation-fastapi>=0.63b0",
]
fastapi-logging = [
"lite-bootstrap[fastapi,logging]",
Expand Down Expand Up @@ -129,9 +129,9 @@ litestar-otl = [
"lite-bootstrap[litestar,otl]",
# >=2.22 for litestar.plugins.opentelemetry (LitestarOpenTelemetryInstrument registers its OpenTelemetryPlugin).
"litestar>=2.22",
# Raised from 0.46b0 with the rest of the train: every instrumentation package pins
# `opentelemetry-instrumentation` to its own exact version, so they move together.
"opentelemetry-instrumentation-asgi>=0.49b0",
# Moves with the rest of the train: every instrumentation package pins
# `opentelemetry-instrumentation` to its own exact version.
"opentelemetry-instrumentation-asgi>=0.63b0",
]
litestar-logging = [
"lite-bootstrap[litestar,logging]",
Expand Down Expand Up @@ -183,7 +183,7 @@ fastmcp = [
]
fastmcp-otl = [
"lite-bootstrap[fastmcp,otl]",
"opentelemetry-instrumentation-asgi>=0.49b0",
"opentelemetry-instrumentation-asgi>=0.63b0",
]
fastmcp-metrics = [
"lite-bootstrap[fastmcp]",
Expand Down
Loading