From d1bc78108d239b3a7cddc31ba35d77e11d1d4cf3 Mon Sep 17 00:00:00 2001 From: Eduard van Valkenburg Date: Tue, 19 May 2026 11:34:37 +0200 Subject: [PATCH] docs: correct observability Dependencies section - opentelemetry-sdk is no longer a hard dependency; it is lazily imported by create_resource(), create_metric_views(), and configure_otel_providers() with a clear ImportError when missing. Day-to-day instrumentation works with opentelemetry-api alone provided some other component configures the global OpenTelemetry providers (Azure Monitor, an APM agent, application bootstrap, etc.). - opentelemetry-semantic-conventions-ai is no longer used anywhere in the source; remove it from the listed dependencies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- python/samples/02-agents/observability/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python/samples/02-agents/observability/README.md b/python/samples/02-agents/observability/README.md index c27cf9bc14..203d930a33 100644 --- a/python/samples/02-agents/observability/README.md +++ b/python/samples/02-agents/observability/README.md @@ -163,10 +163,15 @@ Whenever there is an active OpenTelemetry span context, Agent Framework automati ### Dependencies -Agent Framework depends on the following OpenTelemetry packages: -- `opentelemetry-api` -- `opentelemetry-sdk` -- `opentelemetry-semantic-conventions-ai` +Agent Framework's core depends on **`opentelemetry-api`** only — the API package is enough for the instrumentation hooks (spans, meters, log records) to emit telemetry, and it has no runtime side effects when no provider is configured. + +If you want the framework to set up providers / exporters for you via `configure_otel_providers()` (or to use the `create_resource()` / `create_metric_views()` helpers), you also need the OpenTelemetry SDK: + +```bash +pip install opentelemetry-sdk +``` + +If `opentelemetry-sdk` is missing, those helper functions raise a clear `ImportError` telling you to install it. Day-to-day instrumentation still works without the SDK as long as some other component (e.g. `azure-monitor-opentelemetry`, your application bootstrap, an APM agent) has configured the global OpenTelemetry providers. Exporters are **not** installed by default — install only what you need: - **Application Insights**: `azure-monitor-opentelemetry`