@@ -22,7 +22,7 @@ const AGENT_ERRORS_INTAKE_URL_PATH: &str = "/evp_proxy/v4/api/v2/errorsintake";
22
22
const DEFAULT_AGENT_HOST : & str = "localhost" ;
23
23
const DEFAULT_AGENT_PORT : u16 = 8126 ;
24
24
25
- #[ derive( Clone , Debug , serde:: Serialize , serde:: Deserialize ) ]
25
+ #[ derive( Clone , Debug , Default , serde:: Serialize , serde:: Deserialize ) ]
26
26
pub struct ErrorsIntakeConfig {
27
27
/// Endpoint to send the data to
28
28
/// This is private and should be interacted with through the set_endpoint function
@@ -56,7 +56,7 @@ fn endpoint_with_errors_intake_path(
56
56
}
57
57
58
58
/// Settings gathers configuration options we receive from the environment
59
- #[ derive( Debug ) ]
59
+ #[ derive( Debug , Default ) ]
60
60
pub struct ErrorsIntakeSettings {
61
61
// Env parameter
62
62
pub agent_host : Option < String > ,
@@ -73,24 +73,6 @@ pub struct ErrorsIntakeSettings {
73
73
pub agent_uds_socket_found : bool ,
74
74
}
75
75
76
- impl Default for ErrorsIntakeSettings {
77
- fn default ( ) -> Self {
78
- Self {
79
- agent_host : None ,
80
- trace_agent_port : None ,
81
- trace_agent_url : None ,
82
- trace_pipe_name : None ,
83
- direct_submission_enabled : false ,
84
- api_key : None ,
85
- site : None ,
86
- errors_intake_dd_url : None ,
87
- shared_lib_debug : false ,
88
-
89
- agent_uds_socket_found : false ,
90
- }
91
- }
92
- }
93
-
94
76
impl ErrorsIntakeSettings {
95
77
// Agent connection configuration
96
78
const DD_TRACE_AGENT_URL : & ' static str = "DD_TRACE_AGENT_URL" ;
@@ -133,16 +115,6 @@ impl ErrorsIntakeSettings {
133
115
}
134
116
}
135
117
136
- impl Default for ErrorsIntakeConfig {
137
- fn default ( ) -> Self {
138
- Self {
139
- endpoint : None ,
140
- direct_submission_enabled : false ,
141
- debug_enabled : false ,
142
- }
143
- }
144
- }
145
-
146
118
impl ErrorsIntakeConfig {
147
119
// Implemented following same pattern as telemetry
148
120
fn trace_agent_url_from_setting ( settings : & ErrorsIntakeSettings ) -> String {
@@ -178,7 +150,7 @@ impl ErrorsIntakeConfig {
178
150
#[ cfg( unix) ]
179
151
return settings
180
152
. agent_uds_socket_found
181
- . then ( || format ! ( "unix:///var/run/datadog/apm.socket" ) ) ;
153
+ . then ( || "unix:///var/run/datadog/apm.socket" . to_string ( ) ) ;
182
154
#[ cfg( not( unix) ) ]
183
155
return None ;
184
156
} )
0 commit comments