1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-17 11:55:32 +02:00

Add request ID to error reports

This commit is contained in:
DarthSim 2024-03-10 21:12:43 +03:00
parent a31e4e7c79
commit 01b053277d
2 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,7 @@
## [Unreleased]
### Add
- Add processing/info options and source image URL to error reports.
- Add request ID, processing/info options, and source image URL to error reports.
### Change
- Support configuring OpenTelemetry with standard [general](https://opentelemetry.io/docs/languages/sdk-configuration/general/) and [OTLP Exporter](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) environment variables.

View File

@ -135,6 +135,8 @@ func withPanicHandler(h router.RouteHandler) router.RouteHandler {
ctx := errorreport.StartRequest(r)
r = r.WithContext(ctx)
errorreport.SetMetadata(r, "Request ID", reqID)
defer func() {
if rerr := recover(); rerr != nil {
if rerr == http.ErrAbortHandler {