Galileo supports logging traces from Strands Agents SDK applications using OpenTelemetry.Documentation Index
Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Set up OpenTelemetry
To log Strands Agents using Galileo, the first step is to set up OpenTelemetry.Installation
Add the OpenTelemetry packages to your project:The
opentelemetry-api and opentelemetry-sdk packages provide the core OpenTelemetry functionality. The opentelemetry-exporter-otlp package enables sending traces to Galileo’s OTLP endpoint.Create environment variables for your Galileo settings
Set environment variables for your Galileo settings, for example in a
.env file.
These environment variables are consumed by the GalileoSpanProcessorto authenticate
and route traces to the correct Galileo Project and Log stream:Self hosted deployments: Set the OTel endpoint
Skip this step if you are using Galileo Cloud.
-
Galileo Cloud at app.galileo.ai, then you don’t need to provide a custom OTel endpoint.
The default endpoint
https://api.galileo.ai/otel/traceswill be used automatically. -
A self-hosted Galileo deployment, replace the
https://api.galileo.ai/otel/tracesendpoint with your deployment URL. The format of this URL is based on your console URL, replacingconsolewithapiand appending/otel/traces.
- if your console URL is
https://console.galileo.example.com, the OTel endpoint would behttps://api.galileo.example.com/otel/traces - if your console URL is
https://console-galileo.apps.mycompany.com, the OTel endpoint would behttps://api-galileo.apps.mycompany.com/otel/traces
GALILEO_CONSOLE_URL environment variable. For example:Initialize and create the Galileo span processor
The
GalileoSpanProcessor automatically configures authentication
and metadata using your environment variables. It also:- Auto-builds OTLP headers using your Galileo credentials
- Configures the correct OTLP trace endpoint
- Registers a batch span processor that exports traces to Galileo
Log a Strands ADK agent using OpenTelemetry
Once OpenTelemetry is configured, you can use the OTel capabilities of Strands to log traces.Import the Strands Agent telemetry package
The Strands Agents SDK has telemetry support out of the box. Start by importing
StrandsTelemetry with the following code:Opt in to experimental OpenTelemetry semantic conventions
Starting instrands-agents v1.34.0, the Strands Agents SDK can emit generative AI traces using either the legacy OpenTelemetry semantic conventions or the newer experimental conventions:
- Legacy mode (default) — uses attributes such as
gen_ai.systemalong with legacy event shapes. - Experimental mode — follows the latest OpenTelemetry generative AI semantic conventions, using
gen_ai.provider.nameand structuredgen_ai.client.inference.operation.detailsevents that carry inputs, outputs, and system instructions.
OTEL_SEMCONV_STABILITY_OPT_IN is read by the Strands Agents SDK at startup. Make sure it is exported in your process environment (or loaded from your .env file) before StrandsTelemetry is initialized.Full example
Here is a full example based off the Strands Agent quickstart. You can find this project in the Galileo SDK examples repo. To run this example, create a.env file with the following values set, or set them as environment variables:
.env