insert request id in context
Some checks failed
autoapprove / autoapprove (pull_request) Failing after 1m25s
automerge / automerge (pull_request) Failing after 4s
codeql / analyze (go) (pull_request) Failing after 3m15s
dependabot-automerge / automerge (pull_request) Has been skipped
prbuild / test (pull_request) Failing after 1m29s
prbuild / lint (pull_request) Failing after 2m30s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-08-23 16:32:14 +03:00
parent d03bf1aa14
commit 9170371647

View File

@ -40,10 +40,11 @@ var DefaultMetadataFunc = func(ctx context.Context) (context.Context, error) {
} }
imd.Set(DefaultMetadataKey, v) imd.Set(DefaultMetadataKey, v)
omd.Set(DefaultMetadataKey, v) omd.Set(DefaultMetadataKey, v)
ctx = context.WithValue(ctx, XRequestIDKey, v)
ctx = metadata.NewIncomingContext(ctx, imd) ctx = metadata.NewIncomingContext(ctx, imd)
ctx = metadata.NewOutgoingContext(ctx, omd) ctx = metadata.NewOutgoingContext(ctx, omd)
return context.WithValue(ctx, XRequestIDKey, v), nil return ctx, nil
} }
type wrapper struct { type wrapper struct {