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
-`New[T ResourceData]()` - Create generic processor with signal-specific callbacks
303
303
-`Partition(ctx, resources)` - Partition resources by tenant from resource attributes
304
-
-`Dispatch(ctx, tenantMap)` - Concurrent forwarding to backend with tenant headers
304
+
-`Dispatch(ctx, tenantMap)` - Concurrent forwarding to backend with tenant headers; returns error if any backend responds with status >= 400
305
305
-`send(ctx, tenant, resources)` - HTTP client with protobuf marshaling and metrics
306
306
307
307
**Handler Package (`internal/handler/`):**
@@ -564,6 +564,19 @@ When forwarding data to observability backends:
564
564
5. Content-Type is set to `application/x-protobuf`
565
565
6. Original protobuf format is preserved with proper headers via `addHeaders()`
566
566
567
+
### Error Handling
568
+
569
+
The proxy implements robust error handling for backend responses:
570
+
571
+
- **Success Responses (< 400)**: Data is successfully forwarded and metrics are recorded with the response status code
572
+
- **Error Responses (>= 400)**: The proxy treats all HTTP status codes of 400 or higher as errors:
573
+
- An error is logged with the status code, tenant, and signal type
574
+
- The request is marked as failed in distributed tracing
575
+
- An error is returned to the caller, which may trigger retry logic in upstream collectors
576
+
- Metrics are still recorded with the error status code for observability
577
+
578
+
This ensures that client errors (4xx) and server errors (5xx) from the backend are properly surfaced and can be monitored through the proxy's own telemetry.
579
+
567
580
## Observability
568
581
569
582
The service exposes metrics about its operation:
@@ -802,7 +815,7 @@ go tool cover -func=coverage.out
0 commit comments