From b1d0b4f199700191d73e930747a3b4f4c5b5f700 Mon Sep 17 00:00:00 2001 From: Nikolay Bratanov Date: Fri, 1 May 2026 15:25:50 +0300 Subject: [PATCH] fix(hindsight-api-slim): bump opentelemetry-{api,sdk,instrumentation,exporter} floors so PrometheusMetricReader 0.62b1 doesn't crash startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit opentelemetry-exporter-prometheus 0.62b1 calls MetricReader.__init__(otel_component_type=…), a kwarg that opentelemetry-sdk introduced only in v1.41.0 (open-telemetry/opentelemetry-python#4970). The previous `opentelemetry-{api,sdk}>=1.20.0` / `opentelemetry-{instrumentation,exporter,semantic-conventions}>=0.41b0` / `opentelemetry-exporter-otlp-proto-http>=1.20.0` floors let pip resolve a recent exporter-prometheus against an older sdk (e.g. 1.39.x cached in a lockfile), so on hindsight-api startup metric initialisation explodes with "MetricReader.__init__() got an unexpected keyword argument 'otel_component_type'. Metrics will be disabled (using no-op collector)." Functionally hindsight stays up but /metrics is silently empty. Bumping all six otel pins to the matching 1.41.0 / 0.62b1 floor keeps pip's resolver consistent across the otel ecosystem and removes the mismatch that produces the warning. Closes #1372 --- hindsight-api-slim/pyproject.toml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hindsight-api-slim/pyproject.toml b/hindsight-api-slim/pyproject.toml index 290c79333..9c8cc622e 100644 --- a/hindsight-api-slim/pyproject.toml +++ b/hindsight-api-slim/pyproject.toml @@ -28,12 +28,19 @@ dependencies = [ "PyJWT[crypto]>=2.8.0", "fastmcp>=3.2.0", # SSRF/path traversal, OAuth confused deputy, command injection fixes "python-dateutil>=2.8.0", - "opentelemetry-api>=1.20.0", - "opentelemetry-sdk>=1.20.0", - "opentelemetry-instrumentation-fastapi>=0.41b0", - "opentelemetry-exporter-prometheus>=0.41b0", - "opentelemetry-exporter-otlp-proto-http>=1.20.0", - "opentelemetry-semantic-conventions>=0.41b0", + # opentelemetry-exporter-prometheus 0.62b1 calls + # MetricReader.__init__(otel_component_type=…), a kwarg added in + # opentelemetry-sdk 1.41.0 (open-telemetry/opentelemetry-python#4970). + # Without these floors, pip happily resolves a 0.62b1 exporter against + # an older sdk and metric initialisation crashes at startup with + # "MetricReader.__init__() got an unexpected keyword argument + # 'otel_component_type'". Keep all six pins moving together. + "opentelemetry-api>=1.41.0", + "opentelemetry-sdk>=1.41.0", + "opentelemetry-instrumentation-fastapi>=0.62b1", + "opentelemetry-exporter-prometheus>=0.62b1", + "opentelemetry-exporter-otlp-proto-http>=1.41.0", + "opentelemetry-semantic-conventions>=0.62b1", "dateparser>=1.2.2", "google-genai>=1.0.0", "google-auth>=2.0.0",