datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[NCM] Add scaffolding for network device config component

Open zoedt opened this issue 5 months ago • 9 comments

What does this PR do?

Adding preliminary component to support Network Configuration Monitoring (NCM) which will provide the ability to retrieve network device configurations given a specific device to pull it from (connecting via SSH/Telnet utilizing CLI commands specific to vendors supporting the devices)

No functionality is yet added, the intention for this PR is to get more familiar slowly with the agent component framework and have more digestible PRs along the way for fellow teammates (and myself) that may be unfamiliar and reviewing :-)

Motivation

Describe how you validated your changes

No QA quite yet as this component or its logic is not being utilized anywhere else in the agent quite yet. Additional steps will be taken to test the implementation and mocks as functionality is added.

Possible Drawbacks / Trade-offs

Additional Notes

zoedt avatar Jun 16 '25 18:06 zoedt

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 868c594f-5968-4a11-9744-1372592bcdde

Baseline: e4ae4ffaa2a5c8e870d420e4954d36c1750b8c29 Comparison: 26b20f33f1ede8004a59468f75625ae98ef8ef01 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 +1.79 [-1.30, +4.88] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +1.79 [-1.30, +4.88] 1 Logs
quality_gate_logs % cpu utilization +1.38 [-1.39, +4.16] 1 Logs bounds checks dashboard
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.37 [+0.32, +0.41] 1 Logs
quality_gate_idle_all_features memory utilization +0.31 [+0.19, +0.42] 1 Logs bounds checks dashboard
otlp_ingest_logs memory utilization +0.25 [+0.13, +0.37] 1 Logs
quality_gate_idle memory utilization +0.19 [+0.12, +0.25] 1 Logs bounds checks dashboard
file_to_blackhole_0ms_latency egress throughput +0.08 [-0.49, +0.65] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.04 [-0.02, +0.11] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.01 [-0.25, +0.26] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.02] 1 Logs
otlp_ingest_metrics memory utilization -0.02 [-0.16, +0.13] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.02 [-0.64, +0.60] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.03 [-0.64, +0.58] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.08 [-0.65, +0.50] 1 Logs
ddot_metrics memory utilization -0.11 [-0.22, +0.01] 1 Logs
file_tree memory utilization -0.28 [-0.33, -0.24] 1 Logs
ddot_logs memory utilization -0.70 [-0.78, -0.61] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization -1.27 [-2.12, -0.43] 1 Logs
docker_containers_memory memory utilization -1.66 [-1.79, -1.53] 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

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 intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, 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_logs, bounds check memory_usage: 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.

cit-pr-commenter[bot] avatar Jun 16 '25 19:06 cit-pr-commenter[bot]

Static quality checks

✅ Please find below the results from static quality gates Comparison made with ancestor 6e0308730826b182592199229349c1e466384457

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${0}$$ $${702.69}$$ < $${703.45}$$ $${+0.03}$$ $${177.39}$$ < $${178.35}$$
agent_deb_amd64_fips $${0}$$ $${700.94}$$ < $${701.7}$$ $${+0}$$ $${176.76}$$ < $${177.76}$$
agent_heroku_amd64 $${0}$$ $${354.36}$$ < $${355.37}$$ $${+0.01}$$ $${94.76}$$ < $${95.72}$$
agent_msi $${0}$$ $${977.17}$$ < $${978.18}$$ $${+0}$$ $${148.45}$$ < $${149.26}$$
agent_rpm_amd64 $${0}$$ $${702.68}$$ < $${703.44}$$ $${+0.04}$$ $${178.93}$$ < $${179.87}$$
agent_rpm_amd64_fips $${0}$$ $${700.93}$$ < $${701.69}$$ $${-0}$$ $${178.53}$$ < $${179.47}$$
agent_rpm_arm64 $${0}$$ $${692.7}$$ < $${693.48}$$ $${+0.03}$$ $${162.65}$$ < $${163.62}$$
agent_rpm_arm64_fips $${0}$$ $${691.02}$$ < $${691.79}$$ $${-0.01}$$ $${161.7}$$ < $${162.65}$$
agent_suse_amd64 $${0}$$ $${702.68}$$ < $${703.44}$$ $${+0.04}$$ $${178.93}$$ < $${179.87}$$
agent_suse_amd64_fips $${0}$$ $${700.93}$$ < $${701.69}$$ $${-0}$$ $${178.53}$$ < $${179.47}$$
agent_suse_arm64 $${0}$$ $${692.7}$$ < $${693.48}$$ $${+0.03}$$ $${162.65}$$ < $${163.62}$$
agent_suse_arm64_fips $${0}$$ $${691.02}$$ < $${691.79}$$ $${-0.01}$$ $${161.7}$$ < $${162.65}$$
docker_agent_amd64 $${-0}$$ $${786.5}$$ < $${787.26}$$ $${-0}$$ $${270.59}$$ < $${271.51}$$
docker_agent_arm64 $${-0}$$ $${799.97}$$ < $${800.74}$$ $${-0}$$ $${258.32}$$ < $${259.24}$$
docker_agent_jmx_amd64 $${+0}$$ $${977.69}$$ < $${978.45}$$ $${+0}$$ $${339.56}$$ < $${340.47}$$
docker_agent_jmx_arm64 $${+0}$$ $${979.76}$$ < $${980.54}$$ $${+0.01}$$ $${323.28}$$ < $${324.2}$$
docker_cluster_agent_amd64 $${-0}$$ $${213.72}$$ < $${214.5}$$ $${+0}$$ $${72.63}$$ < $${73.51}$$
docker_cluster_agent_arm64 $${+0}$$ $${229.5}$$ < $${230.33}$$ $${+0}$$ $${68.9}$$ < $${69.77}$$
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}$$ $${39.24}$$ < $${39.57}$$ $${-0}$$ $${15.12}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${-0}$$ $${37.88}$$ < $${38.2}$$ $${-0}$$ $${14.55}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${+0.01}$$ $${8.01}$$ < $${8.95}$$
dogstatsd_deb_arm64 $${0}$$ $${29.01}$$ < $${29.97}$$ $${+0}$$ $${6.95}$$ < $${7.89}$$
dogstatsd_rpm_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${-0}$$ $${8.01}$$ < $${8.96}$$
dogstatsd_suse_amd64 $${0}$$ $${30.45}$$ < $${31.4}$$ $${-0}$$ $${8.01}$$ < $${8.96}$$
iot_agent_deb_amd64 $${0}$$ $${53.88}$$ < $${54.55}$$ $${+0}$$ $${13.58}$$ < $${14.45}$$
iot_agent_deb_arm64 $${0}$$ $${51.21}$$ < $${51.9}$$ $${+0}$$ $${11.75}$$ < $${12.63}$$
iot_agent_deb_armhf $${0}$$ $${50.72}$$ < $${51.42}$$ $${-0.01}$$ $${11.85}$$ < $${12.74}$$
iot_agent_rpm_amd64 $${0}$$ $${53.88}$$ < $${54.55}$$ $${+0}$$ $${13.6}$$ < $${14.47}$$
iot_agent_rpm_arm64 $${0}$$ $${51.21}$$ < $${51.91}$$ $${+0}$$ $${11.77}$$ < $${12.65}$$
iot_agent_suse_amd64 $${0}$$ $${53.88}$$ < $${54.55}$$ $${+0}$$ $${13.6}$$ < $${14.47}$$

Where is this component currently used? What is its use case?

jose-manuel-almaza avatar Jun 17 '25 07:06 jose-manuel-almaza

Where is this component currently used? What is its use case?

hiya @jose-manuel-almaza ! the plan is to create an agent check utilizing this logic for the MVP of the feature - we'd iterate on also adding usage with remote config and a listener in the agent, happy to chat on zoom with our team if this needs more discussion!

not sure if the common practice is not to only have noop components but force some functionality first / require usage somewhere else on the agent? just wanted to iterate / stack some PRs if possible and get easier reviews before more gets introduced, happy to follow whatever the standard is! (very noob to these agent components)

zoedt avatar Jun 17 '25 15:06 zoedt

Hey @zoedt

Thanks for adding a new component.

I would say that the PR title and description might be a bit misleading, as the work does not add a noop component; this is more akin to adding the scaffold for the Network Device Config.

It isn't very clear because a component can have multiple implementations, and one of these implementations can be a noop. Example: https://github.com/DataDog/datadog-agent/blob/main/comp/dogstatsd/replay/impl-noop/noop.go#L7

So, looking at your work, it seems that you are planning on evolving the implementation into a working one, not leaving it as a noop. Maybe worth changing the title and description

GustavoCaso avatar Jun 18 '25 07:06 GustavoCaso

What's the point of adding a new component without any functionality? Or maybe your goal is to add functionality incrementally, using this branch as a base for future PRs? Stacked Pull Requests

jose-manuel-almaza avatar Jun 18 '25 08:06 jose-manuel-almaza

@GustavoCaso @jose-manuel-almaza

hiya! yes thank you - i'll rework the title and description, i might've read too quickly through the docs and misinterpreted. this is just stage 1 and i'm already working on a separate branch with the functionality already, i just figured since i'm new to agent components doing it iteratively to make sure i was on the right track and address small questions first would be a good approach

so i'll:

  • [x] rename the PR title and description
  • [x] address comments above for unnecessary comments/removing commented out code for now

if you both recommend that functionality be added first i can try to clean up my approach and update the PR instead to introduce one implementation for the component, lmk your thoughts :-D

zoedt avatar Jun 18 '25 20:06 zoedt

if you both recommend that functionality be added first i can try to clean up my approach and update the PR instead to introduce one implementation for the component, lmk your thoughts :-D

I'm ok with you splitting the work into smaller PRs. I would share the work you are doing on the other branch, that way we would be able to help with any component-related things as well

GustavoCaso avatar Jun 19 '25 07:06 GustavoCaso

I'm ok with you splitting the work into smaller PRs. I would share the work you are doing on the other branch, that way we would be able to help with any component-related things as well

@GustavoCaso yes! i'm working on that follow-up branch right now (sorting out some tests), would it make sense to merge this now even if there's no functionality ready yet but soon to come? i'll be drafting this soon, sometime early next week i think ^^

zoedt avatar Jun 27 '25 15:06 zoedt

@GustavoCaso Follow-up branch drafted here: https://github.com/DataDog/datadog-agent/pull/38444

zoedt avatar Jul 03 '25 15:07 zoedt

/merge

zoedt avatar Jul 15 '25 15:07 zoedt

View all feedbacks in Devflow UI.

2025-07-15 15:52:27 UTC :information_source: Start processing command /merge


2025-07-15 15:52:44 UTC :information_source: MergeQueue: pull request added to the queue

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


2025-07-15 16:26:52 UTC :information_source: MergeQueue: This merge request was merged