Conversation
- Orchestrator and events agent accept a caller-provided conversation_id and record it as gen_ai.conversation.id - Weather agent no longer fabricates a conversation id (semconv SHOULD NOT) - Canary sends 2-4 turn sessions (SESSION_PROBABILITY, default 0.3) Signed-off-by: Shenoy Pratik Gurudatt <4348487+ps48@users.noreply.github.com>
The planner's MCP tool calls, the weather agent's tools and the events agent's MCP call now carry the turn's conversation id on their execute_tool spans, as OTel GenAI semconv allows since semantic-conventions-genai#518. Filtering sessions by tool attributes (for example failing tools) then finds them. Nothing is set when the caller sends no conversation id. Signed-off-by: Shenoy Pratik Gurudatt <4348487+ps48@users.noreply.github.com>
examples/strands/travel-planner runs the travel planner on the Strands Agents SDK next to the plain-agents version (separate services and ports, same MCP server, fault panel and canary shapes), for demos of the APM topology, Services, Agent Traces and Sessions views on a real agent framework. - Planner, weather and events agents are Strands Agents with @tool functions behind FastAPI; FastAPI and httpx instrumentation make each turn one trace across services and give the service map its edges. - Sessions: requests sharing a conversation_id continue one conversation. trace_attributes put gen_ai.conversation.id (and session.id, user.id) on every span Strands emits, tool spans included. No id is invented when the caller has none. - The HTTP root span is described as the agent invocation (operation, agent, session, input/output messages), since agent views list traces by root. - Bedrock when the fault panel's real-LLM toggle is on and AWS credentials are set; otherwise a scripted fallback model drives the same Strands loop, so chat and execute_tool spans still appear (model id scripted-fallback). - Faults use the plain-agents shape; a failing tool fails its span, the sub-agent's response, the planner's tool span and the request root. - example-strands-canary runs the existing canary against these services. Signed-off-by: Shenoy Pratik Gurudatt <4348487+ps48@users.noreply.github.com>
ps48
requested review from
anirudha,
goyamegh,
joshuali925,
kylehounslow and
vamsimanohar
as code owners
October 1, 2026 09:42
…lation Only the plain-agents weather agent exported logs, so traces from the travel planners had few or no correlated logs. Now every agent does: - Plain agents (travel-planner orchestrator, events-agent): Python logging over OTLP gRPC, as the weather agent does. Each step logs inside its span: plan requested, sub-agent fan-out, MCP tool calls, failed sub-tasks (warning), tool errors, completion. - Strands agents (planner, weather, events): the same over OTLP gRPC (OTEL_EXPORTER_OTLP_LOGS_ENDPOINT; spans and metrics stay on HTTP). Shared helpers log MCP calls and errors, injected faults, the model used and the answer; the planner logs sub-agent calls and failures. The SDK's own warnings are not exported, so export retries cannot feed back into the log stream. Every log carries the active trace and span ids, so Agent Traces' Related logs and Explore traces' logs tab list them under the trace. Tested: one plain and two Strands plans (one with a weather error fault); logs-otel-v1-* holds each step once per service under the trace id, with the fault as WARN/ERROR logs. Signed-off-by: Shenoy Pratik Gurudatt <4348487+ps48@users.noreply.github.com>
FastAPI 0.142 (picked up by unpinned rebuilds) adds its own OpenTelemetry
spans, including a fastapi.endpoint span around every handler. The
plain agents' enrich() and get_current_span() then reached that span
instead of the request span, so the trace root lost gen_ai.operation.name,
the conversation id and the messages. Agent views read the root, so
sessions showed no messages and traces lost their agent attributes.
The example apps instrument themselves (ASGI middleware, FastAPI and
httpx instrumentation), so they pass FastAPI(telemetry={...}) with
tracing, metrics, logs and operation spans off. Older FastAPI versions
put unknown arguments in **extra and ignore them.
Tested: rebuilt the plain and Strands agents on FastAPI 0.142; the
POST /plan root again carries invoke_agent, the conversation id and
input messages, with no fastapi.* spans, and logs still correlate.
Signed-off-by: Shenoy Pratik Gurudatt <4348487+ps48@users.noreply.github.com>
Open
4 of 6 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a Strands Agents version of the multi-agent travel planner (
examples/strands/travel-planner), plus multi-turn sessions in the existing plain-agents planner. Both run side by side, so the stack's APM topology, Services, Agent Traces and Sessions views can be demoed on a real agent framework.Strands travel planner (
strands-travel-planner,strands-weather-agent,strands-events-agent; ports 8010 to 8012)Agents with@toolfunctions behind FastAPI. They use the same MCP server, fault panel and API shape (POST /plan) as the plain-agents planner.invoke_agent,chat,execute_tool, event loop) with the latest GenAI conventions, as span attributes.conversation_idcontinue one conversation (the planner keeps its history).trace_attributesputgen_ai.conversation.id,session.idanduser.idon every span Strands emits, includingexecute_toolspans, which OTel GenAI semconv allows since semantic-conventions-genai#518. No id is invented when the caller sends none.chatandexecute_toolspans still appear without credentials (gen_ai.request.model = scripted-fallback).example-strands-canaryruns the existing canary (normal, shallow, deep and session shapes) against these services.Plain-agents planner
PlanRequesttakesconversation_idandmessage, and the id is forwarded to the weather and events agents. The canary adds a session shape (SESSION_PROBABILITY, default 0.3) with 2 to 4 turns. The weather agent no longer invents aconv_id.execute_toolspans carry the conversation id, so filtering sessions by tool attributes (for example failing tools) finds them.Issues Resolved
Testing
Run locally against the full stack (OpenSearch, Data Prepper, OpenSearch Dashboards 3.9):
strands-travel-planner,strands-weather-agent,strands-events-agentandmcp-server, with one root (POST /plan).execute_toolspan in a session turn carriesgen_ai.conversation.id.chatspans havegen_ai.input.messagesand token usage.fault.weather.type = error: the response is partial; error spans (weather tool, weather request, planner tool, planner root) carry the session id.execute_toolspans carry the conversation id.| where `status.code` = 2finds the session with the failing tool (with its error indicator).strands-*services.Follow-up (not in this PR): publish the Strands image in
publish-images.ymlfor the Helm and CDK demo paths.Check List
--signoff