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

[OTEL-2309] Fix panic in /otel-agent -h #32711

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Conversation

songy23
Copy link
Member

@songy23 songy23 commented Jan 6, 2025

What does this PR do?

Fix a panic when running ./otel-agent -h.

Motivation

The help command in otel-agent will print out help message of env vars, if there are env vars with no help message it returns flag.ErrHelp. Previously flag.ErrHelp leads to panic, now it is ignored.

Describe how you validated your changes

Built and ran otel-agent locally:

before the change, panic:

% ./bin/otel-agent/otel-agent -h
Usage:
  -config --config=file:/path/to/first --config=file:path/to/second
    	[CONFIG] Locations to the config file(s), note that only a single location can be set per flag entry e.g. --config=file:/path/to/first --config=file:path/to/second.
...
  -sync-to duration
    	[DD_SYNC_TO] Timeout for config sync requests. (default 3s)
panic: flag: help requested

goroutine 1 [running]:
github.com/DataDog/datadog-agent/cmd/otel-agent/command.makeCommands(0x14001a79b90)
	/Users/yang.song/dd/datadog-agent/cmd/otel-agent/command/command.go:77 +0x44c
github.com/DataDog/datadog-agent/cmd/otel-agent/command.MakeRootCommand(...)
	/Users/yang.song/dd/datadog-agent/cmd/otel-agent/command/command.go:42
main.main()
	/Users/yang.song/dd/datadog-agent/cmd/otel-agent/main.go:22 +0x84

after the change, no panic:

% ./bin/otel-agent/otel-agent -h
Usage:
  -config --config=file:/path/to/first --config=file:path/to/second
    	[CONFIG] Locations to the config file(s), note that only a single location can be set per flag entry e.g. --config=file:/path/to/first --config=file:path/to/second.
...
      --sync-to duration                                                   Timeout for config sync requests. (default 3s)

Use "otel-agent [command] --help" for more information about a command.

@songy23 songy23 added changelog/no-changelog team/opentelemetry OpenTelemetry team qa/done QA done before merge and regressions are covered by tests labels Jan 6, 2025
@songy23 songy23 added this to the 7.63.0 milestone Jan 6, 2025
@songy23 songy23 requested a review from a team as a code owner January 6, 2025 20:50
@songy23 songy23 requested a review from liustanley January 6, 2025 20:50
@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Jan 6, 2025
@agent-platform-auto-pr
Copy link
Contributor

Uncompressed package size comparison

Comparison with ancestor 5001b1918581599fd499ee15c64d7738f2580fa2

Diff per package
package diff status size ancestor threshold
datadog-agent-amd64-deb 0.00MB 1011.32MB 1011.32MB 140.00MB
datadog-agent-x86_64-rpm 0.00MB 1020.63MB 1020.63MB 140.00MB
datadog-agent-x86_64-suse 0.00MB 1020.63MB 1020.63MB 140.00MB
datadog-agent-arm64-deb 0.00MB 940.67MB 940.67MB 140.00MB
datadog-agent-aarch64-rpm 0.00MB 949.97MB 949.97MB 140.00MB
datadog-dogstatsd-amd64-deb 0.00MB 58.61MB 58.61MB 10.00MB
datadog-dogstatsd-x86_64-rpm 0.00MB 58.69MB 58.69MB 10.00MB
datadog-dogstatsd-x86_64-suse 0.00MB 58.69MB 58.69MB 10.00MB
datadog-dogstatsd-arm64-deb 0.00MB 56.13MB 56.13MB 10.00MB
datadog-heroku-agent-amd64-deb 0.00MB 506.13MB 506.13MB 70.00MB
datadog-iot-agent-amd64-deb 0.00MB 113.80MB 113.80MB 10.00MB
datadog-iot-agent-x86_64-rpm 0.00MB 113.87MB 113.87MB 10.00MB
datadog-iot-agent-x86_64-suse 0.00MB 113.87MB 113.87MB 10.00MB
datadog-iot-agent-arm64-deb 0.00MB 109.24MB 109.24MB 10.00MB
datadog-iot-agent-aarch64-rpm 0.00MB 109.31MB 109.31MB 10.00MB

Decision

✅ Passed

@agent-platform-auto-pr
Copy link
Contributor

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=52275132 --os-family=ubuntu

Note: This applies to commit a35aac3

@agent-platform-auto-pr
Copy link
Contributor

[Fast Unit Tests Report]

On pipeline 52275132 (CI Visibility). The following jobs did not run any unit tests:

Jobs:
  • tests_flavor_dogstatsd_deb-x64

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-devx-help

Copy link

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: d5370c9c-6f78-4bd2-94c3-c36b63735676

Baseline: 5001b19
Comparison: a35aac3
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
tcp_syslog_to_blackhole ingress throughput +0.85 [+0.77, +0.92] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.15 [-0.52, +0.83] 1 Logs
quality_gate_idle_all_features memory utilization +0.15 [+0.07, +0.24] 1 Logs bounds checks dashboard
file_to_blackhole_500ms_latency egress throughput +0.07 [-0.72, +0.86] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.05 [-0.73, +0.82] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.04 [-0.76, +0.84] 1 Logs
file_tree memory utilization +0.02 [-0.11, +0.15] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.02 [-0.85, +0.89] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.65, +0.67] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.01 [-0.11, +0.13] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.02, +0.01] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.01 [-0.65, +0.63] 1 Logs
quality_gate_idle memory utilization -0.06 [-0.10, -0.02] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency egress throughput -0.11 [-0.89, +0.66] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.11 [-0.58, +0.35] 1 Logs
quality_gate_logs % cpu utilization -0.58 [-3.79, +2.64] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load 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_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_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 memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

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

@songy23
Copy link
Member Author

songy23 commented Jan 7, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 7, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-07 16:01:55 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 36m.


2025-01-07 16:39:38 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 44411ed into main Jan 7, 2025
256 of 261 checks passed
@dd-mergequeue dd-mergequeue bot deleted the yang.song/OTEL-2309 branch January 7, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog qa/done QA done before merge and regressions are covered by tests short review PR is simple enough to be reviewed quickly team/opentelemetry OpenTelemetry team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants