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

Change DD_TRACE_SAMPLING_RULES_FORMAT default from regex to glob #2534

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ enum ddtrace_sampling_rules_format {
CONFIG(INT, DD_TRACE_RATE_LIMIT, "0", .ini_change = zai_config_system_ini_change) \
CALIAS(DOUBLE, DD_TRACE_SAMPLE_RATE, "-1", CALIASES("DD_SAMPLING_RATE")) \
CONFIG(JSON, DD_TRACE_SAMPLING_RULES, "[]") \
CONFIG(CUSTOM(INT), DD_TRACE_SAMPLING_RULES_FORMAT, "regex", .parser = dd_parse_sampling_rules_format) \
CONFIG(CUSTOM(INT), DD_TRACE_SAMPLING_RULES_FORMAT, "glob", .parser = dd_parse_sampling_rules_format) \
CONFIG(JSON, DD_SPAN_SAMPLING_RULES, "[]") \
CONFIG(STRING, DD_SPAN_SAMPLING_RULES_FILE, "", .ini_change = ddtrace_alter_sampling_rules_file_config) \
CONFIG(SET_LOWERCASE, DD_TRACE_HEADER_TAGS, "") \
Expand Down
1 change: 1 addition & 0 deletions tests/ext/priority_sampling/005-rule-name.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ priority_sampling rule with name match
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.7, "name": "bar"},{"sample_rate": 0.3, "name": "foo"}]
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=regex
--FILE--
<?php
$root = \DDTrace\root_span();
Expand Down
1 change: 1 addition & 0 deletions tests/ext/priority_sampling/007-rule-service.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ priority_sampling rule with service match
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.7, "service": "bar"},{"sample_rate": 0.3, "service": "foo"}]
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=regex
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0" && !getenv("SKIP_ASAN")) {
Expand Down
1 change: 1 addition & 0 deletions tests/ext/priority_sampling/009-rule-name-service.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ priority_sampling rule with name and service match
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.3, "name": "fo.*ame", "service": "bar"}, {"sample_rate": 0.7}]
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=regex
--FILE--
<?php
$root = \DDTrace\root_span();
Expand Down
1 change: 1 addition & 0 deletions tests/ext/priority_sampling/014-rule-resource.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ priority_sampling rule with resource match
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.7, "resource": "bar"},{"sample_rate": 0.3, "resource": "foo"}]
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=regex
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0" && !getenv("SKIP_ASAN")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
priority_sampling rule with name match, using glob
--ENV--
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=glob
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
priority_sampling rule with name match, using glob
--ENV--
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=glob
--FILE--
<?php

Expand Down
1 change: 1 addition & 0 deletions tests/ext/priority_sampling/invalid-regex-rule.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Invalid regex: default sampling rate applies
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.3, "service": "*"}]
DD_TRACE_GENERATE_ROOT_SPAN=1
DD_TRACE_SAMPLING_RULES_FORMAT=regex
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0" && !getenv("SKIP_ASAN")) {
Expand Down
Loading