enhancement(datadog): add support for series V1 API#1646
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15dfdce32d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| fn get_input_separator(&self) -> Option<&'static [u8]> { | ||
| match self.endpoint { | ||
| MetricsEndpoint::SeriesV1 => Some(SERIES_V1_INPUT_SEPARATOR), | ||
| _ => None, |
There was a problem hiding this comment.
Avoid separator framing before V1 payload sizing
When a V1 series payload is near the size limit, RequestBuilder::encode_inner writes get_input_separator() before it encodes and checks the next metric's size; if that next metric does not fit, the caller flushes the current payload with the separator already written, producing invalid JSON like {"series":[...,]}. This only affects the new /api/v1/series path when an uncompressed/compressed limit forces a flush, so the intake can reject otherwise valid batches.
Useful? React with 👍 / 👎.
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (35)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
Binary Size Analysis (Agent Data Plane)Target: f0a3687 (baseline) vs 915a0ce (comparison) diff
|
| Module | File Size | Symbols |
|---|---|---|
core |
-32.05 KiB | 1149 |
hyper_util |
+30.07 KiB | 10 |
hyper |
-27.39 KiB | 54 |
saluki_components::sources::otlp |
+19.00 KiB | 21 |
serde_core |
+17.96 KiB | 81 |
otlp_protos::otlp_include::opentelemetry |
-14.09 KiB | 120 |
&mut serde_json |
-11.91 KiB | 22 |
saluki_components::encoders::datadog |
+11.00 KiB | 65 |
serde_json |
+11.00 KiB | 30 |
prost |
+5.05 KiB | 210 |
tracing |
-4.80 KiB | 12 |
http_serde_ext |
+4.39 KiB | 10 |
h2 |
+4.38 KiB | 18 |
saluki_components::common::otlp |
-4.12 KiB | 20 |
tokio_util |
-4.08 KiB | 13 |
saluki_components::forwarders::otlp |
-4.02 KiB | 2 |
serde_with |
-3.96 KiB | 17 |
bytes |
+3.50 KiB | 16 |
[sections] |
-3.44 KiB | 8 |
anon.b68d523c8f9846ca5abc69776e187519.172.llvm.15111859790713813982 |
+3.33 KiB | 1 |
Detailed Symbol Changes
FILE SIZE VM SIZE
-------------- --------------
[NEW] +18.6Ki [NEW] +18.4Ki _<hyper_util::server::conn::auto::Connection<I,S,E> as core::future::future::Future>::poll::h12ac62a4f3751e08
[NEW] +16.6Ki [NEW] +16.5Ki saluki_components::sources::otlp::metrics::runtime_metrics::RUNTIME_METRICS_MAPPINGS::_{{closure}}::h2b0da789c4758ba5
[NEW] +12.8Ki [NEW] +12.5Ki _<saluki_components::encoders::datadog::metrics::MetricsEndpointEncoder as saluki_components::common::datadog::request_builder::EndpointEncoder>::encode::h0640d48f94042929
+560% +11.1Ki +616% +11.1Ki _<saluki_components::sources::otlp::logs::translator::OtlpLogsTranslator as core::iter::traits::iterator::Iterator>::next::h3860cbd002a9a1e5
[NEW] +8.66Ki [NEW] +8.45Ki _<saluki_components::encoders::datadog::metrics::DatadogMetrics as saluki_core::components::encoders::Encoder>::run::_{{closure}}::haf5e4300c95fc2ba
[NEW] +7.82Ki [NEW] +7.68Ki _<serde_json::de::SeqAccess<R> as serde_core::de::SeqAccess>::next_element_seed::h7d6778903c1cffa1
[NEW] +6.37Ki [NEW] +6.21Ki _<&mut serde_json::de::Deserializer<R> as serde_core::de::Deserializer>::deserialize_struct::h5d239f11fa000628
[NEW] +5.87Ki [NEW] +5.72Ki _<serde_json::de::SeqAccess<R> as serde_core::de::SeqAccess>::next_element_seed::he3e2d75eb3b074cf
[NEW] +5.52Ki [NEW] +5.22Ki alloc::collections::btree::node::Handle<alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Mut,K,V,alloc::collections::btree::node::marker::Leaf>,alloc::collections::btree::node::marker::Edge>::insert_recursing::h1670df83829822a4
[NEW] +4.56Ki [NEW] +4.26Ki alloc::collections::btree::node::Handle<alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Mut,K,V,alloc::collections::btree::node::marker::Leaf>,alloc::collections::btree::node::marker::Edge>::insert_recursing::h6aebd6eb2cbb16d7
-86.0% -4.92Ki -87.6% -4.92Ki alloc::collections::btree::map::BTreeMap<K,V,A>::insert::ha8d583a1d0509c7d
[DEL] -6.11Ki [DEL] -5.90Ki _<saluki_components::encoders::datadog::metrics::MetricsEndpointEncoder as saluki_components::common::datadog::request_builder::EndpointEncoder>::encode::hdf591e762d8c7e54
[DEL] -6.13Ki [DEL] -5.97Ki _<&mut serde_json::de::Deserializer<R> as serde_core::de::Deserializer>::deserialize_struct::heb60545e81a9a584
[DEL] -6.56Ki [DEL] -6.41Ki _<core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize::h59296b5c732c0ed1
[DEL] -8.12Ki [DEL] -7.95Ki _<&mut serde_json::de::Deserializer<R> as serde_core::de::Deserializer>::deserialize_struct::h296a1abeac8594b2
[DEL] -8.78Ki [DEL] -8.58Ki _<saluki_components::encoders::datadog::metrics::DatadogMetrics as saluki_core::components::encoders::Encoder>::run::_{{closure}}::h4044b9be0d8340aa
[DEL] -9.42Ki [DEL] -9.29Ki _<core::pin::Pin<P> as core::future::future::Future>::poll::h8bf635c589f5ae5d
[DEL] -9.90Ki [DEL] -9.75Ki _<hyper::proto::h2::server::Server<T,S,B,E> as core::future::future::Future>::poll::h6e574e2a45576f6a
-0.1% -6.90Ki -0.2% -10.5Ki [6118 Others]
[DEL] -10.9Ki [DEL] -10.8Ki saluki_components::sources::otlp::logs::transform::transform_log_record::hefcb9c2341939142
-99.2% -16.6Ki -99.7% -16.6Ki core::ops::function::FnOnce::call_once::hf0d23ad91433eeed
+0.0% +3.55Ki -0.0% -632 TOTAL
## Summary This PR adds support for sending series metrics to the legacy series V1 API for Datadog destinations. Prior to this, we only supported the series V2 API, the newer, Protocol Buffers-based API which superseded the old V1 API. Well... we want to allow using ADP in more configurations, and some customers still use the series V1 API, so here we are. :) This PR implements support for the series V1 API, which is kind of self-evident, but we've made the following changes: - updated the existing Datadog Metrics encoder to support both series API versions (mutually exclusive) based on the configuration of `use_v2_api.series` - updated the configuration registry to account for `use_v2_api.series`, and update our supportability status for it - added a few unit tests, and a new correctness test, to assert that we're doing series V1 correctly I also made three small changes to the correctness tooling outside of adding series V1 support: - `make test-correctness-case` runs with `--no-tui` now so that you can actually see all of the failing assertions (if any); no need for the TUI if you're just running a single case, really - added detection of diagnose-related requests for the two series API endpoints in `datadog-intake`: DDA will send dummy payloads when trying to hit those endpoints during diagnose/connectivity check runs... so now we directly detect them and log them as such to avoid having spurious failure messages in the `datadog-intake` logs - added normalization of the various ways we propagate the "host" value in different metrics output formats such that it makes it into the `stele` normalized metric as a tag, such that we can ensure we're properly comparing whatever the generated host value is, whether it's a tag or specialized field ## Change Type - [ ] Bug fix - [x] New feature - [ ] Non-functional (chore, refactoring, docs) - [ ] Performance ## How did you test this PR? - [x] Existing unit/correctness tests. - [x] Added a new correctness test (`dsd-v1-api-series`) that runs in series V1 mode. ## References DADP-72 Closes #1641, #1642 Co-authored-by: toby.lawrence <toby.lawrence@datadoghq.com> d92149c
Add a `focus_metrics` field to the correctness test config that, when non-empty, replaces the standard internal-telemetry filter with an allowlist. Only metrics whose names appear in the list are kept for comparison; everything else (including other `datadog.*` metrics and all user DSD traffic) is discarded. This enables correctness tests that validate specific agent-emitted metrics such as `datadog.agent.point.sent` and `datadog.agent.point.dropped`, which would otherwise be stripped by the default filter. Also fix a test reference to `MetricsEndpoint::Series` that was renamed to `MetricsEndpoint::SeriesV1` in #1646.
Add a `focus_metrics` field to the correctness test config that, when non-empty, replaces the standard internal-telemetry filter with an allowlist. Only metrics whose names appear in the list are kept for comparison; everything else (including other `datadog.*` metrics and all user DSD traffic) is discarded. This enables correctness tests that validate specific agent-emitted metrics such as `datadog.agent.point.sent` and `datadog.agent.point.dropped`, which would otherwise be stripped by the default filter. Also fix a test reference to `MetricsEndpoint::Series` that was renamed to `MetricsEndpoint::SeriesV1` in #1646.
Summary
This PR adds support for sending series metrics to the legacy series V1 API for Datadog destinations.
Prior to this, we only supported the series V2 API, the newer, Protocol Buffers-based API which superseded the old V1 API. Well... we want to allow using ADP in more configurations, and some customers still use the series V1 API, so here we are. :)
This PR implements support for the series V1 API, which is kind of self-evident, but we've made the following changes:
use_v2_api.seriesuse_v2_api.series, and update our supportability status for itI also made three small changes to the correctness tooling outside of adding series V1 support:
make test-correctness-caseruns with--no-tuinow so that you can actually see all of the failing assertions (if any); no need for the TUI if you're just running a single case, reallydatadog-intake: DDA will send dummy payloads when trying to hit those endpoints during diagnose/connectivity check runs... so now we directly detect them and log them as such to avoid having spurious failure messages in thedatadog-intakelogsstelenormalized metric as a tag, such that we can ensure we're properly comparing whatever the generated host value is, whether it's a tag or specialized fieldChange Type
How did you test this PR?
dsd-v1-api-series) that runs in series V1 mode.References
DADP-72
Closes #1641, #1642