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

ASM Standalone #2903

Merged
merged 47 commits into from
Dec 16, 2024
Merged

ASM Standalone #2903

merged 47 commits into from
Dec 16, 2024

Conversation

estringana
Copy link
Contributor

@estringana estringana commented Oct 18, 2024

Description

Implement ASM Standalone billing. This project will enable customers to use ASM product without APM product.

Implementation

There is a new configuration called DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED(default: false) which disable APM.

When DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED is enabled, traces will be only sent under the following conditions:

  • There is an ASM event
  • One APM trace will be sent as a heartbeat at least once a minute in the absence of ASM events. This is done to keep the service alive on the backend and avoid it gets into degraded mode.

Since the tracing engine is coupled to the tracer extension, it will be required that DD_TRACE_ENABLED is set to true. However DD_TRACE_ENABLED being enabled does not mean APM is.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 64.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 72.72%. Comparing base (4cc2897) to head (13d4688).

Files with missing lines Patch % Lines
appsec/src/extension/ddtrace.c 60.00% 3 Missing and 3 partials ⚠️
appsec/src/extension/tags.c 66.66% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2903      +/-   ##
============================================
- Coverage     72.75%   72.72%   -0.03%     
  Complexity     2750     2750              
============================================
  Files           138      138              
  Lines         15038    15060      +22     
  Branches       1020     1026       +6     
============================================
+ Hits          10941    10953      +12     
- Misses         3543     3548       +5     
- Partials        554      559       +5     
Flag Coverage Δ
appsec-extension 67.95% <64.00%> (-0.03%) ⬇️
tracer-php 74.55% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
appsec/src/extension/commands_helpers.c 63.65% <100.00%> (+0.08%) ⬆️
appsec/src/extension/configuration.h 100.00% <ø> (ø)
appsec/src/extension/tags.c 79.67% <66.66%> (-0.13%) ⬇️
appsec/src/extension/ddtrace.c 57.41% <60.00%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4cc2897...13d4688. Read the comment docs.

@pr-commenter
Copy link

pr-commenter bot commented Oct 18, 2024

Benchmarks [ tracer ]

Benchmark execution time: 2024-12-13 11:23:43

Comparing candidate commit 13d4688 in PR branch estringana/asm-standalone-2 with baseline commit 4cc2897 in branch master.

Found 2 performance improvements and 0 performance regressions! Performance is the same for 176 metrics, 0 unstable metrics.

scenario:PDOBench/benchPDOBaseline

  • 🟩 execution_time [-15.083µs; -10.459µs] or [-7.756%; -5.378%]

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟩 execution_time [-13.408µs; -7.795µs] or [-6.879%; -3.999%]

@estringana estringana force-pushed the estringana/asm-standalone-2 branch 3 times, most recently from 5feaef4 to 522e841 Compare October 24, 2024 13:31
@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2024

Benchmarks [ appsec ]

Benchmark execution time: 2024-12-13 11:30:10

Comparing candidate commit 13d4688 in PR branch estringana/asm-standalone-2 with baseline commit 4cc2897 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

@estringana estringana force-pushed the estringana/asm-standalone-2 branch 3 times, most recently from 5149b34 to 5d05f77 Compare October 25, 2024 09:31
@estringana estringana force-pushed the estringana/asm-standalone-2 branch 6 times, most recently from 4b42290 to b068df8 Compare November 8, 2024 15:04
@estringana estringana force-pushed the estringana/asm-standalone-2 branch from 56c99bd to a0ee5cc Compare November 12, 2024 11:07
if (Z_TYPE_P(rule) != IS_ARRAY) {
continue;
}
if (!get_global_DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED()) { // APPSEC_STANDALONE enabled, override sampling rules to be empty
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 just wrap the code within if (!get_global_DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED()) {

@estringana estringana force-pushed the estringana/asm-standalone-2 branch 2 times, most recently from 3a73d3b to a93f131 Compare November 14, 2024 11:21
@estringana estringana force-pushed the estringana/asm-standalone-2 branch 3 times, most recently from 57ade7e to 7fc63bc Compare November 20, 2024 11:19
ext/standalone_limiter.c Outdated Show resolved Hide resolved
@estringana estringana force-pushed the estringana/asm-standalone-2 branch from 7fc63bc to 9917e7a Compare November 21, 2024 12:25
@estringana estringana marked this pull request as ready for review November 22, 2024 09:09
@estringana estringana requested review from a team as code owners November 22, 2024 09:09
@estringana estringana changed the title [DRAFT] ASM Standalone ASM Standalone Nov 22, 2024
@estringana estringana force-pushed the estringana/asm-standalone-2 branch from 3908181 to 3952e69 Compare December 12, 2024 16:27
@estringana estringana merged commit 0926c77 into master Dec 16, 2024
706 of 755 checks passed
@estringana estringana deleted the estringana/asm-standalone-2 branch December 16, 2024 10:59
@github-actions github-actions bot added this to the 1.6.0 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants