-
Notifications
You must be signed in to change notification settings - Fork 155
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
WAF telemetry #2735
base: master
Are you sure you want to change the base?
WAF telemetry #2735
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2735 +/- ##
============================================
- Coverage 82.10% 73.97% -8.13%
Complexity 2527 2527
============================================
Files 108 108
Lines 10360 10360
============================================
- Hits 8506 7664 -842
- Misses 1854 2696 +842
Flags with carried forward coverage won't be shown. Click here to find out more. see 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
BenchmarksBenchmark execution time: 2024-07-13 00:47:21 Comparing candidate commit a225a90 in PR branch Found 17 performance improvements and 0 performance regressions! Performance is the same for 161 metrics, 0 unstable metrics. scenario:EmptyFileBench/benchEmptyFileBaseline
scenario:EmptyFileBench/benchEmptyFileBaseline-opcache
scenario:EmptyFileBench/benchEmptyFileOverhead
scenario:EmptyFileBench/benchEmptyFileOverhead-opcache
scenario:LaravelBench/benchLaravelBaseline
scenario:LaravelBench/benchLaravelBaseline-opcache
scenario:LaravelBench/benchLaravelOverhead
scenario:LaravelBench/benchLaravelOverhead-opcache
scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache
scenario:SymfonyBench/benchSymfonyBaseline
scenario:SymfonyBench/benchSymfonyBaseline-opcache
scenario:SymfonyBench/benchSymfonyOverhead
scenario:SymfonyBench/benchSymfonyOverhead-opcache
scenario:TraceSerializationBench/benchSerializeTrace
scenario:TraceSerializationBench/benchSerializeTrace-opcache
scenario:WordPressBench/benchWordPressOverhead
scenario:WordPressBench/benchWordPressOverhead-opcache
|
8464095
to
d91cd3f
Compare
e777ab6
to
8239978
Compare
8239978
to
3cdc077
Compare
6b37ec2
to
ad72485
Compare
1b22395
to
a225a90
Compare
a225a90
to
ff61a19
Compare
Benchmarks [ tracer ]Benchmark execution time: 2024-11-11 12:23:45 Comparing candidate commit b3f6f9f in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 176 metrics, 0 unstable metrics. scenario:PDOBench/benchPDOBaseline
scenario:PDOBench/benchPDOBaseline-opcache
|
Benchmarks [ appsec ]Benchmark execution time: 2024-11-11 12:23:13 Comparing candidate commit b3f6f9f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. |
4e07791
to
e00d8b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a number of comments, everything looks correct albeit there could be some improvements around the helper telemetry API and the naming conventions.
9ae5168
to
7f4cb58
Compare
7f4cb58
to
b3f6f9f
Compare
@@ -648,6 +678,103 @@ bool dd_command_process_metrics(mpack_node_t root, zend_object *nonnull span) | |||
return true; | |||
} | |||
|
|||
static void _handle_telemetry_metric(const char *nonnull key_str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it is a good practice or I made it up but, should this early declaration be at the top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You put these at the top if you use these multiple times at various places across a file. For a single use like here, there's no reason to.
@@ -123,6 +147,7 @@ void dd_trace_startup() | |||
|
|||
if (get_global_DD_APPSEC_TESTING()) { | |||
_register_testing_objects(); | |||
_setup_testing_telemetry_functions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I coudln't get why this is within APPSEC_TESTING
. I'm probably missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Makes sense
@@ -89,6 +89,9 @@ template <typename T> struct base_response_generic : public base_response { | |||
} | |||
}; | |||
|
|||
using telemetry_metrics = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not used
} \ | ||
} while (0) | ||
|
||
HANDLE_METRIC("waf.requests", DDTRACE_METRIC_TYPE_COUNT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you added some integration tests checking this metrics but I am missing some PHPT checking the extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also allow you to test unknown telemetry metrics
Description
See individual commits for descriptions of the changes.
Reviewer checklist