-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NDM][NDMII-2748] test snmp tags on agent restart #26003
Conversation
pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go
Outdated
Show resolved
Hide resolved
Regression DetectorRegression Detector ResultsRun ID: 8b342fca-5016-43a0-8974-69dbe3ddb794 Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | basic_py_check | % cpu utilization | +2.26 | [-0.52, +5.03] |
➖ | pycheck_1000_100byte_tags | % cpu utilization | +0.62 | [-3.99, +5.23] |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | +0.34 | [-2.55, +3.22] |
➖ | idle | memory utilization | +0.18 | [+0.14, +0.22] |
➖ | otel_to_otel_logs | ingress throughput | +0.02 | [-0.34, +0.38] |
➖ | trace_agent_json | ingress throughput | +0.00 | [-0.01, +0.01] |
➖ | trace_agent_msgpack | ingress throughput | +0.00 | [-0.00, +0.00] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.01 | [-0.04, +0.03] |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.01 | [-0.21, +0.19] |
➖ | file_tree | memory utilization | -0.77 | [-0.88, -0.66] |
➖ | tcp_syslog_to_blackhole | ingress throughput | -3.19 | [-24.12, +17.75] |
Explanation
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
5e1c2ea
to
69c9d21
Compare
[Fast Unit Tests Report] On pipeline 35364259 (CI Visibility). The following jobs did not run any unit tests: Jobs:
If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-developer-experience |
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=35364259 --os-family=ubuntu |
@@ -322,3 +322,12 @@ new-e2e-ndm-netflow: | |||
variables: | |||
TARGETS: ./tests/ndm/netflow | |||
TEAM: network-device-monitoring | |||
|
|||
new-e2e-ndm-snmp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 praise
@@ -4,4 +4,4 @@ init_config: | |||
instances: | |||
- ip_address: dd-snmp | |||
port: 1161 | |||
community_string: "public" | |||
community_string: "cisco-nexus" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥜 nitpick
You could update the config file name accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed b80d861
require.NoError(s.T(), err) | ||
|
||
initialTags := initialMetrics[0].Tags | ||
_, err = s.Env().RemoteHost.Execute("docker stop dd-snmp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion
Should be possible to run the request using the Docker client in
Docker *components.RemoteHostDocker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be tested:
// stop
s.Env().Docker.GetClient().ContainerStop(context.Background(), "dd-snmp", container.StopOptions{})
// restart
s.Env().Docker.GetClient().ContainerRestart(context.Background(), s.Env().Agent.ContainerName, container.StopOptions{})
But I think you need to get the ID from the container name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked and indeed you would need to get the container ID, will create a card to provide this through the Docker
client, we can generate a list of container ids by their name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I tried before to get the list of container ids filtered by the name and then get the first one from the list but it is maybe easier like this
initialMetrics, err := fakeintake.FilterMetrics("snmp.device.reachable", | ||
client.WithTags[*aggregator.MetricSeries]([]string{}), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options
are optional.
An empty list of filtering tags should be equivalent to not specifying any list of filtering tags at all.
initialMetrics, err := fakeintake.FilterMetrics("snmp.device.reachable", | |
client.WithTags[*aggregator.MetricSeries]([]string{}), | |
) | |
initialMetrics, err := fakeintake.FilterMetrics("snmp.device.reachable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 45ae6cc
metrics, err = fakeintake.FilterMetrics("snmp.device.reachable", | ||
client.WithTags[*aggregator.MetricSeries]([]string{}), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark as above.
metrics, err = fakeintake.FilterMetrics("snmp.device.reachable", | |
client.WithTags[*aggregator.MetricSeries]([]string{}), | |
) | |
metrics, err = fakeintake.FilterMetrics("snmp.device.reachable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 45ae6cc
|
||
func (s *snmpDockerSuite) TestSnmpTagsAreStoredOnRestart() { | ||
fakeintake := s.Env().FakeIntake.Client() | ||
initialMetrics, err := fakeintake.FilterMetrics("snmp.device.reachable", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be safe from potentially flaky test failures I think FIlterMetrics() should be inside an EventuallyWithT().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed d8de7c0
also changed in that commit the require
to assert
to prevent the test from failing if the fakeintake responds an error
|
||
require.Zero(s.T(), metrics[0].Points[0].Value) | ||
require.ElementsMatch(s.T(), tags, initialTags) | ||
require.Len(s.T(), tags, 9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing this check since the number of tags could change and it probably doesn't check anything beyond what was already checked by the previous ElementsMatch().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed 45ae6cc
_, err = s.Env().RemoteHost.Execute("docker stop dd-snmp") | ||
require.NoError(s.T(), err) | ||
|
||
err = fakeintake.FlushServerAndResetAggregators() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed both before and after the agent restart?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the first one ! 45ae6cc
|
||
require.EventuallyWithT(s.T(), func(t *assert.CollectT) { | ||
initialMetrics, err = fakeintake.FilterMetrics("snmp.device.reachable") | ||
assert.NoError(s.T(), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the whole TestSnmpTagsAreStoredOnRestart
test fail instead of retrying inside the EventuallyWithT
block.
We need to target the CollectT
of the EventuallyWithT
function.
assert.NoError(s.T(), err) | |
assert.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 0cbe423
/merge |
🚂 MergeQueue Pull request added to the queue. This build is going to start soon! (estimated merge in less than 28m) Use |
What does this PR do?
Add an e2e following this PR
It tests that tags are stored on disk and so are still there after a restart of the agent
Motivation
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes