Repository navigation
ci(telemetry): run the real OTLP wire path in CI and pin it (#1083) - #1104
Conversation
…lled (#1083) The otel-wire leg installs [otel], so the two rows that pin the fail-fast contract and the loopback policy probed the SDK and skipped themselves in exactly the environment that has it: 17 passed, 5 skipped at 2ab6b39 with the extra present, and the loopback row built a live provider pointed at 127.0.0.1:4318 before skipping. - The construction row now stands the SDK import in with the interpreter's own marker (None in sys.modules), so _load_otel walks its real ImportError path and the install line is asserted for both entry points; one real-import row skips where the SDK is present. - The loopback rows stub the SDK seam and assert the accepted endpoint, so the bridge's decision is tested without opening a provider. - docs/metrics.md says credentials go in OTEL_EXPORTER_OTLP_HEADERS, never in the URL: an accepted endpoint is not echoed here, but httpx quotes the request URL in its own errors. These are the three items in the #1083 thread that belong to this leg.
…led (#1083) Completes the previous commit, which carried the other five files of the slice: the fail-fast row now blocks the SDK with the interpreter's own sys.modules marker and asserts the install line from both entry points, and the loopback rows stub the seam and assert the accepted endpoint instead of building a live provider and skipping. With [otel] installed: 17 passed, 5 skipped before, 22 passed, 1 skipped after. Offline: 24 passed, 1 skipped over test_otel_wire.py + test_otel_export.py.
The job installs the [otel] extra but ran only tests/test_otel_wire.py, so the fail-fast marker row and the endpoint rows in tests/test_otel_export.py never ran with the SDK present -- the exact environment those rows exist to cover. Run both files in that job; nothing else changes.
|
Review request, one tip: Checks at that tip: Tier: T3 by path — What the tip does, and how it is earned:
Red at base Closes #1083. |
Birfy
left a comment
There was a problem hiding this comment.
Review (Birfy)
Tip SHA: b7774c9
Ran:
- pytest -q tests/test_otel_export.py tests/test_otel_wire.py at this tip → 23 passed, 1 skipped (the AGENTDESCENT_OTEL_WIRE socket row, as the offline suite intends)
- The same two files applied onto current main f5cc52e (the tip itself is based at c94e9d6; no overlap with later main files this PR touches) → 23 passed, 1 skipped
- test_the_ci_leg_installs_the_extra_and_runs_the_smoke_script fails on unmodified main f5cc52e (scripts/otel_wire_smoke.py is absent) and passes at this tip
- python -m tools.changelog_fragments check → pass (40 fragments on the PR branch; 47 when the fragment is applied on current main)
- python -m tools.gen_api_docs --check → pass
- .github/scripts/risk_gate.py --pr 1104 → T3 (path .github/workflows/tests.yml; also a urllib/requests rule hit attributed to scripts/otel_wire_smoke.py, which does not call either — T3 already holds by the workflow path)
- CI at this tip → green (build, test 3.9–3.13, otel-wire); deploy skipped; reviewed tip / risk tier report-only SUCCESS
Not run: - mkdocs build --strict — docs/metrics.md changed; the CI
buildjob is green at this tip - Full offline suite locally — the CI test matrix is the line
- scripts/otel_wire_smoke.py against a real [otel] extra on this box — the extra is not installed here; the CI
otel-wirejob is SUCCESS at this tip - Ark real-model run — no model path changed
Findings: - none
Verdict: PASS
|
Review (Birfy) Tip SHA: b7774c9
|
Closes #1083
The exporter from
#923/#1081shipped with one untested seam: the offline suite stands a fake SDK in atotel_export._load_otel, so the SDK's own wire path — a real exporter, a real refused connection — ran nowhere. This adds the rows that cover it and the one CI leg where they run.What changed
.github/workflows/tests.yml— a newotel-wirejob:pip install -e ".[otel]" pytest,python scripts/otel_wire_smoke.py, thenAGENTDESCENT_OTEL_WIRE=1 pytest -q tests/test_otel_wire.py tests/test_otel_export.py. Both files are in that step on purpose: the job installs the extra, so the fail-fast marker row and the endpoint rows must run here with the SDK present — that is the environment those rows exist for.tests/test_otel_wire.py(new) — a real exporter pointed at a closed127.0.0.1port: the refusal must be logged and contained, never raised out ofexport_run, andexport_runstill returns its count. Plus a row that pins the CI leg itself, so deleting the only place the wire path runs fails a test instead of silently dropping the coverage. The socket row is gated behindAGENTDESCENT_OTEL_WIRE=1; the default suite stays offline.scripts/otel_wire_smoke.py(new) — the measured smoke the job runs: one span and one metric at a closed port, asserting the degradation is logged andforce_flushreturns.tests/test_otel_export.py— the fail-fast row stops probing-and-skipping: it clears everyopentelemetry*module and putsNoneinsys.modules["opentelemetry"], so_load_otelraises its realImportError; the loopback row builds a real exporter instead of skipping. These are the rows Security's2026-11-14T09:32:26Zcomment assigned to this slice.docs/metrics.md— credentials go inOTEL_EXPORTER_OTLP_HEADERS, never in the URL (path or query); matchingchangelog.d/1083-otel-wire-path.md.Size: 6 files,
+338/−18againstf5cc52ef; T3 by path (.github/**is a T3 path; tests and docs alone would be T1).Red at base
f5cc52efClean worktree at
f5cc52efe41750633ac37876fc2d2894a8a6f9f3, onlytests/test_otel_wire.pycopied in (git status: one untracked file):The socket row passes at base because
otel_exportalready shipped in#1081— it pins that behaviour. The base red is the missing smoke script and the missingotel-wirejob: atf5cc52ef,grep -c otel-wire .github/workflows/tests.ymlis 0 andscripts/otel_wire_smoke.pydoes not exist.Verification at the tip
Tip SHA: b7774c9
Ran (python 3.10.12, fresh venv from the clone,
pip install -e ".[otel]" pytest):pytest -q tests/test_otel_wire.py tests/test_otel_export.py→ 24 passed, 1 skipped (the skip is the real-import row, correct)python scripts/otel_wire_smoke.py→ exit 0, last lineok: the wire path degraded as documentedpython -m tools.gen_api_docs --check→docs/api.md is up to datepython -m tools.changelog_fragments check→40 changelog fragment(s) OKgit merge --no-commit --no-ffof this branch intof5cc52ef→ clean, zero conflictsNot run:
mkdocs build --strict— mkdocs is not installed in this clone's venv; CI'sbuildleg is the linetests/test_docs_links.py—markdownis not installed here (environment, not this diff)test (3.12)/otel-wirerun is that confirmationSame-repo head:
maintainer_can_modifyis requested; if GitHub reports it structurally false on a same-repo head, that is the platform (there is no fork to grant), recorded here rather than worked around.