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

[CWS] pass the missing logs compression component to the direct sender #33462

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

paulcacheux
Copy link
Contributor

@paulcacheux paulcacheux commented Jan 28, 2025

What does this PR do?

In direct sender mode, we found the following stack trace

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x260f1d4]
goroutine 1 [running]:
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.getStrategy(0xc000b42690](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.getStrategy(0xc000b42690), 0xc000b42700, 0xc001315dc0, 0xc0040d5e60, 0x0, 0x0, {0x6805ad8, 0xc0042836e0}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/pipeline.go:175 +0x74
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.NewPipeline(0xc001315ab0](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.NewPipeline(0xc001315ab0), {0x0, 0x0, 0x0}, 0xc0040d5e60, 0xc0040f8460, {0x67e04c0, 0x8af4b00}, 0x0, 0x0, ...)
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/pipeline.go:84 +0x2d2
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.(*provider).Start(0xc003ff26c0)](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.(*provider).Start(0xc003ff26c0))
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/provider.go:135 +0x168
[github.com/DataDog/datadog-agent/pkg/security/reporter.newReporter({0x0](http://github.com/DataDog/datadog-agent/pkg/security/reporter.newReporter(%7B0x0), 0x0}, {0x67ee678, 0xc000c24618}, {0x3345ba2, 0x16}, {0x332a679, 0x10}, 0xc0040d5e60, 0xc0040f8460, ...)
	/home/spi/dd/datadog-agent2/pkg/security/reporter/reporter.go:57 +0x2e5
[github.com/DataDog/datadog-agent/pkg/security/reporter.NewCWSReporter(...)](http://github.com/DataDog/datadog-agent/pkg/security/reporter.NewCWSReporter(...))
	/home/spi/dd/datadog-agent2/pkg/security/reporter/reporter.go:46
[github.com/DataDog/datadog-agent/pkg/security/module.NewDirectMsgSender({0x67ee678](http://github.com/DataDog/datadog-agent/pkg/security/module.NewDirectMsgSender(%7B0x67ee678), 0xc000c24618}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/msg_sender.go:90 +0x1e7
[github.com/DataDog/datadog-agent/pkg/security/module.NewAPIServer(0xc00037a008](http://github.com/DataDog/datadog-agent/pkg/security/module.NewAPIServer(0xc00037a008), 0xc000861908, {0x0, 0x0}, {0x682a8b0, 0xc000246380}, 0xc0029a6630, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/server.go:597 +0x2a7
[github.com/DataDog/datadog-agent/pkg/security/module.NewCWSConsumer(0xc00075f050](http://github.com/DataDog/datadog-agent/pkg/security/module.NewCWSConsumer(0xc00075f050), 0xc00037a008, {0x6834280, 0xc0002fbc30}, {{0x0?, 0x0?}, {0x0?, 0x0?}}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/cws.go:88 +0x2dc
[github.com/DataDog/datadog-agent/cmd/system-probe/modules.createEventMonitorModule(0x434bcb](http://github.com/DataDog/datadog-agent/cmd/system-probe/modules.createEventMonitorModule(0x434bcb)?, {{{}}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6828540, 0xc000c25a70}, {0x0, 0x0}})
	/home/spi/dd/datadog-agent2/cmd/system-probe/modules/eventmonitor.go:56 +0x2ab
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register.func1()](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register.func1())
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:90 +0xab
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule.func1({0x6802a58](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule.func1(%7B0x6802a58)?, 0xc0009cf2f0?})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:59 +0x13
runtime/pprof.Do({0x68027f0?, 0x8af4b00?}, {{0xc0010e28a0?, 0x8584300?, 0x32faa28?}}, 0xc0014068e0)
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/runtime/pprof/runtime.go:51 +0x8c
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule({0x331bf73](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule(%7B0x331bf73)?, 0xc000bf8f40?}, 0xc001406a88)
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:58 +0x1a8
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register(0xc0005b1480](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register(0xc0005b1480), 0xc00085cb40, {0x8298980?, 0xc000bf22c8?, 0x27b9592?}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6828540, ...})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:84 +0x512
[github.com/DataDog/datadog-agent/cmd/system-probe/api.StartServer(0xc0005b1480](http://github.com/DataDog/datadog-agent/cmd/system-probe/api.StartServer(0xc0005b1480), {0x6828540, 0xc000c25a70}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6816fb8, 0xc0007f5f40})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/server.go:41 +0x16f
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.startSystemProbe({0x6821580](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.startSystemProbe(%7B0x6821580), 0xc0001334d8}, {0x6802e10, 0xc000c25a28}, {0x6828540, 0xc000c25a70}, {0x683f6c0, 0xc000a42000}, {0x67eb930, 0xc0008374d0}, ...)
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:383 +0x6a5
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.run({0x6821580](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.run(%7B0x6821580), 0xc0001334d8}, {0xc000cae780?, 0xc001406f28?}, {0x6802e10, 0xc000c25a28}, {0x6828540, 0xc000c25a70}, {0x683f6c0, 0xc000a42000}, ...)
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:197 +0x2d5
reflect.Value.call({0x2f865a0?, 0x647e3c0?, 0xc0014074d0?}, {0x32f8b29, 0x4}, {0xc0010a5d40, 0xc, 0x67d7240?})
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:581 +0xca6
reflect.Value.Call({0x2f865a0?, 0x647e3c0?, 0x8af4b00?}, {0xc0010a5d40?, 0x0?, 0x8c1b60?})
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:365 +0xb9
[github.com/DataDog/datadog-agent/pkg/util/fxutil.(*delayedFxInvocation).call(0xc000000180?)](http://github.com/DataDog/datadog-agent/pkg/util/fxutil.(*delayedFxInvocation).call(0xc000000180?))
	/home/spi/dd/datadog-agent2/pkg/util/fxutil/args.go:72 +0x8e
[github.com/DataDog/datadog-agent/pkg/util/fxutil.OneShot({0x2f865a0](http://github.com/DataDog/datadog-agent/pkg/util/fxutil.OneShot(%7B0x2f865a0)?, 0x647e3c0?}, {0xc0004934a0, 0x15, 0x15})
	/home/spi/dd/datadog-agent2/pkg/util/fxutil/oneshot.go:54 +0x305
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.Commands.func1(0xc0006b2400](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.Commands.func1(0xc0006b2400)?, {0x32f89b1?, 0x4?, 0x32f8a9d?})
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:94 +0x1018
[github.com/spf13/cobra.(*Command).execute(0xc000313508](http://github.com/spf13/cobra.(*Command).execute(0xc000313508), {0x8af4b00, 0x0, 0x0})
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
[github.com/spf13/cobra.(*Command).ExecuteC(0xc000313208)](http://github.com/spf13/cobra.(*Command).ExecuteC(0xc000313208))
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
[github.com/spf13/cobra.(*Command).Execute(...)](http://github.com/spf13/cobra.(*Command).Execute(...))
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
[github.com/DataDog/datadog-agent/cmd/internal/runcmd.Run(0xc000313208)](http://github.com/DataDog/datadog-agent/cmd/internal/runcmd.Run(0xc000313208))
	/home/spi/dd/datadog-agent2/cmd/internal/runcmd/runcmd.go:26 +0x25
main.main()
	/home/spi/dd/datadog-agent2/cmd/system-probe/main.go:22 +0x85

caused by a nil compressor component. This was caused by #27148 that added the need for this component when talking with logs, but the compressor component was not passed down to the CWS consumer.

This PR fixes this.

Motivation

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

@paulcacheux paulcacheux added changelog/no-changelog qa/done QA done before merge and regressions are covered by tests backport/7.63.x Automatically create a backport PR to 7.63.x labels Jan 28, 2025
Copy link

cit-pr-commenter bot commented Jan 28, 2025

Go Package Import Differences

Baseline: e97a3a0
Comparison: 3545ce6

binaryosarchchange
system-probelinuxamd64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector
system-probelinuxarm64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector
system-probewindowsamd64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector

@paulcacheux paulcacheux marked this pull request as ready for review January 28, 2025 10:34
@paulcacheux paulcacheux requested review from a team as code owners January 28, 2025 10:34
@paulcacheux paulcacheux force-pushed the paulcacheux/fix-direct-sender-compression branch from 32fd185 to 3545ce6 Compare January 28, 2025 10:34
@paulcacheux
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 28, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-28 10:44:15 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-01-28 11:26:09 UTC ℹ️ MergeQueue: merge request added to the queue

The median merge time in main is 27m.


2025-01-28 11:58:22 UTC ℹ️ MergeQueue: This merge request was merged

@agent-platform-auto-pr
Copy link
Contributor

Uncompressed package size comparison

Comparison with ancestor e97a3a04ff17452c0a5d3f84a49f317d3ba59d21

Diff per package
package diff status size ancestor threshold
datadog-agent-x86_64-rpm 0.04MB ⚠️ 938.69MB 938.65MB 0.50MB
datadog-agent-x86_64-suse 0.04MB ⚠️ 938.69MB 938.65MB 0.50MB
datadog-agent-amd64-deb 0.04MB ⚠️ 928.95MB 928.91MB 0.50MB
datadog-agent-aarch64-rpm 0.03MB ⚠️ 925.84MB 925.81MB 0.50MB
datadog-agent-arm64-deb 0.03MB ⚠️ 916.12MB 916.09MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 59.01MB 59.01MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 59.09MB 59.09MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 59.09MB 59.09MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 56.50MB 56.50MB 0.50MB
datadog-heroku-agent-amd64-deb 0.00MB 477.88MB 477.88MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 93.87MB 93.87MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 93.94MB 93.94MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 93.94MB 93.94MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 89.93MB 89.93MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 90.00MB 90.00MB 0.50MB

Decision

⚠️ Warning

@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=54168398 --os-family=ubuntu

Note: This applies to commit 3545ce6

Copy link

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 275baf0c-1a98-484b-9158-37c78672f1f3

Baseline: e97a3a0
Comparison: 3545ce6
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +1.42 [+0.55, +2.29] 1 Logs
quality_gate_idle memory utilization +0.48 [+0.44, +0.53] 1 Logs bounds checks dashboard
file_to_blackhole_100ms_latency egress throughput +0.04 [-0.67, +0.75] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.00 [-0.79, +0.79] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.02, +0.02] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.28, +0.27] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.02 [-0.66, +0.63] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.09 [-1.00, +0.83] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput -0.10 [-1.00, +0.79] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput -0.11 [-1.02, +0.79] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.11 [-0.58, +0.36] 1 Logs
file_tree memory utilization -0.33 [-0.40, -0.26] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.40 [-1.18, +0.39] 1 Logs
quality_gate_idle_all_features memory utilization -0.50 [-0.55, -0.45] 1 Logs bounds checks dashboard
tcp_syslog_to_blackhole ingress throughput -1.08 [-1.14, -1.01] 1 Logs
quality_gate_logs % cpu utilization -3.69 [-6.69, -0.69] 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 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
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 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_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 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.

@dd-mergequeue dd-mergequeue bot merged commit 7c637fe into main Jan 28, 2025
312 of 314 checks passed
@dd-mergequeue dd-mergequeue bot deleted the paulcacheux/fix-direct-sender-compression branch January 28, 2025 11:58
@github-actions github-actions bot added this to the 7.64.0 milestone Jan 28, 2025
agent-platform-auto-pr bot pushed a commit that referenced this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/7.63.x Automatically create a backport PR to 7.63.x changelog/no-changelog component/system-probe medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/ebpf-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants