Skip to content

Add optional faust[opentelemetry] extra + docs for OpenTelemetry via the OpenTracing shim#688

Open
wbarnha wants to merge 1 commit into
masterfrom
claude/opentelemetry-shim
Open

Add optional faust[opentelemetry] extra + docs for OpenTelemetry via the OpenTracing shim#688
wbarnha wants to merge 1 commit into
masterfrom
claude/opentelemetry-shim

Conversation

@wbarnha

@wbarnha wbarnha commented Jul 18, 2026

Copy link
Copy Markdown
Member

Description

A small, non-breaking step toward OpenTelemetry: package + document the bridge that already works.

Faust's app.tracer accepts any OpenTracing-compatible tracer, and OpenTelemetry ships an official OpenTracing shim (opentelemetry.shim.opentracing_shim.create_tracer) that exposes exactly that, backed by an OTel TracerProvider. So OpenTelemetry works today with no change to Faust's tracing internals or public API — this PR just makes it a first-class, discoverable path.

Changes

  • requirements/extras/opentelemetry.txt + the opentelemetry bundle in setup.pypip install "faust[opentelemetry]" (pulls opentelemetry-opentracing-shim + opentelemetry-sdk).
  • docs/userguide/sensors.rst — a new Distributed Tracing section showing how to build an app.tracer from an OpenTelemetry TracerProvider via create_tracer(), so Faust's stream/agent/rebalance spans flow out to any OTel exporter (OTLP/Jaeger/Zipkin).

Verification

  • Installed the extra and ran the exact docs example: wiring app.tracer = OpenTelemetryTracer(provider) and exercising it the way Faust does internally (get_tracer(...).start_span(operation_name=…, tags=…), set_tag, finish, and app.tracer.trace(...)) — all work end-to-end, emitting OTel spans (TracerShim/SpanShim).
  • setup.py lint clean (flake8/black); the RST parses cleanly and uses the file's existing .. sourcecode:: convention.

Context

This is step 2 of a phased OpenTracing→OpenTelemetry plan: #686 makes opentracing optional; this documents/packages the OTel bridge (no breaking change); a future major could do a native OTel rewrite or drop built-in tracing in favor of opentelemetry-instrumentation-faust. It complements #681 (which documents the external auto-instrumentation package) by covering the app.tracer wiring path.


Generated by Claude Code

Faust's app.tracer accepts any OpenTracing-compatible tracer, so
OpenTelemetry works today via its OpenTracing shim -- no code change
needed. Make that a first-class, documented path:

- requirements/extras/opentelemetry.txt + the 'opentelemetry' setup.py
  bundle -> pip install faust[opentelemetry] (pulls
  opentelemetry-opentracing-shim + opentelemetry-sdk).
- docs/userguide/sensors.rst: a 'Distributed Tracing' section showing how
  to build an app.tracer from an OpenTelemetry TracerProvider via
  create_tracer(), so Faust's spans flow out to any OTel exporter.

Non-breaking: no change to faust's tracing internals or public API; this
just documents and packages the bridge. Verified the example wires
app.tracer through the shim and start_span/set_tag/finish/trace() all
work end-to-end.
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (f3019aa) to head (1387a6e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #688   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         104      104           
  Lines       11136    11136           
  Branches     1201     1201           
=======================================
  Hits        10484    10484           
  Misses        551      551           
  Partials      101      101           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant