File tree Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Original file line number Diff line number Diff line change @@ -195,9 +195,9 @@ impl Agent {
195
195
Err ( err) => {
196
196
error ! ( "OTLP | Error sending traces to the trace flusher: {err}" ) ;
197
197
(
198
- StatusCode :: INTERNAL_SERVER_ERROR ,
199
- json ! ( { "message" : format!( "Error sending traces to the trace flusher: {err}" ) } ) . to_string ( )
200
- ) . into_response ( )
198
+ StatusCode :: INTERNAL_SERVER_ERROR ,
199
+ json ! ( { "message" : format!( "Error sending traces to the trace flusher: {err}" ) } ) . to_string ( )
200
+ ) . into_response ( )
201
201
}
202
202
}
203
203
}
Original file line number Diff line number Diff line change @@ -102,25 +102,24 @@ impl StatsFlusher for ServerlessStatsFlusher {
102
102
103
103
let start = std:: time:: Instant :: now ( ) ;
104
104
105
- if let Some ( api_key) = self . api_key_factory . get_api_key ( ) . await {
106
- let resp =
107
- stats_utils:: send_stats_payload ( serialized_stats_payload, endpoint, api_key) . await ;
108
- let elapsed = start. elapsed ( ) ;
109
- debug ! (
110
- "Stats request to {} took {}ms" ,
111
- stats_url,
112
- elapsed. as_millis( )
113
- ) ;
114
- match resp {
115
- Ok ( ( ) ) => debug ! ( "Successfully flushed stats" ) ,
116
- Err ( e) => {
117
- error ! ( "Error sending stats: {e:?}" ) ;
118
- }
119
- } ;
120
- } else {
105
+ let Some ( api_key) = self . api_key_factory . get_api_key ( ) . await else {
121
106
error ! ( "Failed to resolve API key" ) ;
122
107
return ;
123
- }
108
+ } ;
109
+ let resp =
110
+ stats_utils:: send_stats_payload ( serialized_stats_payload, endpoint, api_key) . await ;
111
+ let elapsed = start. elapsed ( ) ;
112
+ debug ! (
113
+ "Stats request to {} took {}ms" ,
114
+ stats_url,
115
+ elapsed. as_millis( )
116
+ ) ;
117
+ match resp {
118
+ Ok ( ( ) ) => debug ! ( "Successfully flushed stats" ) ,
119
+ Err ( e) => {
120
+ error ! ( "Error sending stats: {e:?}" ) ;
121
+ }
122
+ } ;
124
123
}
125
124
126
125
async fn flush ( & self ) {
Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ impl TraceProcessor for ServerlessTraceProcessor {
162
162
tracer_payload. tags . extend ( tags. clone ( ) ) ;
163
163
}
164
164
}
165
-
166
165
let Some ( api_key) = self . api_key_factory . get_api_key ( ) . await else {
167
166
error ! ( "Error processing traces: failed to resolve API key" ) ;
168
167
return None ;
You can’t perform that action at this time.
0 commit comments