Configuration
Core Parameters
Your Datadog API key. This is required for authentication.Store this in an environment variable for security.
The Datadog site to send data to. Choose based on your account region:
datadoghq.com: US1 (default)datadoghq.eu: EU (Europe)us3.datadoghq.com: US3us5.datadoghq.com: US5ap1.datadoghq.com: AP1 (Asia Pacific)ddog-gov.com: US1-FED (Government)
Custom endpoint URL. Overrides the
site setting.Useful for proxying or testing.Logs Configuration
For sending logs to Datadog:Datadog Agent Compatibility
When enabled, normalizes events to conform to Datadog Agent standard and sends with the
DD-PROTOCOL: agent-json header.Enable this if you want Vector to behave like the Datadog Agent.Compression
Compression algorithm for reducing payload size. Options:
zstd: Zstandard compression (recommended, default)gzip: Gzip compressionnone: No compression
Batching
Datadog has specific limits for the Logs API:- Maximum payload size: 5MB (uncompressed)
- Maximum events per batch: 1000
- Recommended batch goal: ~4.25MB
Maximum number of events per batch. Cannot exceed 1000 for Datadog.
Maximum batch size in bytes (uncompressed). Kept under 5MB API limit.
Maximum time to wait before flushing a partial batch.
Encoding
Configure how events are encoded before sending to Datadog.
Request Configuration
HTTP request timeout in seconds.
Maximum number of requests per time window.
Number of retry attempts for failed requests.
Custom HTTP headers to include in requests.
TLS Configuration
Enable TLS/SSL connections. Required for Datadog.
Path to CA certificate file.
Datadog Event Fields
Datadog expects specific fields in log events. Vector automatically maps common fields:| Vector Field | Datadog Field | Description |
|---|---|---|
message | message | Log message text |
timestamp | timestamp | Event timestamp |
host | host | Hostname |
service | service | Service name |
source | source | Log source |
severity | status | Log level/severity |
trace_id | trace_id | Distributed trace ID |
Complete Examples
Basic Logs Configuration
EU Region with Custom Encoding
Agent-Compatible Configuration
High-Throughput Configuration
Multi-Region Setup
Metrics Sink
For sending metrics to Datadog:Traces Sink
For sending traces to Datadog:Troubleshooting
Authentication Errors
If you see 403 Forbidden errors:- Verify API key is correct
- Check API key has necessary permissions
- Ensure you’re using the correct Datadog site
- Verify the key hasn’t been revoked
Payload Too Large
If you see 413 errors:- Reduce
batch.max_bytesbelow 4.25MB - Reduce
batch.max_eventsbelow 1000 - Enable or increase compression
- Check for extremely large individual events
High Latency
To reduce latency:- Decrease
batch.timeout_secs(trade-off: more API calls) - Enable
compression = "zstd"for faster network transfer - Increase
request.tower.concurrencyfor more parallel requests - Choose a Datadog site closer to your infrastructure
Rate Limiting
If hitting rate limits:- Increase
batch.timeout_secsto send fewer requests - Increase
batch.max_eventsto pack more data per request - Reduce
request.tower.rate_limit_num - Contact Datadog support for higher limits
Best Practices
- Use environment variables for API keys
- Enable compression (
zstdrecommended) to reduce costs and improve performance - Choose the correct site matching your Datadog account region
- Set appropriate batch sizes to balance latency and throughput
- Use structured logging with standard field names
- Add service and source tags for better organization in Datadog
- Monitor Vector metrics to track delivery success
- Use
conforms_as_agent = trueif migrating from Datadog Agent - Configure retries for reliability
- Test with small batches before scaling up
Field Mapping
To ensure proper field mapping in Datadog:Monitoring
Monitor your Datadog sink with Vector’s internal metrics:component_sent_events_total{sink="datadog_logs"}: Events successfully sentcomponent_sent_event_bytes_total{sink="datadog_logs"}: Bytes sentcomponent_errors_total{sink="datadog_logs"}: Errors encounteredcomponent_discarded_events_total{sink="datadog_logs"}: Events dropped