Configuration
v1 Config Fields
Used with DDStream (v1 GET timeseries). All fields map directly to
DDStreamConfig in the C++ API.
| Field | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Datadog API key (required) |
app_key | string | — | Datadog Application key (required) |
query | string | — | Datadog metric query, e.g. avg:system.cpu.user{*} |
range_start | int64_t | — | Start of time range, Unix epoch seconds |
range_end | int64_t | — | End of time range, Unix epoch seconds |
chunk_seconds | int64_t | 14400 | Window size per HTTP request (4 hours) |
granularity | int32_t | 60 | Metric interval in seconds |
connect_timeout_ms | int32_t | 5000 | TCP connection timeout in milliseconds |
request_timeout_ms | int32_t | 30000 | Full HTTP request timeout in milliseconds |
max_retries | int32_t | 3 | Maximum retries for 429/5xx responses |
point_reserve | int32_t | 50000 | Pre-allocated points per batch buffer |
enable_prefetch | bool | true | Background-thread prefetch of the next chunk |
enable_arrow | bool | false | Return Arrow RecordBatch from C API instead of DataPoint[] |
log_level | LogLevel | NONE | 0=NONE 1=ERROR 2=WARN 3=INFO 4=DEBUG |
v2 Config Fields
Used with DDStreamV2Timeseries and DDStreamV2Scalar. The v2 config accepts
multiple named queries and optional formula expressions.
| Field | Type | Default | Description |
|---|---|---|---|
api_key | string | — | Datadog API key (required) |
app_key | string | — | Datadog Application key (required) |
site | string | datadoghq.com | Datadog site, e.g. datadoghq.eu |
range_start | int64_t | — | Start of time range, Unix epoch seconds |
range_end | int64_t | — | End of time range, Unix epoch seconds |
chunk_seconds | int64_t | 14400 | Window size per HTTP request |
interval_ms | int64_t | 60000 | Metric granularity in milliseconds |
queries | V2Query[] | — | Named query variables, e.g. [{name:"q0", query:"avg:..."}] |
formulas | V2Formula[] | [] | Optional formula expressions combining query variables |
connect_timeout_ms | int32_t | 5000 | TCP connection timeout in milliseconds |
request_timeout_ms | int32_t | 30000 | Full HTTP request timeout in milliseconds |
max_retries | int32_t | 3 | Maximum retries for 429/5xx responses |
enable_prefetch | bool | true | Background-thread prefetch of the next chunk |
log_level | int32_t | 0 | 0=NONE 1=ERROR 2=WARN 3=INFO 4=DEBUG |
Chunk Size Guide
The default chunk_seconds=14400 (4 hours) works well for 1-minute granularity.
Larger chunks reduce HTTP overhead; smaller chunks reduce memory usage. Use this
table as a starting point:
| Granularity | Points per chunk | Recommended chunk_seconds |
|---|---|---|
| 60 s (1 min) | 240 | 14400 (4 h) - default |
| 300 s (5 min) | 48 | 86400 (24 h) |
| 3600 s (1 h) | 4 | 604800 (7 days) |
| Custom | chunk_seconds / granularity | Target 100–5000 points per request |
If you see HTTP 400 or 503 errors, reduce chunk_seconds.
If you see many small batches with fast processing, increase it to reduce overhead.
