@@ -163,9 +163,21 @@ pub struct EnvConfig {
163
163
/// @env `DD_APM_CONFIG_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS`
164
164
#[ serde( deserialize_with = "deserialize_optional_bool_from_anything" ) ]
165
165
pub apm_config_obfuscation_http_remove_paths_with_digits : Option < bool > ,
166
+ /// @env `DD_APM_CONFIG_COMPRESSION_LEVEL`
167
+ ///
168
+ /// The Agent compresses traces before sending them. The `compression_level` parameter
169
+ /// accepts values from 0 (no compression) to 9 (maximum compression but
170
+ /// higher resource usage).
171
+ pub apm_config_compression_level : Option < i32 > ,
166
172
/// @env `DD_APM_FEATURES`
167
173
#[ serde( deserialize_with = "deserialize_array_from_comma_separated_string" ) ]
168
174
pub apm_features : Vec < String > ,
175
+ /// @env `DD_APM_ADDITIONAL_ENDPOINTS`
176
+ ///
177
+ /// Additional endpoints to send traces to.
178
+ /// <https://docs.datadoghq.com/agent/configuration/dual-shipping/?tab=helm#environment-variable-configuration-1>
179
+ #[ serde( deserialize_with = "deserialize_additional_endpoints" ) ]
180
+ pub apm_additional_endpoints : HashMap < String , Vec < String > > ,
169
181
//
170
182
// Trace Propagation
171
183
/// @env `DD_TRACE_PROPAGATION_STYLE`
@@ -347,7 +359,9 @@ fn merge_config(config: &mut Config, env_config: &EnvConfig) {
347
359
env_config,
348
360
apm_config_obfuscation_http_remove_paths_with_digits
349
361
) ;
362
+ merge_option_to_value ! ( config, env_config, apm_config_compression_level) ;
350
363
merge_vec ! ( config, env_config, apm_features) ;
364
+ merge_hashmap ! ( config, env_config, apm_additional_endpoints) ;
351
365
352
366
// Trace Propagation
353
367
merge_vec ! ( config, env_config, trace_propagation_style) ;
@@ -533,10 +547,12 @@ mod tests {
533
547
"DD_APM_CONFIG_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS" ,
534
548
"true" ,
535
549
) ;
550
+ jail. set_env ( "DD_APM_CONFIG_COMPRESSION_LEVEL" , "3" ) ;
536
551
jail. set_env (
537
552
"DD_APM_FEATURES" ,
538
553
"enable_otlp_compute_top_level_by_span_kind,enable_stats_by_span_kind" ,
539
554
) ;
555
+ jail. set_env ( "DD_APM_ADDITIONAL_ENDPOINTS" , "{\" https://trace.agent.datadoghq.com\" : [\" apikey2\" , \" apikey3\" ], \" https://trace.agent.datadoghq.eu\" : [\" apikey4\" ]}" ) ;
540
556
541
557
// Trace Propagation
542
558
jail. set_env ( "DD_TRACE_PROPAGATION_STYLE" , "datadog" ) ;
@@ -673,10 +689,21 @@ mod tests {
673
689
) ,
674
690
apm_config_obfuscation_http_remove_query_string : true ,
675
691
apm_config_obfuscation_http_remove_paths_with_digits : true ,
692
+ apm_config_compression_level : 3 ,
676
693
apm_features : vec ! [
677
694
"enable_otlp_compute_top_level_by_span_kind" . to_string( ) ,
678
695
"enable_stats_by_span_kind" . to_string( ) ,
679
696
] ,
697
+ apm_additional_endpoints : HashMap :: from ( [
698
+ (
699
+ "https://trace.agent.datadoghq.com" . to_string ( ) ,
700
+ vec ! [ "apikey2" . to_string( ) , "apikey3" . to_string( ) ] ,
701
+ ) ,
702
+ (
703
+ "https://trace.agent.datadoghq.eu" . to_string ( ) ,
704
+ vec ! [ "apikey4" . to_string( ) ] ,
705
+ ) ,
706
+ ] ) ,
680
707
trace_propagation_style : vec ! [ TracePropagationStyle :: Datadog ] ,
681
708
trace_propagation_style_extract : vec ! [ TracePropagationStyle :: B3 ] ,
682
709
trace_propagation_extract_first : true ,
0 commit comments