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

process-agent: use the new statsd component #21108

Merged
merged 7 commits into from
Dec 12, 2023

Conversation

iksaif
Copy link
Contributor

@iksaif iksaif commented Nov 27, 2023

What does this PR do?

Use use the new statsd component

For now we use the shared factory. We might want to change the component later to provide a pre-configured client later, but this requires more changes.

Motivation

To be sure all agents use STATSD_URL and the same options.

Additional Notes

N/A

Possible Drawbacks / Trade-offs

N/A

Describe how to test/QA your changes

Validate that statsd metrics are still being sent by the process agent
When started and pointed to a validate core agent it should at least datadog.process.agent with a value of 1

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.

For now we use the shared factory. We might want to change the component
later to provide a pre-configured client later, but this requires more
changes.
Copy link

cit-pr-commenter bot commented Nov 27, 2023

Go Package Import Differences

Baseline: cfb86ca
Comparison: b3e8b1c

binaryosarchchange
process-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
process-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
process-agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
process-agentdarwinamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
process-agentdarwinarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
heroku-process-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
system-probelinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
system-probelinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd
system-probewindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/dogstatsd/statsd

@pr-commenter
Copy link

pr-commenter bot commented Nov 27, 2023

Bloop Bleep... Dogbot Here

Regression Detector Results

Run ID: a4ae8baf-23e7-4b67-97b9-b400b5714fdb
Baseline: bd4a9fb
Comparison: 16c9072
Total CPUs: 7

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

  • ✅ denotes better comparison variant performance
  • ❌ denotes worse comparison variant performance

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:

  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".

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

Declared stable experiments that are now erratic

An experiment is erratic (i.e., not stable) if its coefficient of variation is at least 0.10.

perf experiment goal Δ mean % Δ mean % CI confidence
otel_to_otel_logs ingress throughput +0.48 [-0.21, +1.16] 74.28%

Experiments with missing or malformed data

  • idle

Usually, this warning means that there is no usable optimization goal data for that experiment, which could be a result of misconfiguration.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI confidence
otel_to_otel_logs ingress throughput +0.48 [-0.21, +1.16] 74.28%
trace_agent_msgpack ingress throughput +0.00 [-0.00, +0.00] 0.00%
uds_dogstatsd_to_api ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_8MiB_1k ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_64MiB_1k ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_8MiB_10k ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_8MiB_50k ingress throughput +0.00 [-0.00, +0.00] 0.00%
trace_agent_json ingress throughput +0.00 [-0.01, +0.01] 0.00%
dogstatsd_string_interner_64MiB_100 ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_8MiB_100 ingress throughput +0.00 [-0.00, +0.00] 0.00%
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_128MiB_1k ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_128MiB_100 ingress throughput +0.00 [-0.00, +0.00] 0.00%
dogstatsd_string_interner_8MiB_100k ingress throughput -0.00 [-0.04, +0.04] 1.76%
file_tree egress throughput -0.02 [-1.82, +1.78] 1.37%
file_to_blackhole egress throughput -0.07 [-6.23, +6.09] 1.60%
tcp_syslog_to_blackhole ingress throughput -0.09 [-0.16, -0.03] 98.58%

@@ -90,7 +92,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
}

// run starts the main loop.
func run(log log.Component, config config.Component, telemetry telemetry.Component, sysprobeconfig sysprobeconfig.Component, rcclient rcclient.Component, cliParams *cliParams) error {
func run(log log.Component, statsd compstatsd.Component, telemetry telemetry.Component, sysprobeconfig sysprobeconfig.Component, rcclient rcclient.Component, cliParams *cliParams) error {
Copy link
Member

Choose a reason for hiding this comment

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

config.Component is still required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you know how to make the linter happier when modifying this function then? Or do we just ignore it ?

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 use _ config.Component instead of config config.Component

Copy link
Member

@brycekahle brycekahle left a comment

Choose a reason for hiding this comment

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

Please re-add the config.Component argument which was removed

@iksaif
Copy link
Contributor Author

iksaif commented Nov 27, 2023

Please re-add the config.Component argument which was removed

It was removed because unused and creating linter errors.

@brycekahle
Copy link
Member

Please re-add the config.Component argument which was removed

It was removed because unused and creating linter errors.

Please name the argument _ to satisfy the linter. It is necessary to ensure the datadog config is read and parsed.

@iksaif
Copy link
Contributor Author

iksaif commented Dec 4, 2023

The latest commits address your comments, the failing test seems unrelated

Copy link
Contributor

@kkhor-datadog kkhor-datadog left a comment

Choose a reason for hiding this comment

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

Mind elaborating on the QA instructions a little? For the process agent a good metric to check would be datadog.process.agent:

statsd.Client.Gauge("datadog.process.agent", 1, tags, 1) //nolint:errcheck

@iksaif
Copy link
Contributor Author

iksaif commented Dec 5, 2023

Mind elaborating on the QA instructions a little? For the process agent a good metric to check would be datadog.process.agent:

statsd.Client.Gauge("datadog.process.agent", 1, tags, 1) //nolint:errcheck

Good suggestion, is that better? (I've never done QA myself so I'm not sure which amount of details we need to put there)

@iksaif
Copy link
Contributor Author

iksaif commented Dec 7, 2023

re-merged with main, resolved conflicts, and explained why we need a NoopClient{}

@iksaif iksaif merged commit 939b135 into main Dec 12, 2023
147 of 149 checks passed
@iksaif iksaif deleted the corentin.chary/statsd-process-agent branch December 12, 2023 14:48
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.

4 participants