Skip to main content
This guide shows you how to configure the Datadog Logs plugin for AI Studio. After setting up this plugin, AI Studio forwards a log event to Datadog for every LLM request. Each log event includes:
  • Model and routing metadata: The model used and the API route that handled the request
  • Token usage: Prompt tokens, completion tokens, and total tokens consumed per request
  • Performance data: Success/failure status, latency, and error details when applicable
  • Cost: Per-request spend attributed to the organization and model
  • Prompt and response content: The full prompt and completion text, when available
If content masking is enabled in event logs, prompts and responses forwarded to Datadog are also masked.
Datadog Logs plugin example in Live tail logs.

Set up the Datadog Logs plugin

Configure the Datadog Logs plugin in AI Studio under Plugins.

Obtain your Datadog API key

Before configuring the plugin in AI Studio, locate your API key in Datadog:
  1. Log in to your Datadog account
  2. Navigate to Organization SettingsAPI Keys
  3. Copy an existing API key or create a new one
For more information on obtaining a Datadog API key, see Datadog API keys documentation.

Identify your Datadog site region

Determine which Datadog site your organization uses. The Site hostname value controls which regional endpoint receives your logs.
RegionSite hostname valueLocation
US1 (default)datadoghq.comUS
US3us3.datadoghq.comUS
US5us5.datadoghq.comUS
EUdatadoghq.euEU (Germany)
For more information on Datadog regions, see Datadog regions documentation.

Optional: Configure tags

Tags can be a standalone value or a key:value pair that Datadog attaches to your log events for filtering, aggregating, and grouping logs in dashboards, monitors, and alerts. The following table shows common tag examples:
TagPurpose
env:prodIdentifies the deployment environment
instance:i-1234567890abcdef0Identifies a specific host or instance
name:example-nameLabels the resource by name
managedIdentifies logs from managed services
writerGroups all Writer-related log events
For more information on tagging requirements and strategies, see the Datadog tagging documentation.

Configure the plugin in AI Studio

After obtaining your API key and identifying your site region:
  1. Navigate to AI Studio
  2. Open the Datadog Logs plugin configuration
  3. Enter your configuration values:
FieldDescriptionExample
Service nameA stable, human-readable identifier for the service emitting logs. Maps to the reserved service attribute in the log payload. Datadog uses this to group logs and correlate with APM traces.writer-agent, writer-ai-studio
Site hostnameThe Datadog regional intake endpoint. See supported regions.datadoghq.com
(Optional) TagsA list of key:value tags applied to every log event. Sent as the reserved ddtags attribute in the log payload. See configure tags.env:prod, team:platform, component:ai-studio
API keyYour Datadog API key. See obtain your API key.Your API key from Datadog
  1. Select Save to activate the plugin
Datadog Logs plugin configuration in AI Studio. After saving, AI Studio begins forwarding log events to Datadog. Open the Datadog Logs Explorer to verify that events are arriving, then build dashboards, monitors, and alerts around the data.

Next steps