Add DD_APPSEC_SCA_ENABLED new configuration variable#2557
Conversation
d812229 to
fa41d2a
Compare
BenchmarksBenchmark execution time: 2024-03-05 16:23:25 Comparing candidate commit fa41d2a in PR branch Found 3 performance improvements and 3 performance regressions! Performance is the same for 176 metrics, 0 unstable metrics. scenario:PDOBench/benchPDOBaseline
scenario:PDOBench/benchPDOBaseline-opcache
scenario:PDOBench/benchPDOOverhead
scenario:PDOBench/benchPDOOverhead-opcache
scenario:PDOBench/benchPDOOverheadWithDBM
scenario:PDOBench/benchPDOOverheadWithDBM-opcache
|
Anilm3
left a comment
There was a problem hiding this comment.
Are there perhaps any tests showing that this variable is actually being sent?
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #2557 +/- ##
============================================
- Coverage 77.08% 75.91% -1.17%
Complexity 2574 2574
============================================
Files 214 240 +26
Lines 23057 27033 +3976
Branches 0 976 +976
============================================
+ Hits 17773 20522 +2749
- Misses 5284 5991 +707
- Partials 0 520 +520
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| ddog_ConfigurationOrigin origin = DDOG_CONFIGURATION_ORIGIN_DEFAULT; | ||
| if (!zend_string_equals_cstr(ini->value, cfg->default_encoded_value.ptr, cfg->default_encoded_value.len)) { | ||
| origin = cfg->name_index >= 0 ? DDOG_CONFIGURATION_ORIGIN_ENV_VAR : DDOG_CONFIGURATION_ORIGIN_CODE; | ||
| } else { |
There was a problem hiding this comment.
I found that when a configuration is explicitly defined as a env/ini with the same value as the default value of that config, the value sent to telemetry was default and it should be EnvVar instead
1b1225b to
7f6fc56
Compare
|
I think you should test |
da51431 to
0f417ed
Compare
Thanks for pointing that out @bwoebi . If I understood correctly, I fixed it |
|
@bwoebi pr is ready. Can you review when you have a chance please? |
| if (env_name.ptr == strstr(env_name.ptr, "DD_APPSEC_")) { | ||
| ini_name->ptr[sizeof("datadog.appsec") - 1] = '.'; | ||
| } | ||
|
|
||
| if (env_name.ptr == strstr(env_name.ptr, "DD_TRACE_")) { | ||
| ini_name->ptr[sizeof("datadog.trace") - 1] = '.'; | ||
| } |
There was a problem hiding this comment.
Can we reorder this and put an else if there? Just to avoid eval of strstr when unnecessary.
There was a problem hiding this comment.
Makes sense. Done
Description
It is required to create a new configuration variable
DD_APPSEC_SCA_ENABLEDso customers can enable SCA. This variable is reported to the backend via telemetry and used there.Reviewer checklist
APPSEC-14721