From 836874a761bc28727014277be126a6343eac0f6f Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 23 Oct 2023 17:06:21 +0300 Subject: [PATCH] [#262] Set tree request id Signed-off-by: Denis Kirillov --- api/middleware/reqinfo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/middleware/reqinfo.go b/api/middleware/reqinfo.go index 1db7692..1c01607 100644 --- a/api/middleware/reqinfo.go +++ b/api/middleware/reqinfo.go @@ -11,6 +11,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" + treepool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree" "github.com/go-chi/chi/v5" "github.com/google/uuid" "go.uber.org/zap" @@ -213,6 +214,8 @@ func Request(log *zap.Logger, settings RequestSettings) Func { r.Context(), HdrAmzRequestID, reqInfo.RequestID, )) + r = r.WithContext(treepool.SetRequestID(r.Context(), reqInfo.RequestID)) + reqLogger := log.With(zap.String("request_id", reqInfo.RequestID)) r = r.WithContext(SetReqLogger(r.Context(), reqLogger))