You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feat]: Add environment variable to disable A2A SDK telemetry when OpenTelemetry is installed by another library #613
Is your feature request related to a problem? Please describe.
When using a2a-sdk[http-server] alongside observability tools like Langfuse that bring OpenTelemetry as a dependency, the A2A SDK's @trace_class decorators automatically activate and emit spans for internal operations (EventQueue, InMemoryTaskStore, etc.).
This pollutes trace dashboards with unwanted internal spans like:
The current _NoOp fallback in telemetry.py only works when OpenTelemetry isn't installed at all — not when it's present but unwanted for A2A internals.
Describe the solution you'd like
Add an environment variable (e.g., A2A_TELEMETRY_DISABLED=true) that forces the _NoOp path in telemetry.py regardless of whether OpenTelemetry is installed.
pythonimport os
if os.getenv("A2A_TELEMETRY_DISABLED", "").lower() == "true":
trace = _NoOp()
else:
try:
from opentelemetry import trace
...
Describe alternatives you've considered
Custom OTEL Sampler: Filter spans by name — adds complexity
Monkey-patching a2a.utils.telemetry: Fragile, breaks on SDK updates
Uninstalling OpenTelemetry: Not possible when other tools require it
Additional context
Similar pattern exists in other SDKs (e.g., Vercel AI SDK's experimental_telemetry option). This would allow users to opt-out of A2A tracing while still using OpenTelemetry for their own instrumentation
Activity
rohityan commentedon Jan 21, 2026
Hi @Abhishek-Nath-WinWire , Thank you for the feature request. However since this is a duplicate issue 604 closing it here.