AMAZON BEDROCK / SERVICE DETAIL S08 OBSERVABILITY
AGENTCORE OBSERVABILITYPRACTICAL
CHAPTER 20 / 36
TOPIC turn on tracing, then watch your agent
REV 2026.07
IN PLAIN WORDS
You will do a one-time account setup so traces show up, then either let AgentCore record everything automatically (if your agent runs on Runtime) or add a small library if it runs elsewhere, and view it all on the CloudWatch dashboard. Terms: Transaction Search = the CloudWatch feature that stores spans and traces; ADOT = AWS's OpenTelemetry library; span = one step; trace = one request.
[ 1 ] ONE TIME PER ACCOUNT, TURN ON TRANSACTION SEARCH
IN THE CONSOLE
1. Open CloudWatch.
2. Application Signals (APM) > Transaction search.
3. Choose Enable Transaction Search.
4. Tick ingest spans as structured logs, then Save.
# or with the AWS CLI:
$ aws xray update-trace-segment-destination \
--destination CloudWatchLogs
# (also add a one-time resource policy so X-Ray
# can write spans to CloudWatch Logs)
Spans appear in the aws/spans log group. After enabling, allow about 10 minutes before traces are searchable.
[ 2 ] IF YOUR AGENT RUNS ON RUNTIME, IT IS AUTOMATIC
$ agentcore deploy # the CLI instruments your agent for you
$ agentcore invoke
$ agentcore logs # stream the agent's logs
$ agentcore traces list # list recent traces
# then open: CloudWatch console > GenAI Observability (Agents / Sessions / Traces)
[ 3 ] IF YOUR AGENT RUNS ELSEWHERE, ADD ADOT
# requirements.txt
aws-opentelemetry-distro>=0.10.0
boto3
# environment variables
AGENT_OBSERVABILITY_ENABLED=true
OTEL_PYTHON_DISTRO=aws_distro
OTEL_PYTHON_CONFIGURATOR=aws_configurator
OTEL_RESOURCE_ATTRIBUTES=service.name=<agent-name>
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_TRACES_EXPORTER=otlp
RUN IT
$ opentelemetry-instrument python agent.py
The opentelemetry-instrument wrapper loads the settings, records the model and tool calls, and sends them to CloudWatch under your service.name. View it on the same GenAI dashboard.
To send the data to your own tools instead of CloudWatch, set DISABLE_ADOT_OBSERVABILITY=true. To tie traces to one conversation, set the session id in OpenTelemetry baggage: baggage.set_baggage("session.id", session_id).