Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request id to store gateway logger #5958

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [ENHANCEMENT] Distributor/Ring: Allow disabling detailed ring metrics by ring member. #5931
* [ENHANCEMENT] KV: Etcd Added etcd.ping-without-stream-allowed parameter to disable/enable PermitWithoutStream #5933
* [ENHANCEMENT] Ingester: Add a new `max_series_per_label_set` limit. This limit functions similarly to `max_series_per_metric`, but allowing users to define the maximum number of series per LabelSet. #5950
* [ENHANCEMENT] Store Gateway: Log gRPC requests together with headers configured in `http_request_headers_to_log`. #5958
* [CHANGE] Upgrade Dockerfile Node version from 14x to 18x. #5906
* [CHANGE] Query Frontend/Ruler: Omit empty data field in API response. #5953 #5954
* [BUGFIX] Configsdb: Fix endline issue in db password. #5920
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3
github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508
github.com/thanos-io/thanos v0.34.2-0.20240501161908-1e745af6720c
github.com/thanos-io/thanos v0.35.1-0.20240517203736-9e6cbd9fdd9d
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5
go.etcd.io/etcd/api/v3 v3.5.13
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1421,8 +1421,8 @@ github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3 h1:Q0BjHI7FMe5K
github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3/go.mod h1:ptMYNPgbyAR7a2Ab2t7zHA2/0be2ePyawVR7lp7fZtg=
github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508 h1:4X0ThYb7/wTTKS73wT13ixw0lj5OJ87g45RWIZhPZDA=
github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508/go.mod h1:FEPnabuTql1bDA4OUM41mwcZOJ20R436k8vq+xtGEG0=
github.com/thanos-io/thanos v0.34.2-0.20240501161908-1e745af6720c h1:clWAhj5L7+Dnw/apO874hUaVxDRHfkm9If4Qv/6CbIo=
github.com/thanos-io/thanos v0.34.2-0.20240501161908-1e745af6720c/go.mod h1:WHGZyM/qwp857mJr8Q0d7K6eQoLtLv+6p7RNpT/yeIE=
github.com/thanos-io/thanos v0.35.1-0.20240517203736-9e6cbd9fdd9d h1:Uomb1Yvuz1HDCJL6s0rTiHpaJpHvr8NRarO5TprM7Cs=
github.com/thanos-io/thanos v0.35.1-0.20240517203736-9e6cbd9fdd9d/go.mod h1:mwjTxpNgULRgeOr5qWmM2IKiyu4SNh/1JypUyPtlrQA=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
Expand Down
3 changes: 3 additions & 0 deletions pkg/storegateway/bucket_stores.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ func (u *BucketStores) getOrCreateStore(userID string) (*store.BucketStore, erro
bucketStoreReg := prometheus.NewRegistry()
bucketStoreOpts := []store.BucketStoreOption{
store.WithLogger(userLogger),
store.WithRequestLoggerFunc(func(ctx context.Context, logger log.Logger) log.Logger {
return util_log.HeadersFromContext(ctx, logger)
}),
store.WithRegistry(bucketStoreReg),
store.WithIndexCache(u.indexCache),
store.WithQueryGate(u.queryGate),
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/log/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func WithTraceID(traceID string, l log.Logger) log.Logger {
// log := util.WithContext(ctx)
// log.Errorf("Could not chunk chunks: %v", err)
func WithContext(ctx context.Context, l log.Logger) log.Logger {
l = headersFromContext(ctx, l)
l = HeadersFromContext(ctx, l)

// Weaveworks uses "orgs" and "orgID" to represent Cortex users,
// even though the code-base generally uses `userID` to refer to the same thing.
Expand All @@ -57,7 +57,7 @@ func WithSourceIPs(sourceIPs string, l log.Logger) log.Logger {
}

// HeadersFromContext enables the logging of specified HTTP Headers that have been added to a context
func headersFromContext(ctx context.Context, l log.Logger) log.Logger {
func HeadersFromContext(ctx context.Context, l log.Logger) log.Logger {
headerContentsMap := HeaderMapFromContext(ctx)
for header, contents := range headerContentsMap {
l = log.With(l, header, contents)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions vendor/github.com/thanos-io/thanos/pkg/compact/compact.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 71 additions & 3 deletions vendor/github.com/thanos-io/thanos/pkg/compact/planner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions vendor/github.com/thanos-io/thanos/pkg/extpromql/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 28 additions & 12 deletions vendor/github.com/thanos-io/thanos/pkg/query/remote_engine.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading