Skip to content

Document SDK request tracing (OpenTelemetry) for Python and C++ #5207

Description

@btshrewsbury-viam

Feature

OpenTelemetry request tracing in the SDKs. Two announcements complete SDK tracing parity so a module developer can trace gRPC RPCs end-to-end across service boundaries:

  • Python SDK Tracing (announced 2026-06-25). Opt-in, zero-overhead by default: install the extra pip install "viam-sdk[tracing]" and enable tracing in the module config. Brings Python in line with Go and C++.
  • C++ Tracing (announced 2026-06-02). The C++ SDK generates a child span per component/service method under the RPC span when tracing is enabled.

(Go and C++ span creation already existed; this issue closes the developer-facing SDK enablement gap for Python and the C++-specific behavior.)

Current docs coverage

Partial. The server-side OpenTelemetry story is documented generically (docs/data/overview.md, docs/cli/manage-your-fleet.md, docs/monitor/troubleshoot.md) as "your SDK code, viam-server, and modules." Missing:

  • The Python viam-sdk[tracing] install extra and how to enable it (no hits anywhere; docs/build-apps/setup/python.md documents only the [mlmodel] extra).
  • Any per-SDK / C++-specific note (child-span-per-method).

Verified state / source PRs

  • viamrobotics/viam-python-sdk#1223 — "RSDK-14017: Python tracing" (merged)
  • viamrobotics/viam-cpp-sdk#638 — "RSDK-13855: Span creation" (merged)

Proposed docs work

  • Type (Diátaxis): how-to — enable tracing per SDK and see the spans.
  • Placement: extend the existing tracing coverage rather than spawn a thin new page. Add per-SDK enablement (Python [tracing] extra + config; note Go/C++ behavior) where OpenTelemetry tracing is already described (docs/data/overview.md / docs/monitor/troubleshoot.md). Additive; consolidate Python + C++ in one edit to avoid two agents touching the same tracing files.
  • Draft learning objectives — users will be able to:
    1. [Apply] Enable OpenTelemetry tracing in a Python module by installing the viam-sdk[tracing] extra and turning it on in config, so RPC latency is visible end-to-end.
    2. [Understand] Explain that each component/service method emits a child span of the RPC span (Go, Python, C++).
    3. [Diagnose] Use the resulting traces to pinpoint latency or failures across service boundaries.

Target PR: additive edits to the tracing docs (Python + C++ together).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions