Learn how to instrument Strands Agents applications with LangWatch.
@langwatch.trace()
decorator:
langwatch.setup()
: Initializes the LangWatch SDK, which includes setting up an OpenTelemetry trace exporter.
StrandsTelemetry().setup_otlp_exporter()
: Configures the Strands Agents telemetry to send traces to LangWatch via OpenTelemetry protocol.
trace_attributes
parameter in the Agent constructor allows you to add metadata that will be included with every trace, such as session IDs, user IDs, and custom tags.
@langwatch.trace()
to add additional context and metadata to your traces, but it’s not required for basic functionality.
strands-agents[otel]
package includes OpenTelemetry support out of the box.trace_attributes
parameter allows you to add consistent metadata to all traces from a specific agent instance.LANGWATCH_API_KEY
is set in the environment.