8000
Skip to content

[NDMII-3574] Update NDM autodiscovery Digest#39459

Merged
dd-mergequeue[bot] merged 18 commits intomainfrom
pierre.lin/update-autodiscovery-digest
Aug 6, 2025
Merged

[NDMII-3574] Update NDM autodiscovery Digest#39459
dd-mergequeue[bot] merged 18 commits intomainfrom
pierre.lin/update-autodiscovery-digest

Conversation

@Pierre-L42
Copy link
Copy Markdown
Member
@Pierre-L42 Pierre-L42 commented Aug 1, 2025

What does this PR do?

This PR updates the autodiscovery Digest function by adding a parameter that specifies whether to calculate the hash based on the authentications config or based on the old config used to authenticate to a device.
We still need to support old hash because it is used to compute the name of autodiscovery cache file. So we can migrate to the new hash by renaming the file with old hash when we detect it.

Changed the autodiscovery status code to make it not depend on Digest function by using a subnetIndex to sort subnets.

Motivation

https://dd.slack.com/archives/C07RHJTEFRD/p1754039311773789

Describe how you validated your changes

Tested on Mimic:

  • Tested that the cache with old hash format is renamed with the new hash format.
  • Tested that authentications config works again.
  • Tested that configs without authentications still work.

Possible Drawbacks / Trade-offs

Additional Notes

@Pierre-L42 Pierre-L42 added the changelog/no-changelog No changelog entry needed label Aug 1, 2025
@github-actions github-actions bot added medium review PR review might take time team/ndm-core labels Aug 1, 2025
@cit-pr-commenter
Copy link
Copy Markdown
cit-pr-commenter bot commented Aug 1, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 3e6eded8-874a-4a0f-9eed-dbf0f4c0e377

Baseline: 50e9a44
Comparison: 429b026
Diff

Optimization Goals: ✅ No significant changes detected

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 -0.48 [-3.61, +2.65] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +3.31 [+0.51, +6.12] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization +0.93 [+0.54, +1.31] 1 Logs bounds checks dashboard
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.46 [+0.42, +0.50] 1 Logs
quality_gate_idle memory utilization +0.32 [+0.29, +0.35] 1 Logs bounds checks dashboard
file_tree memory utilization +0.21 [+0.18, +0.25] 1 Logs
otlp_ingest_logs memory utilization +0.11 [-0.02, +0.23] 1 Logs
ddot_logs memory utilization +0.05 [-0.04, +0.14] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.56, +0.57] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.00 [-0.61, +0.62] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.02, +0.02] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.00 [-0.53, +0.52] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.31, +0.29] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.04 [-0.67, +0.59] 1 Logs
quality_gate_idle_all_features memory utilization -0.07 [-0.11, -0.04] 1 Logs bounds checks dashboard
otlp_ingest_metrics memory utilization -0.08 [-0.23, +0.06] 1 Logs
ddot_metrics memory utilization -0.37 [-0.49, -0.26] 1 Logs
docker_containers_cpu % cpu utilization -0.48 [-3.61, +2.65] 1 Logs
docker_containers_memory memory utilization -0.58 [-0.62, -0.53] 1 Logs
tcp_syslog_to_blackhole ingress throughput -2.41 [-2.54, -2.27] 1 Logs

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_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_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 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 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 cpu_usage: 10/10 replicas passed. Gate 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.

@Pierre-L42 Pierre-L42 added the qa/done QA done before merge and regressions are covered by tests label Aug 4, 2025
@agent-platform-auto-pr
Copy link
Copy Markdown
Contributor
agent-platform-auto-pr bot commented Aug 4, 2025

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 50e9a44

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 DataNotFound $${699.69}$$ < $${704.84}$$ DataNotFound $${177.16}$$ < $${178.58}$$
agent_deb_amd64_fips DataNotFound $${697.94}$$ < $${703.09}$$ DataNotFound $${176.52}$$ < $${178.12}$$
agent_heroku_amd64 DataNotFound $${349.5}$$ < $${355.37}$$ DataNotFound $${93.65}$$ < $${95.72}$$
agent_msi DataNotFound $${973.96}$$ < $${980.61}$$ DataNotFound $${147.12}$$ < $${149.31}$$
agent_rpm_amd64 DataNotFound $${699.68}$$ < $${704.83}$$ DataNotFound $${178.78}$$ < $${180.22}$$
agent_rpm_amd64_fips DataNotFound $${697.93}$$ < $${703.08}$$ DataNotFound $${178.39}$$ < $${179.85}$$
agent_rpm_arm64 DataNotFound $${688.6}$$ < $${694.74}$$ DataNotFound $${161.78}$$ < $${163.96}$$
agent_rpm_arm64_fips DataNotFound $${686.91}$$ < $${693.05}$$ DataNotFound $${160.8}$$ < $${163.0}$$
agent_suse_amd64 DataNotFound $${699.68}$$ < $${704.83}$$ DataNotFound $${178.78}$$ < $${180.22}$$
agent_suse_amd64_fips DataNotFound $${697.93}$$ < $${703.08}$$ DataNotFound $${178.39}$$ < $${179.85}$$
agent_suse_arm64 DataNotFound $${688.6}$$ < $${694.74}$$ DataNotFound $${161.78}$$ < $${163.96}$$
agent_suse_arm64_fips DataNotFound $${686.91}$$ < $${693.05}$$ DataNotFound $${160.8}$$ < $${163.0}$$
docker_agent_amd64 DataNotFound $${781.67}$$ < $${788.65}$$ DataNotFound $${269.35}$$ < $${272.01}$$
docker_agent_arm64 DataNotFound $${793.92}$$ < $${802.0}$$ DataNotFound $${256.17}$$ < $${259.7}$$
docker_agent_jmx_amd64 DataNotFound $${972.97}$$ < $${979.84}$$ DataNotFound $${338.39}$$ < $${340.95}$$
docker_agent_jmx_arm64 DataNotFound $${973.82}$$ < $${981.8}$$ DataNotFound $${321.17}$$ < $${324.65}$$
docker_cluster_agent_amd64 DataNotFound $${214.26}$$ < $${214.5}$$ DataNotFound $${72.84}$$ < $${73.51}$$
docker_cluster_agent_arm64 DataNotFound $${230.07}$$ < $${230.33}$$ DataNotFound $${69.06}$$ < $${69.77}$$
docker_cws_instrumentation_amd64 DataNotFound $${7.07}$$ < $${7.12}$$ DataNotFound $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 DataNotFound $${6.69}$$ < $${6.92}$$ DataNotFound $${2.71}$$ < $${3.07}$$
docker_dogstatsd_amd64 DataNotFound $${38.7}$$ < $${39.57}$$ DataNotFound $${14.94}$$ < $${15.76}$$
docker_dogstatsd_arm64 DataNotFound $${37.36}$$ < $${38.2}$$ DataNotFound $${14.38}$$ < $${14.83}$$
dogstatsd_deb_amd64 DataNotFound $${29.93}$$ < $${31.4}$$ DataNotFound $${7.88}$$ < $${8.95}$$
dogstatsd_deb_arm64 DataNotFound $${28.51}$$ < $${29.97}$$ DataNotFound $${6.84}$$ < $${7.89}$$
dogstatsd_rpm_amd64 DataNotFound $${29.93}$$ < $${31.4}$$ DataNotFound $${7.89}$$ < $${8.96}$$
dogstatsd_suse_amd64 DataNotFound $${29.93}$$ < $${31.4}$$ DataNotFound $${7.89}$$ < $${8.96}$$
iot_agent_deb_amd64 DataNotFound $${54.3}$$ < $${54.55}$$ DataNotFound $${13.67}$$ < $${14.45}$$
iot_agent_deb_arm64 DataNotFound $${51.61}$$ < $${51.9}$$ DataNotFound $${11.84}$$ < $${12.63}$$
iot_agent_deb_armhf DataNotFound $${51.14}$$ < $${51.42}$$ DataNotFound $${11.91}$$ < $${12.74}$$
iot_agent_rpm_amd64 DataNotFound $${54.3}$$ < $${54.55}$$ DataNotFound $${13.69}$$ < $${14.47}$$
iot_agent_rpm_arm64 DataNotFound $${51.14}$$ < $${51.91}$$ DataNotFound $${11.92}$$ < $${12.65}$$
iot_agent_suse_amd64 DataNotFound $${54.3}$$ < $${54.55}$$ DataNotFound $${13.69}$$ < $${14.47}$$

@Pierre-L42 Pierre-L42 marked this pull request as ready for review August 5, 2025 10:47
@Pierre-L42 Pierre-L42 requested review from a team as code owners August 5, 2025 10:47
Copy link
Copy Markdown
Contributor
@TCheruy TCheruy left a comment

Choose a reason for hiding this comment

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

LGTM! Small nit

pkg/snmp/snmp.go Outdated
// Digest returns an hash value representing the data stored in this configuration, minus the network address
func (c *Config) Digest(address string) string {
// TODO: Remove support for legacy format when Agent reaches version 7.76+: see https://github.com/DataDog/datadog-agent/pull/39459
func (c *Config) Digest(address string, useLegacyFormat bool) string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For readability, I think it would be better to have two separate functions: Digest and LegacyDigest. We'll have some code duplication but i think its ok here

}

deviceInfo := l.checkDeviceInfo(authentication, job.subnet.config.Port, deviceIP)
l.createService(entityID, job.subnet, deviceIP, deviceInfo, authIndex, true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for doing these small code improvements, this is great!

@Pierre-L42
Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown
dd-devflow-routing-codex bot commented Aug 6, 2025

View all feedbacks in Devflow UI.

2025-08-06 22:16:47 UTC ℹ️ Start processing command /merge


2025-08-06 22:16:53 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-08-06 22:35:42 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 974d6ac into main Aug 6, 2025
263 checks passed
@dd-mergequeue dd-mergequeue bot deleted the pierre.lin/update-autodiscovery-digest branch August 6, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/ndm-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0