open-telemetry / open-telemetry/opentelemetry-python
WeaverLiveCheck improvements
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
In semantic-conventions-conformance we drive WeaverLiveCheck from a conformance runner: one live-check per scenario, report written to disk, coverage reduced across a run. A few things we had to work around.
Raw report isn't reachable. LiveCheckReport proxies __getitem__/get/__contains__ but never exposes the underlying dict, so to persist weaver's JSON we read report._report. A public raw (or to_dict()) would fix it, and typed samples / statistics properties would cover what most callers index anyway.
extra_args instead of named parameters. --config and --advice-data have no parameter, so we pass them as raw strings positioned against weaver's CLI. config= and advice_data= would be checkable; policies_dir= could also take a sequence once weaver accepts repeated --advice-policies (weaver#1679).
Weaver's stdout/stderr are unreachable. They're written to tempfiles, read only on failure into logger.error, and deleted in close(). When a run misbehaves there's nothing to attach to a report or a test failure. Exposing them as a property, and attaching them to LiveCheckError, would make failures diagnosable.
Startup wait is noisy and fixed. _wait_for_ready polls /health through a urllib3 Retry, so every connection refused before weaver binds its port is logged as a warning — we silence the urllib3.connectionpool logger around the whole session to keep output readable. The retry ceiling (~10s) is also not configurable; a cold start against a large registry can exceed it. A quiet readiness wait plus a startup_timeout parameter would help.
end() after stop returns an empty report. It warns and returns LiveCheckReport({}). For a runner that reduces reports into committed coverage, that reads as "the scenario emitted nothing" rather than a programming error — raising would be safer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the WeaverLiveCheck entry points, including LiveCheckReport, _wait_for_ready, end(), and LiveCheckError, then inspect their callers and the existing conformance-runner workarounds. Done should cover an accessible raw report and typed fields, named CLI parameters, reachable process output, configurable quiet startup waiting, and an error rather than an empty report after stop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100