
Observability with Google Cloud Trace¶
This guide shows you how to set up Google Cloud Trace to add observability to your agents. With observability enabled, you can track agent execution latency and view distributed traces in the Google Cloud Console.
Before starting this guide make sure to follow the Quickstart Guide to have your First Agent running on Idun Agent Platform.
Setting Up Observability¶
Step 1: Prepare Google Cloud Project¶
- Ensure you have a Google Cloud Project created.
- Enable the Cloud Trace API in your project.
- Ensure the environment where your agent is running has credentials with permissions to write traces (e.g.,
Cloud Trace Agentrole).- If running on Google Cloud (Cloud Run, GKE, Compute Engine), the default service account usually works if scopes are set.
- If running locally or elsewhere, ensure
GOOGLE_APPLICATION_CREDENTIALSis set or default credentials are configured.
Step 2: Navigate to Observability Configuration¶
- On Idun Agent Platform main page, navigate to Observability
- Go to Add configuration
- Select GCP Trace
- Enter a Configuration Name (e.g., "GCP Trace Prod")
- Fill in the required details:
- Project ID: Your Google Cloud Project ID (e.g.,
my-project-123) - Region: (Optional) Specific region if applicable
- Trace Name: (Optional) Name for the trace session
- Sampling Rate: A number between 0.0 and 1.0 (e.g.,
1.0for 100% sampling) - Flush Interval: Time in seconds to wait before sending traces (default
5) - Ignore URLs: (Optional) Paths to exclude from tracing
- Project ID: Your Google Cloud Project ID (e.g.,
- Finnaly, click Create configuration

Step 3: Add GCP Trace observability to your agent¶
- Navigate to your agent you want to trace
- Click Edit Agent
- Click Next to go to the observability config
- Select GCP Trace in observability
- Click on the configuration you just created.
- Click Next
- Finnalize with Save changes
Finnaly, on your agent page, click đŸ”„Restart to reload the agent configuration.
Viewing Observability Data¶
Once your agent is running with observability enabled:
- Interact with your agent
- Go to the Google Cloud Console
- Navigate to Trace -> Trace List
You will see the traces generated by your agent's execution, allowing you to analyze latency and performance bottlenecks.

Best Practices¶
- Adjust Sampling Rate: For high-traffic agents, lower the sampling rate to reduce costs and noise.
- Use meaningful Trace Names: Helps in filtering traces in the GCP Console.
Troubleshooting¶
Traces not showing up?¶
- Check API: Is the Cloud Trace API enabled in your project?
- Check Permissions: Does the agent's service account have
Cloud Trace Agentrole? - Wait for flush: Traces are sent in batches; wait a few seconds (based on flush interval) after execution.