Skip to content
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

[SNMP] Componentize SNMP traps server #19789

Merged
merged 11 commits into from
Nov 9, 2023
Merged

[SNMP] Componentize SNMP traps server #19789

merged 11 commits into from
Nov 9, 2023

Conversation

dplepage-dd
Copy link
Contributor

What does this PR do?

This PR converts the SNMP traps server into a set of FX components.
The user-facing behavior should not change.

Motivation

We are trying to port all our services to the new component architecture.
This is part of NDMII-287.

Describe how to test/QA your changes

See internal instructions for QAing snmp traps. Existing QA should be fine, as the behavior of the traps listener is not expected to change.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

@dplepage-dd dplepage-dd added this to the Triage milestone Sep 27, 2023
@dplepage-dd dplepage-dd requested review from a team as code owners September 27, 2023 20:37
@dplepage-dd dplepage-dd changed the base branch from dpl/snmp-cleanup to dpl/mock-sender September 27, 2023 21:32
@dplepage-dd dplepage-dd force-pushed the dpl/mock-sender branch 2 times, most recently from f0c67c8 to 687c481 Compare September 28, 2023 21:41
@dplepage-dd dplepage-dd force-pushed the dpl/mock-sender branch 2 times, most recently from 9931f51 to 7ac69d7 Compare October 11, 2023 18:11
@dplepage-dd dplepage-dd force-pushed the dpl/componentize-snmp branch from 24d66ba to 1e72390 Compare October 11, 2023 18:21
@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Oct 11, 2023

Go Package Import Differences

Baseline: e43ee12
Comparison: 1f6aca0

binaryosarchchange
agentlinuxamd64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
agentlinuxarm64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
agentwindowsamd64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
agentwindows386
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
agentdarwinamd64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
agentdarwinarm64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
iot-agentlinuxamd64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
iot-agentlinuxarm64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
heroku-agentlinuxamd64
+17, -9
+github.com/DataDog/datadog-agent/comp/snmptraps
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/config/configimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter
+github.com/DataDog/datadog-agent/comp/snmptraps/formatter/formatterimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder
+github.com/DataDog/datadog-agent/comp/snmptraps/forwarder/forwarderimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/listener
+github.com/DataDog/datadog-agent/comp/snmptraps/listener/listenerimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver
+github.com/DataDog/datadog-agent/comp/snmptraps/oidresolver/oidresolverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/packet
+github.com/DataDog/datadog-agent/comp/snmptraps/server
+github.com/DataDog/datadog-agent/comp/snmptraps/server/serverimpl
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
cluster-agentlinuxamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
cluster-agentlinuxarm64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
cluster-agent-cloudfoundrylinuxamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
cluster-agent-cloudfoundrylinuxarm64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
process-agentlinuxamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
process-agentlinuxarm64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
process-agentwindowsamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
process-agentdarwinamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
process-agentdarwinarm64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
heroku-process-agentlinuxamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
security-agentlinuxamd64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status
security-agentlinuxarm64
+4, -9
+github.com/DataDog/datadog-agent/comp/snmptraps/config
+github.com/DataDog/datadog-agent/comp/snmptraps/snmplog
+github.com/DataDog/datadog-agent/comp/snmptraps/status
+github.com/DataDog/datadog-agent/comp/snmptraps/status/statusimpl
-github.com/DataDog/datadog-agent/pkg/snmp/traps
-github.com/DataDog/datadog-agent/pkg/snmp/traps/config
-github.com/DataDog/datadog-agent/pkg/snmp/traps/formatter
-github.com/DataDog/datadog-agent/pkg/snmp/traps/forwarder
-github.com/DataDog/datadog-agent/pkg/snmp/traps/listener
-github.com/DataDog/datadog-agent/pkg/snmp/traps/oid_resolver
-github.com/DataDog/datadog-agent/pkg/snmp/traps/packet
-github.com/DataDog/datadog-agent/pkg/snmp/traps/snmplog
-github.com/DataDog/datadog-agent/pkg/snmp/traps/status

@dplepage-dd dplepage-dd force-pushed the dpl/componentize-snmp branch from 1e72390 to 8db2658 Compare October 12, 2023 19:53
Base automatically changed from dpl/mock-sender to main October 13, 2023 14:49
@dplepage-dd dplepage-dd force-pushed the dpl/componentize-snmp branch from 5189577 to 57b0cf2 Compare October 13, 2023 14:53
@dplepage-dd dplepage-dd force-pushed the dpl/componentize-snmp branch from 57b0cf2 to 1fd94c6 Compare November 1, 2023 02:57
@pr-commenter
Copy link

pr-commenter bot commented Nov 1, 2023

Bloop Bleep... Dogbot Here

Regression Detector Results

Run ID: 4986105-063b-4ed5-b4ea-bb6d755bdc8c
Baseline: a5ef9a7
Comparison: a3ddef7
Total datadog-agent CPUs: 7

Explanation

A regression test is an integrated performance test for datadog-agent in a repeatable rig, with varying configuration for datadog-agent. What follows is a statistical summary of a brief datadog-agent run for each configuration across SHAs given above. The goal of these tests are to determine quickly if datadog-agent performance is changed and to what degree by a pull request.

Because a target's optimization goal performance in each experiment will vary somewhat each time it is run, we can only estimate mean differences in optimization goal relative to the baseline target. We express these differences as a percentage change relative to the baseline target, denoted "Δ mean %". These estimates are made to a precision that balances accuracy and cost control. We represent this precision as a 90.00% confidence interval denoted "Δ mean % CI": there is a 90.00% chance that the true value of "Δ mean %" is in that interval.

We decide whether a change in performance is a "regression" -- a change worth investigating further -- if both of the following two criteria are true:

  1. The estimated |Δ mean %| ≥ 5.00%. This criterion intends to answer the question "Does the estimated change in mean optimization goal performance have a meaningful impact on your customers?". We assume that when |Δ mean %| < 5.00%, the impact on your customers is not meaningful. We also assume that a performance change in optimization goal is worth investigating whether it is an increase or decrease, so long as the magnitude of the change is sufficiently large.

  2. Zero is not in the 90.00% confidence interval "Δ mean % CI" about "Δ mean %". This statement is equivalent to saying that there is at least a 90.00% chance that the mean difference in optimization goal is not zero. This criterion intends to answer the question, "Is there a statistically significant difference in mean optimization goal performance?". It also means there is no more than a 10.00% chance this criterion reports a statistically significant difference when the true difference in mean optimization goal is zero -- a "false positive". We assume you are willing to accept a 10.00% chance of inaccurately detecting a change in performance when no true difference exists.

The table below, if present, lists those experiments that have experienced a statistically significant change in mean optimization goal performance between baseline and comparison SHAs with 90.00% confidence OR have been detected as newly erratic. Negative values of "Δ mean %" mean that baseline is faster, whereas positive values of "Δ mean %" mean that comparison is faster. Results that do not exhibit more than a ±5.00% change in their mean optimization goal are discarded. An experiment is erratic if its coefficient of variation is greater than 0.1. The abbreviated table will be omitted if no interesting change is observed.

No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%.

Fine details of change detection per experiment.
experiment goal Δ mean % Δ mean % CI confidence
otel_to_otel_logs ingress throughput +2.06 [+0.46, +3.66] 96.63%
file_tree egress throughput +0.02 [-1.81, +1.85] 1.49%
trace_agent_json ingress throughput +0.02 [-0.11, +0.15] 16.78%
dogstatsd_string_interner_8MiB_100k ingress throughput +0.02 [-0.02, +0.06] 52.05%
trace_agent_msgpack ingress throughput +0.02 [-0.11, +0.14] 16.76%
dogstatsd_string_interner_8MiB_10k ingress throughput +0.02 [-0.05, +0.08] 31.45%
uds_dogstatsd_to_api ingress throughput +0.01 [-0.17, +0.19] 8.09%
tcp_dd_logs_filter_exclude ingress throughput +0.01 [-0.07, +0.08] 10.91%
dogstatsd_string_interner_8MiB_100 ingress throughput +0.00 [-0.13, +0.13] 2.81%
dogstatsd_string_interner_64MiB_1k ingress throughput +0.00 [-0.13, +0.13] 1.45%
dogstatsd_string_interner_128MiB_1k ingress throughput +0.00 [-0.14, +0.14] 0.01%
dogstatsd_string_interner_64MiB_100 ingress throughput -0.00 [-0.14, +0.14] 0.03%
dogstatsd_string_interner_128MiB_100 ingress throughput -0.00 [-0.14, +0.14] 0.69%
dogstatsd_string_interner_8MiB_1k ingress throughput -0.01 [-0.11, +0.09] 13.32%
dogstatsd_string_interner_8MiB_50k ingress throughput -0.01 [-0.07, +0.04] 31.76%
idle egress throughput -0.02 [-2.47, +2.42] 1.13%
process_agent_standard_check_with_stats egress throughput -0.10 [-2.11, +1.90] 6.83%
process_agent_standard_check egress throughput -0.13 [-3.66, +3.40] 4.96%
file_to_blackhole egress throughput -0.14 [-0.58, +0.30] 39.48%
process_agent_real_time_mode egress throughput -0.32 [-2.82, +2.18] 16.58%
tcp_syslog_to_blackhole ingress throughput -0.95 [-1.08, -0.82] 100.00%

@@ -250,6 +250,47 @@ supported Datadog intakes.



## [comp/snmptraps](https://pkg.go.dev/github.com/DataDog/dd-agent-comp-experiments/comp/snmptraps) (Component Bundle)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these URLs need to be changed with this PR (not in dd-agent-comp-experiments)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I will fix them in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmw51798 This readme is generated by inv lint-component so changing it is outside the scope of this PR.

Copy link
Contributor

@ogaca-dd ogaca-dd left a comment

Choose a reason for hiding this comment

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

Great PR, just minor comments.

@@ -250,6 +250,47 @@ supported Datadog intakes.



## [comp/snmptraps](https://pkg.go.dev/github.com/DataDog/dd-agent-comp-experiments/comp/snmptraps) (Component Bundle)
Copy link
Contributor

Choose a reason for hiding this comment

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

I will fix them in another PR.

package snmptraps

import (
configimpl "github.com/DataDog/datadog-agent/comp/snmptraps/config/impl"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally package impl should be configimpl to avoid alias. For example see this file

Note: Can be done in a later PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

In cases with mock implementations, would it make more sense for the real implementation and the mock implementation to be separate packages?
E.g. there are two formatter implementations, the JSONFormatter and the DummyFormatter - would it make more sense to have these under e.g. /formatter/json/ and /formatter/mock/ instead of a single formatter/formatterimpl with both implementations in it?

Copy link
Contributor

Choose a reason for hiding this comment

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

The current approach is to used build tags.

}

func TestBundleDependencies(t *testing.T) {
require.NoError(t, fx.ValidateApp(
Copy link
Contributor

Choose a reason for hiding this comment

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

You can simplify the test by using fxutil.TestBundle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

"github.com/DataDog/datadog-agent/comp/core/log"
// Module implements the formatter component.
var Module = fxutil.Component(
fx.Provide(NewJSONFormatter),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can NewJSONFormatter be not exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


// Component is the component type.
type Component interface {
Start()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use Lifecycle hooks instead and not provide this method in the interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// Component is the component type.
type Component interface {
// Start starts the listener
Start() error
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use Lifecycle hooks instead of Start method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

// Start starts the server listening
func (s *Server) Start() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method doesn't have to be exported, ie, start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I actually removed this entirely - the server doesn't do anything now that the forwarder and listener use the lifecycle hooks, it now only exists as something you can inject that will make both the forwarder and the listener start running. But I also made the Start/Stop methods unexported on the forwarder and listener.

}

// Stop stops the TrapServer.
func (s *Server) Stop() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method doesn't have to be exported, ie, stop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// New creates a new manager
func New() Manager {
// New creates a new component
func New() status.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you have a more explicit name and not export the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@dplepage-dd dplepage-dd force-pushed the dpl/componentize-snmp branch from a3ddef7 to 8d7b64c Compare November 8, 2023 19:50
@dplepage-dd
Copy link
Contributor Author

@ogaca-dd I also modified this to depend on demultiplexer.Component instead of sender.Sender. This adds a moderate amount of boilerplate, though, especially in the tests, since the mock demultiplexer also relies on config, and defaultforwarder.

Do you think it would be worth providing the default Sender as a component? Senders aren't singletons in that each check can have its own, but there's always only one "default" one; fx also supports name annotations, so we could specifically provide a sender.Sender named "default" to avoid conflicts.

return nil, err
type dependencies struct {
fx.In
HostnameService hostname.Component `optional:"true"`
Copy link
Contributor

Choose a reason for hiding this comment

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

You should avoid optional as there is no error when there is a missing dependency in hostname.Component .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is deliberate - tests don't need to include the hostname service unless they need to manipulate the hostname in some way. If a test is missing the dependency on hostname.Component, then newMockConfig will use a default hostname.

mockSender.SetupAcceptAll()
return mockSender, mockSender
}),
fx.Decorate(func(demux demultiplexer.Mock, s sender.Sender) demultiplexer.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why using Decorate instead of Provide?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

demultiplexer.MockModule provides both demultiplexer.Mock and demultiplexer.Component, so this has to be Decorate or fx will complain that there are multiple providers for demultiplexer.Component.

@ogaca-dd
Copy link
Contributor

ogaca-dd commented Nov 9, 2023

@ogaca-dd I also modified this to depend on demultiplexer.Component instead of sender.Sender. This adds a moderate amount of boilerplate, though, especially in the tests, since the mock demultiplexer also relies on config, and defaultforwarder.

Do you think it would be worth providing the default Sender as a component? Senders aren't singletons in that each check can have its own, but there's always only one "default" one; fx also supports name annotations, so we could specifically provide a sender.Sender named "default" to avoid conflicts.

I don't think Sender should be a component as it is very easy to get one from demultiplexer.Component.

@dplepage-dd dplepage-dd merged commit 679f6ca into main Nov 9, 2023
7 checks passed
@dplepage-dd dplepage-dd deleted the dpl/componentize-snmp branch November 9, 2023 20:00
bkabrda pushed a commit that referenced this pull request Nov 10, 2023
bkabrda pushed a commit that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants