Skip to content

chore: upgrade go-libddwaf to the latest v3 #37639

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

Merged
merged 14 commits into from
Jun 5, 2025

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jun 4, 2025

What does this PR do?

Upgrades github.com/DataDog/go-libddwaf/v3 to the latest, which supports go1.24, and ensure some test fails if building the serverless agent with an unsupported Go release.

It also changes the startup mechanism to no longer fail if AppSec fails to start, instead logs a warning and uses a no-op httpsec.Monitorer.

Motivation

Customers rely on this feature.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@RomainMuller RomainMuller marked this pull request as ready for review June 4, 2025 08:50
@RomainMuller RomainMuller requested a review from a team as a code owner June 4, 2025 08:50
@github-actions github-actions bot added the medium review PR review might take time label Jun 4, 2025
Copy link

cit-pr-commenter bot commented Jun 4, 2025

Go Package Import Differences

Baseline: bae621f
Comparison: 8f14e6d

binaryosarchchange
serverlesslinuxamd64
+3, -0
+github.com/DataDog/appsec-internal-go/apisec
+github.com/ebitengine/purego
+structs
serverlesslinuxarm64
+3, -0
+github.com/DataDog/appsec-internal-go/apisec
+github.com/ebitengine/purego
+structs

@RomainMuller RomainMuller added qa/no-code-change No code change in Agent code requiring validation team/serverless labels Jun 4, 2025
@RomainMuller
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jun 4, 2025

View all feedbacks in Devflow UI.

2025-06-04 09:59:47 UTC ℹ️ Start processing command /merge


2025-06-04 09:59:54 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-06-04 14:00:08 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@RomainMuller RomainMuller requested review from a team as code owners June 4, 2025 14:16
@RomainMuller RomainMuller requested a review from hush-hush June 4, 2025 14:16
@github-actions github-actions bot added component/system-probe long review PR is complex, plan time to review it and removed medium review PR review might take time labels Jun 4, 2025
@RomainMuller RomainMuller force-pushed the romain.marcadier/upgrade-go-libddwaf-go1.24 branch from b3f5bac to 7ef7fee Compare June 4, 2025 14:18
@RomainMuller RomainMuller removed request for a team June 4, 2025 14:20
@RomainMuller RomainMuller removed the request for review from hush-hush June 4, 2025 14:20
@github-actions github-actions bot added medium review PR review might take time and removed component/system-probe long review PR is complex, plan time to review it labels Jun 4, 2025
@RomainMuller
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jun 4, 2025

View all feedbacks in Devflow UI.

2025-06-04 14:22:50 UTC ℹ️ Start processing command /merge


2025-06-04 14:23:10 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-06-04 18:24:05 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@RomainMuller RomainMuller force-pushed the romain.marcadier/upgrade-go-libddwaf-go1.24 branch from 7ef7fee to cf0267f Compare June 4, 2025 14:43
Copy link

cit-pr-commenter bot commented Jun 4, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: a35e5e69-b355-4ffc-aaba-61e3c962cad3

Baseline: bae621f
Comparison: 8f14e6d
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 +2.87 [+1.98, +3.77] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.78 [+0.72, +0.84] 1 Logs
docker_containers_memory memory utilization +0.77 [+0.72, +0.81] 1 Logs
otlp_ingest_logs memory utilization +0.66 [+0.54, +0.78] 1 Logs
ddot_logs memory utilization +0.49 [+0.35, +0.63] 1 Logs
otlp_ingest_metrics memory utilization +0.35 [+0.18, +0.52] 1 Logs
ddot_metrics memory utilization +0.18 [+0.07, +0.29] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.11 [-0.48, +0.69] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.07 [-0.54, +0.69] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.02 [-0.62, +0.66] 1 Logs
file_tree memory utilization +0.01 [-0.13, +0.16] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.02, +0.03] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.30, +0.29] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.02 [-0.65, +0.61] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.02 [-0.26, +0.21] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.04 [-0.63, +0.55] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput -0.05 [-0.62, +0.53] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.06 [-0.13, +0.00] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.06 [-0.71, +0.58] 1 Logs
quality_gate_idle_all_features memory utilization -0.11 [-0.19, -0.02] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization -0.36 [-0.42, -0.30] 1 Logs bounds checks dashboard
docker_containers_cpu % cpu utilization -3.07 [-6.08, -0.06] 1 Logs
quality_gate_logs % cpu utilization -4.30 [-7.02, -1.58] 1 Logs bounds checks dashboard

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
docker_containers_memory memory_usage 0/10
docker_containers_cpu simple_check_run 10/10
docker_containers_memory simple_check_run 10/10
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 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard

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_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 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_logs, bounds check intake_connections: 10/10 replicas passed. Gate 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.

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jun 4, 2025

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor bae621f

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0}$$ $${731.85}$$ < $${752.99}$$ $${-0.01}$$ $${181.35}$$ < $${187.44}$$
agent_deb_amd64_fips $${+0}$$ $${730.14}$$ < $${751.36}$$ $${-0.01}$$ $${180.78}$$ < $${187.06}$$
agent_heroku_amd64 $${+0}$$ $${358.53}$$ < $${369.68}$$ $${-0}$$ $${96.49}$$ < $${99.55}$$
agent_msi $${+0}$$ $${959.66}$$ < $${987.01}$$ $${+0}$$ $${146.41}$$ < $${150.72}$$
agent_rpm_amd64 $${+0}$$ $${731.84}$$ < $${752.98}$$ $${+0.02}$$ $${183.54}$$ < $${190.03}$$
agent_rpm_amd64_fips $${+0}$$ $${730.13}$$ < $${751.35}$$ $${+0.01}$$ $${183.67}$$ < $${189.81}$$
agent_rpm_arm64 $${+0}$$ $${719.23}$$ < $${739.42}$$ $${-0.01}$$ $${165.42}$$ < $${171.23}$$
agent_rpm_arm64_fips $${+0}$$ $${717.65}$$ < $${737.91}$$ $${-0.01}$$ $${164.76}$$ < $${170.22}$$
agent_suse_amd64 $${+0}$$ $${731.84}$$ < $${752.98}$$ $${+0.02}$$ $${183.54}$$ < $${190.03}$$
agent_suse_amd64_fips $${+0}$$ $${730.13}$$ < $${751.35}$$ $${+0.01}$$ $${183.67}$$ < $${189.81}$$
agent_suse_arm64 $${+0}$$ $${719.23}$$ < $${739.42}$$ $${-0.01}$$ $${165.42}$$ < $${171.23}$$
agent_suse_arm64_fips $${+0}$$ $${717.65}$$ < $${737.91}$$ $${-0.01}$$ $${164.76}$$ < $${170.22}$$
docker_agent_amd64 $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_arm64 $${+0}$$ $${826.48}$$ < $${858.97}$$ $${-0}$$ $${263.66}$$ < $${274.36}$$
docker_agent_jmx_amd64 $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_jmx_arm64 $${+0}$$ $${826.48}$$ < $${858.97}$$ $${-0}$$ $${263.66}$$ < $${274.36}$$
docker_agent_windows1809 $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows1809_core $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows1809_core_jmx $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows1809_jmx $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows2022 $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows2022_core $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows2022_core_jmx $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_agent_windows2022_jmx $${+0}$$ $${815.64}$$ < $${849.39}$$ $${-0.01}$$ $${277.07}$$ < $${288.34}$$
docker_cluster_agent_amd64 $${+0}$$ $${259.14}$$ < $${259.73}$$ $${-0}$$ $${102.86}$$ < $${103.68}$$
docker_cluster_agent_arm64 $${+0}$$ $${273.57}$$ < $${274.24}$$ $${+0}$$ $${97.59}$$ < $${98.45}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.08}$$ < $${7.12}$$ $${0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${0}$$ $${38.92}$$ < $${39.57}$$ $${+0}$$ $${14.95}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${0}$$ $${37.52}$$ < $${38.2}$$ $${0}$$ $${13.96}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${30.61}$$ < $${31.52}$$ $${+0}$$ $${8.03}$$ < $${8.97}$$
dogstatsd_deb_arm64 $${0}$$ $${29.16}$$ < $${30.08}$$ $${-0}$$ $${6.97}$$ < $${7.92}$$
dogstatsd_rpm_amd64 $${0}$$ $${30.61}$$ < $${31.52}$$ $${-0}$$ $${8.04}$$ < $${8.98}$$
dogstatsd_suse_amd64 $${0}$$ $${30.61}$$ < $${31.52}$$ $${-0}$$ $${8.04}$$ < $${8.98}$$
iot_agent_deb_amd64 $${0}$$ $${50.45}$$ < $${60.17}$$ $${+0}$$ $${12.85}$$ < $${15.82}$$
iot_agent_deb_arm64 $${0}$$ $${47.9}$$ < $${56.94}$$ $${-0}$$ $${11.14}$$ < $${13.86}$$
iot_agent_deb_armhf $${0}$$ $${47.49}$$ < $${56.41}$$ $${+0}$$ $${11.2}$$ < $${13.86}$$
iot_agent_rpm_amd64 $${0}$$ $${50.45}$$ < $${60.18}$$ $${-0}$$ $${12.87}$$ < $${15.84}$$
iot_agent_rpm_arm64 $${0}$$ $${47.9}$$ < $${56.94}$$ $${-0}$$ $${11.16}$$ < $${13.76}$$
iot_agent_suse_amd64 $${0}$$ $${50.45}$$ < $${60.18}$$ $${-0}$$ $${12.87}$$ < $${15.84}$$

@Julio-Guerra
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jun 4, 2025

View all feedbacks in Devflow UI.

2025-06-04 21:19:59 UTC ℹ️ Start processing command /merge


2025-06-04 21:20:09 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-06-05 01:21:02 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@RomainMuller
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jun 5, 2025

View all feedbacks in Devflow UI.

2025-06-05 07:45:14 UTC ℹ️ Start processing command /merge


2025-06-05 07:45:20 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-06-05 09:59:05 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 51m (p90).


2025-06-05 10:39:03 UTC ℹ️ MergeQueue: This merge request was merged

Copy link
Contributor

github-actions bot commented Jun 5, 2025

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between bae621f and 76402ab.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats

@dd-mergequeue dd-mergequeue bot merged commit 24f3536 into main Jun 5, 2025
250 of 252 checks passed
@dd-mergequeue dd-mergequeue bot deleted the romain.marcadier/upgrade-go-libddwaf-go1.24 branch June 5, 2025 10:39
@github-actions github-actions bot added this to the 7.68.0 milestone Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/serverless
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants