You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log::info!("Accepted: the request has been accepted for processing");
119
+
//println!("Accepted: the request has been accepted for processing");
123
120
}
124
121
400 => {
125
-
log::error!("Bad request (likely an issue in the payload formatting)");
122
+
eprintln!("Bad request (likely an issue in the payload formatting)");
126
123
}
127
124
401 => {
128
-
log::error!("Unauthorized (likely a missing API Key)");
125
+
eprintln!("Unauthorized (likely a missing API Key)");
129
126
}
130
127
403 => {
131
-
log::error!("Permission issue (likely using an invalid API Key)");
128
+
eprintln!("Permission issue (likely using an invalid API Key)");
132
129
}
133
130
408 => {
134
-
log::error!("Request Timeout, request should be retried after some time");
131
+
eprintln!("Request Timeout, request should be retried after some time");
135
132
retry().await;
136
133
}
137
134
413 => {
138
-
log::error!("Payload too large (batch is above 5MB uncompressed)");
135
+
eprintln!("Payload too large (batch is above 5MB uncompressed)");
139
136
// split batch
140
137
let logs_len = logs.len();
141
138
let half = logs_len / 2;
@@ -144,36 +141,34 @@ impl DatadogLogIngestor {
144
141
self.send_logs(right, retries + 1).await;
145
142
}
146
143
429 => {
147
-
log::error!("Too Many Requests, request should be retried after some time");
144
+
eprintln!("Too Many Requests, request should be retried after some time");
148
145
retry().await;
149
146
}
150
147
500 => {
151
-
log::error!("Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time");
148
+
eprintln!("Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time");
152
149
retry().await;
153
150
}
154
151
503 => {
155
-
log::error!("Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time");
152
+
eprintln!("Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time");
156
153
retry().await;
157
154
}
158
155
_ => {
159
-
log::error!("Unknown error, try again later");
156
+
eprintln!("Unknown error, try again later");
160
157
retry().await;
161
158
}
162
159
},
163
160
Err(e) => {
164
-
log::error!("Failed to send logs to Datadog: {:?}", e);
161
+
eprintln!("Failed to send logs to Datadog: {:?}", e);
165
162
}
166
163
}
167
164
}
168
165
169
166
#[async_recursion]
170
167
asyncfntry_send(&mutself,is_flush:bool){
171
-
log::info!("Flushing...");
172
168
{
173
169
// send current logs to datadog if there are any
174
170
let queue = self.queue.read().await;
175
171
if queue.is_empty(){
176
-
log::info!("Queue is empty, skipping flush");
177
172
return;
178
173
}
179
174
if !is_flush {
@@ -182,7 +177,6 @@ impl DatadogLogIngestor {
182
177
let now = Utc::now();
183
178
let diff = now - last_log.received_at;
184
179
if diff < Duration::seconds(MAX_BATCH_DURATION_SECS){
185
-
log::info!("Last log is too recent, skipping flush: {:?}", diff);
186
180
return;
187
181
}
188
182
}
@@ -198,7 +192,6 @@ impl DatadogLogIngestor {
198
192
199
193
// send them (retries if it fails)
200
194
self.send_logs(&logs,0).await;
201
-
log::info!("Flushed {} logs", logs.len());
202
195
203
196
// check if the queue is empty and flush again if it's not
204
197
let is_queue_empty = {self.queue.read().await.is_empty()};
0 commit comments