diff --git a/middleware.go b/middleware.go index eab9827..5ba9cc7 100644 --- a/middleware.go +++ b/middleware.go @@ -18,8 +18,9 @@ const ( ) var ( - TraceIDKey = "trace-id" - SpanIDKey = "span-id" + TraceIDKey = "trace-id" + SpanIDKey = "span-id" + RequestIDKey = "id" RequestBodyMaxSize = 64 * 1024 // 64KB ResponseBodyMaxSize = 64 * 1024 // 64KB @@ -165,7 +166,7 @@ func NewWithConfig(logger *slog.Logger, config Config) gin.HandlerFunc { } if config.WithRequestID { - baseAttributes = append(baseAttributes, slog.String("id", requestID)) + baseAttributes = append(baseAttributes, slog.String(RequestIDKey, requestID)) } // otel