@@ -204,6 +204,10 @@ impl ErrorsIntakeUploader {
204
204
telemetry_endpoint : & Option < Endpoint > ,
205
205
) -> anyhow:: Result < Self > {
206
206
let endpoint = Self :: build_errors_intake_endpoint ( telemetry_endpoint) ?;
207
+ eprintln ! (
208
+ "DEBUG: Created errors intake uploader with URL: {}" ,
209
+ endpoint. url
210
+ ) ;
207
211
Ok ( Self { endpoint } )
208
212
}
209
213
@@ -214,12 +218,13 @@ impl ErrorsIntakeUploader {
214
218
Some ( endpoint) => {
215
219
let mut errors_endpoint = endpoint. clone ( ) ;
216
220
217
- // Modify the path based on whether we're using agent proxy or direct intake
218
- let _new_path = if endpoint. api_key . is_some ( ) {
221
+ // Modify the endpoint based on whether we're using agent proxy or direct intake
222
+ if endpoint. api_key . is_some ( ) {
219
223
// Direct intake - change hostname to event-platform-intake
220
224
let mut parts = endpoint. url . clone ( ) . into_parts ( ) ;
221
225
222
226
// Update the authority to use event-platform-intake subdomain
227
+ // Only modify authority for production domains, not localhost
223
228
if let Some ( authority) = parts. authority . as_ref ( ) {
224
229
let authority_str = authority. as_str ( ) ;
225
230
let new_authority = if authority_str. contains ( "datad0g.com" ) {
@@ -228,6 +233,11 @@ impl ErrorsIntakeUploader {
228
233
} else if authority_str. contains ( "datadoghq.com" ) {
229
234
authority_str
230
235
. replace ( "instrumentation-telemetry-intake" , ERROR_INTAKE_SUBDOMAIN )
236
+ } else if authority_str. starts_with ( "localhost" )
237
+ || authority_str. starts_with ( "127.0.0.1" )
238
+ {
239
+ // For localhost, keep the same authority for direct intake testing
240
+ authority_str. to_string ( )
231
241
} else {
232
242
// For other domains, prepend event-platform-intake
233
243
format ! ( "{}.{}" , ERROR_INTAKE_SUBDOMAIN , authority_str)
@@ -240,24 +250,23 @@ impl ErrorsIntakeUploader {
240
250
) ;
241
251
}
242
252
253
+ // Set direct intake path
243
254
parts. path_and_query = Some (
244
255
ERROR_INTAKE_DIRECT_PATH
245
256
. parse ( )
246
257
. context ( "Failed to parse direct errors intake path" ) ?,
247
258
) ;
248
259
249
260
errors_endpoint. url = Uri :: from_parts ( parts) ?;
250
- ERROR_INTAKE_DIRECT_PATH
251
261
} else {
252
- // Agent proxy - use evp_proxy path
262
+ // Agent proxy - keep same authority, just change path to evp_proxy
253
263
let mut parts = endpoint. url . clone ( ) . into_parts ( ) ;
254
264
parts. path_and_query = Some (
255
265
ERROR_INTAKE_AGENT_PATH
256
266
. parse ( )
257
267
. context ( "Failed to parse agent errors intake path" ) ?,
258
268
) ;
259
269
errors_endpoint. url = Uri :: from_parts ( parts) ?;
260
- ERROR_INTAKE_AGENT_PATH
261
270
} ;
262
271
263
272
Ok ( errors_endpoint)
@@ -283,11 +292,19 @@ impl ErrorsIntakeUploader {
283
292
sig_info : & SigInfo ,
284
293
metadata : & Metadata ,
285
294
) -> anyhow:: Result < ( ) > {
295
+ eprintln ! (
296
+ "DEBUG: Sending crash ping to errors intake URL: {}" ,
297
+ self . endpoint. url
298
+ ) ;
286
299
let payload = ErrorsIntakePayload :: from_crash_ping ( crash_uuid, sig_info, metadata) ?;
287
300
self . send_payload ( & payload) . await
288
301
}
289
302
290
303
pub async fn upload_to_errors_intake ( & self , crash_info : & CrashInfo ) -> anyhow:: Result < ( ) > {
304
+ eprintln ! (
305
+ "DEBUG: Sending crash report to errors intake URL: {}" ,
306
+ self . endpoint. url
307
+ ) ;
291
308
let payload = ErrorsIntakePayload :: from_crash_info ( crash_info) ?;
292
309
self . send_payload ( & payload) . await
293
310
}
0 commit comments