Make opentracing an optional dependency (faust[opentracing])#686
Merged
Conversation
opentracing is archived/EOL and was a required core dependency even though distributed tracing is opt-in (app.tracer defaults to None). Move it to an optional extra so the default install no longer pulls it. Add a tiny no-op stand-in (faust/utils/_opentracing.py) that the six tracing-touching modules fall back to when opentracing is not installed, so Faust still imports and runs -- tracing simply becomes a no-op. The only runtime path hit without a tracer is noop_span(), which now returns a stub span; every other opentracing use is either a type annotation or gated behind 'if tracer is not None'. Real tracing (app.tracer / TracingSensor) still requires installing faust[opentracing]. - requirements: drop opentracing from requirements.txt; add requirements/extras/opentracing.txt and the 'opentracing' setup.py bundle; keep it in test.txt so CI still exercises the real path. - No public API change: TracerT, app.tracer, app.trace(), TracingSensor and faust.utils.tracing all keep working.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #686 +/- ##
==========================================
- Coverage 96.00% 95.97% -0.04%
==========================================
Files 104 103 -1
Lines 11169 11069 -100
Branches 1206 1191 -15
==========================================
- Hits 10723 10623 -100
Misses 352 352
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
faust/utils/_opentracing.py is only imported when opentracing is not installed; the CI test env always installs faust[opentracing], so the stub is never exercised and shows 0% coverage. Omit it like the sibling faust/utils/tracing.py already is.
faust/sensors/distributed_tracing.py (TracingSensor) is optional tracing code -- it requires opentracing plus a live tracer to exercise and has no tests, so it was already effectively uncovered; the guarded-import change just surfaced it in the patch diff. Omit it like the sibling tracing modules (faust/utils/tracing.py, faust/utils/_opentracing.py) already are.
This was referenced Jul 18, 2026
wbarnha
added a commit
that referenced
this pull request
Jul 19, 2026
Per review, the v0.12.0 changelog/release notes should describe only what is already on master, not work still in open PRs. - Remove the not-yet-merged items: the offset-commit data-loss fixes (#606/#707, #316/#692), the optional OpenTracing/OpenTelemetry extras (#685/#686, #688/#681), web_application_options (#704), and the reported-issue fix stack (#693-#703, #705). These will be added back as they merge. - Add a Dependencies section noting the current runtime/client libraries: mode-streaming >= 0.4.0, aiokafka >= 0.10.0 (compatible with recent 0.13/0.14 releases), the new confluent-kafka >= 2.0.0 for faust[ckafka], and the faust-cchardet fork replacing unmaintained cchardet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
wbarnha
enabled auto-merge
July 21, 2026 17:49
wbarnha
added a commit
to SpencerWhitehead7/faust
that referenced
this pull request
Jul 21, 2026
…st-streaming#708) * docs: prepare v0.12.0 release notes and changelog Resume the Keep a Changelog format (dormant since v0.8.10) with a v0.12.0 section, and add standalone GitHub release notes covering the changes since v0.11.3 plus the pending fix stack. Highlights: two offset data-loss fixes (faust-streaming#606/faust-streaming#707, faust-streaming#316/faust-streaming#692), the re-added confluent-kafka driver, Python 3.14 support (3.8/3.9 dropped), OpenTracing/OpenTelemetry made optional, and a live-broker CI harness. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL * docs: drop closed codecov.yml PR (faust-streaming#683) from v0.12.0 notes PR faust-streaming#683 (codecov.yml with a 1% coverage threshold) was closed without merging, so remove it from the changelog and release notes to keep the v0.12.0 change list accurate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL * docs: derive Sphinx version from the package instead of a stale constant `docs/conf.py` hardcoded `version_dev='1.1'` / `version_stable='1.0'` - robinhood-era values that never matched faust-streaming's 0.x line, so the published GitHub Pages docs advertised the wrong version. Derive the documented major.minor from `faust.__version__` (which setuptools_scm resolves from the git tag), so the docs always report the real version and this can't silently drift between releases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL * docs: scope v0.12.0 notes to merged work; note dependency updates Per review, the v0.12.0 changelog/release notes should describe only what is already on master, not work still in open PRs. - Remove the not-yet-merged items: the offset-commit data-loss fixes (faust-streaming#606/faust-streaming#707, faust-streaming#316/faust-streaming#692), the optional OpenTracing/OpenTelemetry extras (faust-streaming#685/faust-streaming#686, faust-streaming#688/faust-streaming#681), web_application_options (faust-streaming#704), and the reported-issue fix stack (faust-streaming#693-faust-streaming#703, faust-streaming#705). These will be added back as they merge. - Add a Dependencies section noting the current runtime/client libraries: mode-streaming >= 0.4.0, aiokafka >= 0.10.0 (compatible with recent 0.13/0.14 releases), the new confluent-kafka >= 2.0.0 for faust[ckafka], and the faust-cchardet fork replacing unmaintained cchardet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL * docs: set v0.12.0 changelog date to 2026-07-19 Replace the UNRELEASED placeholder with the release date and drop the now-satisfied "set the date at tag time" note. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL * Delete RELEASE_NOTES_v0.12.0.md --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
wbarnha
disabled auto-merge
July 21, 2026 17:59
wbarnha
enabled auto-merge
July 21, 2026 18:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
opentracingis archived/EOL (folded into OpenTelemetry) and was pinned<=2.4.0, yet it was a required core dependency — pulled by every Faust install even though distributed tracing is opt-in (app.tracerdefaults toNone). This moves it to an optional extra, so the default install no longer depends on an unmaintained package.This is Option A from a broader OpenTracing-removal discussion: the smallest, non-breaking step. No public API changes —
TracerT,app.tracer,app.trace(),faust.sensors.distributed_tracing.TracingSensor, andfaust.utils.tracingall keep working. Real tracing just now requirespip install faust[opentracing].How it works
faust/utils/_opentracing.py(aSpan/Tracer+tags/Format/follows_from/start_child_spansurface, all no-ops).opentracinginstalled — tracing simply becomes a no-op. The only runtime path reached without a tracer isnoop_span()(returns a stub span); every other opentracing reference is a type annotation or gated behindif tracer is not None.Packaging
opentracing>=1.3.0,<=2.4.0fromrequirements/requirements.txt.requirements/extras/opentracing.txt+ theopentracingbundle insetup.py→faust[opentracing].requirements/test.txtso CI still exercises the real opentracing path (the aiokafka tests useopentracing.Spandirectly).Verification
import faust, create a defaultkafka://App, resolve the transport registry,noop_span(), and import/instantiateTracingSensor— all work (verified by uninstalling the package).tests/unit/tables/test_recovery.py,test_base.py,test_aiokafka.py→ 277 passed, 23 skipped.Migration note
Users who configure
app.traceror addTracingSensorshould installfaust[opentracing]. Worth a CHANGELOG entry; a natural follow-up (next major) is to remove the built-in tracing entirely in favor of the communityopentelemetry-instrumentation-faust.Generated by Claude Code