diff --git a/middleware.go b/middleware.go index e35883b..01c0294 100644 --- a/middleware.go +++ b/middleware.go @@ -19,8 +19,9 @@ type customAttributesCtxKeyType struct{} var customAttributesCtxKey = customAttributesCtxKeyType{} var ( - TraceIDKey = "trace-id" - SpanIDKey = "span-id" + TraceIDKey = "trace-id" + SpanIDKey = "span-id" + RequestIDKey = "id" RequestBodyMaxSize = 64 * 1024 // 64KB ResponseBodyMaxSize = 64 * 1024 // 64KB @@ -173,7 +174,7 @@ func NewWithConfig(logger *slog.Logger, config Config) fiber.Handler { } if config.WithRequestID { - baseAttributes = append(baseAttributes, slog.String("id", requestID)) + baseAttributes = append(baseAttributes, slog.String(RequestIDKey, requestID)) } // otel