Skip to content

oss_28_fix_sphinx_docs_build#46

Open
ocelotl wants to merge 2 commits into
mainfrom
oss_28_fix_sphinx_docs_build
Open

oss_28_fix_sphinx_docs_build#46
ocelotl wants to merge 2 commits into
mainfrom
oss_28_fix_sphinx_docs_build

Conversation

@ocelotl

@ocelotl ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Closes #39

Fix the broken Sphinx -W docs build (Linear OSS-28, D1/D2): force pure-Python protobuf in docs/conf.py so the zipkin generated pb2 module autodocs under modern protobuf (D1); add opentelemetry-exporter-opencensus to docs-requirements + document its trace_exporter submodule + widen its protobuf constraint (>=3.13,<8.0) so the docs install resolves (D2).

Validation: verified via a real sphinx-build -E -a -W run — exits 0; zipkin proto module documented; opencensus page renders 6 objects (was 0). Scope: docs/ + docs-requirements + opencensus pyproject + changelog.

Linear issue: https://linear.app/dash0/issue/OSS-28/d1-d2-fix-broken-sphinx-docs-build-zipkin-protobuf-conflict-opencensus

The docs build installs a modern protobuf (5.x) but the zipkin-proto-http
exporter ships protobuf code generated for the old runtime. Under the C++
protobuf implementation that code raises "Descriptors cannot be created
directly", so autodoc silently skips the module and the -W build fails.
Force the pure-Python protobuf implementation in docs/conf.py via
os.environ.setdefault so the module is importable for autodoc regardless of
how sphinx-build is invoked (including the Read the Docs path, which does not
go through tox).

The opencensus exporter documentation page rendered zero objects because
opentelemetry-exporter-opencensus was not installed for the docs build (only
the shim was). Add it to docs-requirements.txt and document its
trace_exporter submodule in the rst so the OpenCensusSpanExporter API is
rendered. Its protobuf pin (~= 3.13) conflicted with opentelemetry-proto
(>= 5.0) and made the docs install unresolvable, so widen it to
>= 3.13, < 8.0; the exporter imports and runs correctly under protobuf 5.
@ocelotl

ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

🔒 Internal (dash0) — not for upstream.

@ocelotl

ocelotl commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

📣 Public-facing draft — to be used for the upstream PR in open-telemetry/opentelemetry-python. No internal references; copy verbatim.

Title: Fix broken Sphinx docs build for zipkin proto and opencensus exporters

What

Fix the documentation build so sphinx-build -W succeeds, the zipkin-proto-http exporter is documented, and the OpenCensus exporter page renders its API.

Why

  • The zipkin-proto-http generated zipkin_pb2.py (old descriptor style) raises Descriptors cannot be created directly under the modern protobuf runtime installed for docs, so autodoc drops the module and the -W build fails. The tox docs env works around this with an env var, but the Read the Docs build (which calls sphinx directly) does not.
  • The OpenCensus exporter doc page rendered zero objects: the package was never installed for docs (only the shim was), and the rst referenced the empty top-level package rather than the trace_exporter submodule that holds OpenCensusSpanExporter.

How

  • Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python in docs/conf.py via os.environ.setdefault, so the fix applies regardless of how sphinx is invoked (tox and RTD).
  • Add opentelemetry-exporter-opencensus to docs-requirements.txt and an automodule for its trace_exporter submodule in the rst.
  • Widen the opencensus exporter's protobuf constraint from ~= 3.13 to >= 3.13, < 8.0; the old pin conflicts with opentelemetry-proto (>= 5.0) and made the docs install unresolvable. The exporter imports/runs under protobuf 5.

How verified

Ran sphinx-build -E -a -W -b html -T with the external env var unset — build succeeds (exit 0). The zipkin proto exporter is documented, and the OpenCensus page renders its objects including OpenCensusSpanExporter (previously 0). Confirmed pip install -r docs-requirements.txt resolves with all changes.

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.

oss_28_fix_sphinx_docs_build

1 participant