Skip to content

Commit 0d57b55

Browse files
authored
Let standard limiters to work when standalone not enabled (#3001)
1 parent 620af85 commit 0d57b55

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

appsec/tests/extension/client_init_record_span_tags.phpt

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Array
8686
(
8787
[_dd.appsec.json] => {"triggers":[{"found":"attack"},{"another":"attack"},{"yet another":"attack"}]}
8888
[_dd.p.appsec] => 1
89-
[_dd.p.dm] => -5
89+
[_dd.p.dm] => -0
9090
[_dd.p.tid] => %s
9191
[_dd.runtime_family] => php
9292
[appsec.event] => true
@@ -107,7 +107,8 @@ Array
107107
[metric_1] => 2
108108
[metric_2] => 10
109109
[_dd.appsec.enabled] => 1
110-
[_sampling_priority_v1] => 2
110+
[_dd.agent_psr] => 1
111+
[_sampling_priority_v1] => 1
111112
[php.compilation.total_time_ms] => %f
112113
[php.memory.peak_usage_bytes] => %f
113114
[php.memory.peak_real_usage_bytes] => %f

appsec/tests/extension/rinit_record_span_tags.phpt

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Array
8181
(
8282
[_dd.appsec.json] => {"triggers":[{"found":"attack"},{"another":"attack"},{"yet another":"attack"}]}
8383
[_dd.p.appsec] => 1
84-
[_dd.p.dm] => -5
84+
[_dd.p.dm] => -0
8585
[_dd.p.tid] => %s
8686
[_dd.runtime_family] => php
8787
[appsec.event] => true
@@ -100,7 +100,8 @@ Array
100100
[%s] => %d
101101
[rshutdown_metric] => 2.1
102102
[_dd.appsec.enabled] => 1
103-
[_sampling_priority_v1] => 2
103+
[_dd.agent_psr] => 1
104+
[_sampling_priority_v1] => 1
104105
[php.compilation.total_time_ms] => %f
105106
[php.memory.peak_usage_bytes] => %f
106107
[php.memory.peak_real_usage_bytes] => %f

ext/asm_event.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "asm_event.h"
2+
3+
#include "configuration.h"
24
#include "ddtrace.h"
35
#include "priority_sampling/priority_sampling.h"
46
#include "tracer_tag_propagation/tracer_tag_propagation.h"
@@ -24,7 +26,9 @@ DDTRACE_PUBLIC void ddtrace_emit_asm_event() {
2426
ZVAL_STR(&_1_zval, _1_zstr);
2527
ddtrace_add_propagated_tag(_dd_tag_p_appsec_zstr, &_1_zval);
2628

27-
ddtrace_set_priority_sampling_on_root(PRIORITY_SAMPLING_USER_KEEP, DD_MECHANISM_ASM);
29+
if (get_DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED()) {
30+
ddtrace_set_priority_sampling_on_root(PRIORITY_SAMPLING_USER_KEEP, DD_MECHANISM_ASM);
31+
}
2832
}
2933

3034
PHP_FUNCTION(DDTrace_Testing_emit_asm_event) {

tests/ext/integrations/curl/distributed_tracing_curl_propagate_asm_event.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Distributed tracing header tags propagate asm events with curl_exec()
66
--ENV--
77
DD_TRACE_TRACED_INTERNAL_FUNCTIONS=curl_exec
88
HTTP_X_DATADOG_TRACE_ID=42
9+
DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=1
910
--FILE--
1011
<?php
1112

0 commit comments

Comments
 (0)