Context-based logging with request ID (#6899)

This commit is contained in:
Aleksey Kosov
2025-06-20 16:23:53 +03:00
committed by GitHub
parent a72c442945
commit 90c128e7a6
8 changed files with 302 additions and 48 deletions

View File

@@ -6,8 +6,11 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
"github.com/seaweedfs/seaweedfs/weed/util/request_id"
"io"
"net/http"
"net/url"
@@ -307,7 +310,7 @@ func ReadUrlAsStreamAuthenticated(ctx context.Context, fileUrl, jwt string, ciph
} else {
req.Header.Add("Range", fmt.Sprintf("bytes=%d-%d", offset, offset+int64(size)-1))
}
util.ReqWithRequestId(req, ctx)
request_id.InjectToRequest(ctx, req)
r, err := GetGlobalHttpClient().Do(req)
if err != nil {