File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
src/DDTrace/OpenTelemetry Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class DatadogResolver implements ResolverInterface
1717 private const DEFAULT_HOST = 'localhost ' ;
1818 private const DEFAULT_SCHEME = 'http ' ;
1919
20- public function retrieveValue (string $ name ): mixed
20+ public function retrieveValue (string $ name )
2121 {
2222 if (!$ this ->isMetricsEnabled ($ name )) {
2323 return null ;
Original file line number Diff line number Diff line change 2222];
2323
2424// Helper function to track config access
25- function track_otel_config_if_whitelisted (string $ name , mixed $ value ): void
25+ function track_otel_config_if_whitelisted (string $ name , $ value ): void
2626{
2727 if (in_array ($ name , OTEL_CONFIG_WHITELIST , true )) {
2828 // Convert value to string for telemetry
29- $ value_str = match (true ) {
30- is_bool ($ value ) => $ value ? 'true ' : 'false ' ,
31- is_null ($ value ) => '' ,
32- is_array ($ value ) => json_encode ($ value ),
33- is_object ($ value ) => get_class ($ value ),
34- default => (string )$ value ,
35- };
29+ if (is_bool ($ value )) {
30+ $ value_str = $ value ? 'true ' : 'false ' ;
31+ } elseif (is_null ($ value )) {
32+ $ value_str = '' ;
33+ } elseif (is_array ($ value )) {
34+ $ value_str = json_encode ($ value );
35+ } elseif (is_object ($ value )) {
36+ $ value_str = get_class ($ value );
37+ } else {
38+ $ value_str = (string )$ value ;
39+ }
3640
3741 \dd_trace_internal_fn ('track_otel_config ' , $ name , $ value_str );
3842 }
You can’t perform that action at this time.
0 commit comments