Skip to content

fix(telemetry): use supported OpenTelemetry logging handler - #973

Open
seonghobae wants to merge 5 commits into
mainfrom
codex/otel-logging-handler-20260907
Open

fix(telemetry): use supported OpenTelemetry logging handler#973
seonghobae wants to merge 5 commits into
mainfrom
codex/otel-logging-handler-20260907

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The hosted backend suite emitted the deprecated OpenTelemetry SDK LoggingHandler warning. Telemetry setup could also orphan a log provider after handler construction failed, and metric initialization could replace the application's original error.

Use the supported logging-instrumentation handler with the existing explicit provider, WARNING threshold, and dedicated bounded logger. Register provider ownership immediately after allocation for normal shutdown cleanup. Include counter acquisition in the existing fail-open metric boundary. Do not introduce global instrumentation, root-handler mutation, or a LogRecord-factory replacement. ADR 0122 remains the governing boundary.

RED → causal repair → exact coverage GREEN

Causal RED assertions reproduced the deprecated handler warning, orphaned provider shutdown, counter-initialization error escape, missing span/propagator branches, unsupported outcome rejection, and partial SDK status support. Historical hosted run 34087122183 measured only 96% after 32 tests; an exact-current RED lane 34088114733 then ran all owned observability test modules and failed --fail-under=100 at 97%, identifying the remaining executable branches. Earlier measurement harness failures ran no valid coverage measurement and are not product evidence.

Current product head 182d3c9d4c5f2a8ab2d63e77b8a9ced663a183f6 adds only causal degraded-SDK/privacy regressions for those branches. Exact-head verification run 34088301425, job 101636507846, is terminal GREEN: 44 tests passed, lineageweave/observability.py reports 197 statements / 0 missed and 68 branches / 0 partial at 100%, coverage report --fail-under=100 passed without exclusions or denominator reduction, and compileall passed.

The two github-code-quality inline findings on the new pytest.raises regression were verified as false positives: the explicit exception is caught by the context manager, execution continues to the span assertions, and the exporter variable is consumed there. The exact 44-test run executes those statements and branch coverage is 100%. Both threads were answered with that evidence and resolved without rewriting working tests merely for the analyzer.

Current hosted boundary

Exact-head standard Tests 34088155091 are terminal GREEN on 182d3c9d4c5f2a8ab2d63e77b8a9ced663a183f6: the PostgreSQL-backed full test suite passed, and frontend lint/test/production build/Storybook passed. Exact-head PROV-O and Ontology Pages are also GREEN.

SAST 34088128228, Security 34088128243, and CodeQL 34088128190 are still waiting for runner admission/terminal evidence, and no qualifying independent current-head APPROVE exists.

Therefore this is Ready for Review but not merge-ready. Authenticated central security/CodeQL verdicts, independent approval, collector/runtime acceptance, protected merge, deployment, and release remain unproven. Do not substitute the 100% owned-module proof, full repository Tests GREEN, resolved COMMENT threads, predecessor evidence, synthetic status, or no-op head churn for those gates.

Official guidance: https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/logging/logging.html

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: f8840b74-83fc-4d03-b228-d6887f859f34

📥 Commits

Reviewing files that changed from the base of the PR and between 83eba56 and 182d3c9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • AGENTS.md
  • docs/product-technical-gap-baseline.md
  • lineageweave/observability.py
  • pyproject.toml
  • tests/test_observability.py
  • tests/test_observability_telemetry.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as draft September 7, 2026 05:02

Copy link
Copy Markdown
Contributor Author

Review finding — the handler migration itself is directionally correct, but this PR was Ready while its owned production module coverage is explicitly 95%. The LineageWeave maintainer contract requires owned production Test/Edge Case Coverage 100%; a documented 95% gap is therefore a repair finding, not merge-ready evidence. I returned the PR to Draft. Keep the supported opentelemetry.instrumentation.logging.handler.LoggingHandler boundary and existing fail-open behavior, add a realistic --cov-branch --cov-fail-under=100 RED for lineageweave/observability.py, cover the remaining branches without excluding lines or weakening coverage configuration, then rerun the exact-head observability/server-diagnostic suite and hosted gates. OpenTelemetry 1.44.0/0.65b0 explicitly deprecates the SDK handler in favor of instrumentation-logging, so do not revert to the deprecated import to satisfy tests.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review: the handler migration and the newly added _failure_counter() failure boundary are causal and keep telemetry fail-open. The provider is retained early enough for shutdown ownership if handler setup fails, and the application failure classification is no longer replaceable by a metrics-provider exception. I found no new source-semantics defect in this six-file delta. However, the PR's own current evidence still reports lineageweave/observability.py at 96% statement/branch coverage. Under this repository's owned-production 100% Test/Edge Coverage contract, that is a real verification gap, so keeping this head Draft is correct. Do not convert the focused 32-test GREEN or this COMMENT into merge-ready evidence; close the remaining executable branches with realistic tests, then require fresh exact-head full-suite/security/CodeQL and qualifying independent approval.

@seonghobae
seonghobae marked this pull request as ready for review September 7, 2026 05:47
Comment thread tests/test_observability.py
Comment thread tests/test_observability.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant