Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/user-guide/observability-evaluation/traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,21 @@ agent = Agent(
system_prompt="You are a helpful AI assistant"
)

# Option 2: Use StrandsTelemetry if you need Strands to set up OpenTelemetry
# Option 2: Use StrandsTelemetry to handle complete OpenTelemetry setup
# (Creates new tracer provider and sets it as global)
from strands.telemetry import StrandsTelemetry

strands_telemetry = StrandsTelemetry()
strands_telemetry.setup_otlp_exporter() # Send traces to OTLP endpoint
strands_telemetry.setup_console_exporter() # Print traces to console

# Option 3: Use StrandsTelemetry with your own tracer provider
# (Keeps your tracer provider, adds Strands exporters without setting global)
from strands.telemetry import StrandsTelemetry

strands_telemetry = StrandsTelemetry(tracer_provider=user_tracer_provider)
strands_telemetry.setup_otlp_exporter().setup_console_exporter() # Chaining supported

# Create agent (tracing will be enabled automatically)
agent = Agent(
model="us.anthropic.claude-3-7-sonnet-20250219-v1:0",
Expand Down