Skip to content

Conversation

@ajgajg1134
Copy link
Contributor

What does this PR do?

Skip zero value metrics that are rarely used, these metrics provide some debugging value, but don't provide any signal when 0, thus we can stop sending these and reduce the overhead here a small amount. DM me for exact cost calculations

Motivation

Reduce overhead

Describe how you validated your changes

Ran locally and observed these metrics do not appear, but the other ones still do. Also unit tests

Additional Notes

@ajgajg1134 ajgajg1134 requested review from a team as code owners October 16, 2025 20:55
@ajgajg1134 ajgajg1134 added team/agent-apm trace-agent qa/done QA done before merge and regressions are covered by tests labels Oct 16, 2025
@ajgajg1134 ajgajg1134 requested a review from dustmop October 16, 2025 20:55
@github-actions github-actions bot added the medium review PR review might take time label Oct 16, 2025
Copy link

@git-thuerk-done git-thuerk-done left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ajgajg1134 just a small suggestion but approved!

Copy link
Contributor

@dustmop dustmop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with one suggestion

@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Oct 16, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: dfaa6347-ac93-4fd2-912f-469526d68776

Baseline: 18cb39c
Comparison: c80b94b
Diff

Optimization Goals: ❌ Regression(s) detected

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_memory memory utilization +5.98 [+5.53, +6.43] 1 Logs

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +32.20 [+30.07, +34.34] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +32.20 [+30.07, +34.34] 1 Logs
docker_containers_memory memory utilization +5.98 [+5.53, +6.43] 1 Logs
quality_gate_logs % cpu utilization +1.78 [-1.04, +4.61] 1 Logs bounds checks dashboard
ddot_metrics memory utilization +0.74 [+0.57, +0.91] 1 Logs
ddot_logs memory utilization +0.34 [+0.28, +0.40] 1 Logs
otlp_ingest_logs memory utilization +0.28 [+0.15, +0.41] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.21 [+0.17, +0.25] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization +0.19 [-0.01, +0.39] 1 Logs
quality_gate_idle memory utilization +0.18 [+0.12, +0.24] 1 Logs bounds checks dashboard
file_to_blackhole_500ms_latency egress throughput +0.09 [-0.52, +0.70] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.07 [-0.53, +0.66] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.00 [-0.61, +0.61] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.25, +0.23] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.02 [-0.62, +0.59] 1 Logs
ddot_metrics_sum_cumulative memory utilization -0.10 [-0.23, +0.02] 1 Logs
ddot_metrics_sum_delta memory utilization -0.14 [-0.28, +0.01] 1 Logs
file_tree memory utilization -0.20 [-0.24, -0.16] 1 Logs
tcp_syslog_to_blackhole ingress throughput -0.35 [-0.42, -0.28] 1 Logs
quality_gate_idle_all_features memory utilization -0.48 [-0.52, -0.43] 1 Logs bounds checks dashboard
otlp_ingest_metrics memory utilization -0.84 [-0.97, -0.71] 1 Logs
quality_gate_metrics_logs memory utilization -1.77 [-1.95, -1.58] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Oct 16, 2025

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 18cb39c

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0}$$ $${674.74}$$ < $${702.15}$$ $${-0.03}$$ $${164.63}$$ < $${177.79}$$
agent_deb_amd64_fips $${+0}$$ $${669.25}$$ < $${696.65}$$ $${+0.07}$$ $${163.9}$$ < $${176.53}$$
agent_heroku_amd64 $${0}$$ $${336.55}$$ < $${340.18}$$ $${-0.01}$$ $${89.82}$$ < $${91.08}$$
agent_msi $${+0.01}$$ $${1013.56}$$ < $${1015.38}$$ $${+0.02}$$ $${148.41}$$ < $${150.78}$$
agent_rpm_amd64 $${+0}$$ $${674.73}$$ < $${702.14}$$ $${-0.02}$$ $${166.95}$$ < $${180.53}$$
agent_rpm_amd64_fips $${+0}$$ $${669.24}$$ < $${696.64}$$ $${+0.02}$$ $${165.55}$$ < $${178.79}$$
agent_rpm_arm64 $${+0}$$ $${664.33}$$ < $${686.31}$$ $${+0}$$ $${153.22}$$ < $${161.22}$$
agent_rpm_arm64_fips $${+0}$$ $${659.85}$$ < $${681.84}$$ $${+0.04}$$ $${152.74}$$ < $${160.18}$$
agent_suse_amd64 $${+0}$$ $${674.73}$$ < $${702.14}$$ $${-0.02}$$ $${166.95}$$ < $${180.53}$$
agent_suse_amd64_fips $${+0}$$ $${669.24}$$ < $${696.64}$$ $${+0.02}$$ $${165.55}$$ < $${178.79}$$
agent_suse_arm64 $${+0}$$ $${664.33}$$ < $${686.31}$$ $${+0}$$ $${153.22}$$ < $${161.22}$$
agent_suse_arm64_fips $${+0}$$ $${659.85}$$ < $${681.84}$$ $${+0.04}$$ $${152.74}$$ < $${160.18}$$
docker_agent_amd64 $${+0}$$ $${746.17}$$ < $${773.59}$$ $${+0}$$ $${251.8}$$ < $${266.06}$$
docker_agent_arm64 $${+0}$$ $${759.72}$$ < $${781.7}$$ $${+0}$$ $${242.42}$$ < $${251.85}$$
docker_agent_jmx_amd64 $${+0}$$ $${937.04}$$ < $${964.45}$$ $${-0}$$ $${320.42}$$ < $${334.68}$$
docker_agent_jmx_arm64 $${+0}$$ $${939.19}$$ < $${961.17}$$ $${-0}$$ $${307.01}$$ < $${316.44}$$
docker_cluster_agent_amd64 $${-0}$$ $${213.01}$$ < $${213.74}$$ $${-0}$$ $${72.26}$$ < $${73.14}$$
docker_cluster_agent_arm64 $${-0}$$ $${228.92}$$ < $${229.68}$$ $${+0}$$ $${68.54}$$ < $${69.41}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.07}$$ < $${7.12}$$ $${+0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${-0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${+0}$$ $${38.44}$$ < $${39.3}$$ $${-0}$$ $${14.84}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${0}$$ $${37.13}$$ < $${37.94}$$ $${+0}$$ $${14.29}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${29.66}$$ < $${30.53}$$ $${-0}$$ $${7.82}$$ < $${8.75}$$
dogstatsd_deb_arm64 $${0}$$ $${28.24}$$ < $${29.11}$$ $${+0}$$ $${6.77}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${29.66}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.76}$$
dogstatsd_suse_amd64 $${0}$$ $${29.66}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.76}$$
iot_agent_deb_amd64 $${0}$$ $${41.89}$$ < $${54.97}$$ $${-0}$$ $${10.9}$$ < $${14.45}$$
iot_agent_deb_arm64 $${0}$$ $${39.71}$$ < $${51.9}$$ $${-0}$$ $${9.41}$$ < $${12.63}$$
iot_agent_deb_armhf $${0}$$ $${39.58}$$ < $${51.84}$$ $${+0}$$ $${9.49}$$ < $${12.74}$$
iot_agent_rpm_amd64 $${0}$$ $${41.89}$$ < $${54.97}$$ $${+0}$$ $${10.91}$$ < $${14.47}$$
iot_agent_suse_amd64 $${0}$$ $${41.89}$$ < $${54.97}$$ $${+0}$$ $${10.91}$$ < $${14.47}$$

@github-actions
Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between d54f5f9 and 0247ee2.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats

@ajgajg1134 ajgajg1134 changed the title Reduce apm internal metrics overhead Reduce apm internal metrics overhead (CSI-1279) Oct 22, 2025
@ajgajg1134
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Oct 22, 2025

View all feedbacks in Devflow UI.

2025-10-22 19:45:13 UTC ℹ️ Start processing command /merge


2025-10-22 19:45:19 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 40m (p90).


2025-10-22 20:14:11 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 2bd5404 into main Oct 22, 2025
277 checks passed
@dd-mergequeue dd-mergequeue bot deleted the andrew.glaude/metricsSavings branch October 22, 2025 20:14
@github-actions github-actions bot added this to the 7.73.0 milestone Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/agent-apm trace-agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants