Skip to content

Commit c9c0024

Browse files
authored
Merge branch 'main' into slow-query-logs-user-header
Signed-off-by: Markus Meyer <[email protected]>
2 parents 011501f + 863d914 commit c9c0024

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5293
-721
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,37 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
1212

1313
### Fixed
1414

15-
- [#7323](https://github.com/thanos-io/thanos/pull/7323) Sidecar: wait for prometheus on startup
1615
- [#7326](https://github.com/thanos-io/thanos/pull/7326) Query: fixing exemplars proxy when querying stores with multiple tenants.
1716
- [#7335](https://github.com/thanos-io/thanos/pull/7335) Dependency: Update minio-go to v7.0.70 which includes support for EKS Pod Identity.
18-
- [#6948](https://github.com/thanos-io/thanos/pull/6948) Receive: fix goroutines leak during series requests to thanos store api.
1917

2018
### Added
2119

2220
- [#7317](https://github.com/thanos-io/thanos/pull/7317) Tracing: allow specifying resource attributes for the OTLP configuration.
2321
- [#7367](https://github.com/thanos-io/thanos/pull/7367) Store Gateway: log request ID in request logs.
22+
- [#7361](https://github.com/thanos-io/thanos/pull/7361) Query: *breaking :warning:* pass query stats from remote execution from server to client. We changed the protobuf of the QueryAPI, if you use `query.mode=distributed` you need to update your client (upper level Queriers) first, before updating leaf Queriers (servers).
2423
- [#7363](https://github.com/thanos-io/thanos/pull/7363) Query-frontend: set value of remote_user field in Slow Query Logs from HTTP header
2524

2625
### Changed
2726

2827
- [#7334](https://github.com/thanos-io/thanos/pull/7334) Compactor: do not vertically compact downsampled blocks. Such cases are now marked with `no-compact-mark.json`. Fixes panic `panic: unexpected seriesToChunkEncoder lack of iterations`.
28+
- [#7393](https://github.com/thanos-io/thanos/pull/7393) *: *breaking :warning:* Using native histograms for grpc middleware metrics. Metrics `grpc_client_handling_seconds` and `grpc_server_handling_seconds` will now be native histograms, if you have enabled native histogram scraping you will need to update your PromQL expressions to use the new metric names.
29+
30+
### Removed
31+
32+
## [v0.35.1](https://github.com/thanos-io/thanos/tree/release-0.35) - 28.05.2024
33+
34+
### Fixed
35+
36+
- [#7323](https://github.com/thanos-io/thanos/pull/7323) Sidecar: wait for prometheus on startup
37+
- [#6948](https://github.com/thanos-io/thanos/pull/6948) Receive: fix goroutines leak during series requests to thanos store api.
38+
- [#7382](https://github.com/thanos-io/thanos/pull/7382) *: Ensure objstore flag values are masked & disable debug/pprof/cmdline
39+
- [#7392](https://github.com/thanos-io/thanos/pull/7392) Query: fix broken min, max for pre 0.34.1 sidecars
40+
- [#7373](https://github.com/thanos-io/thanos/pull/7373) Receive: Fix stats for remote write
41+
- [#7318](https://github.com/thanos-io/thanos/pull/7318) Compactor: Recover from panic to log block ID
42+
43+
### Added
44+
45+
### Changed
2946

3047
### Removed
3148

@@ -152,6 +169,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
152169
- [#6753](https://github.com/thanos-io/thanos/pull/6753) mixin(Rule): *breaking :warning:* Fixed the mixin rules with duplicate names and updated the promtool version from v0.37.0 to v0.47.0
153170
- [#6772](https://github.com/thanos-io/thanos/pull/6772) *: Bump prometheus to v0.47.2-0.20231006112807-a5a4eab679cc
154171
- [#6794](https://github.com/thanos-io/thanos/pull/6794) Receive: the exported HTTP metrics now uses the specified default tenant for requests where no tenants are found.
172+
- [#6651](https://github.com/thanos-io/thanos/pull/6651) *: Update go_grpc_middleware to v2.0.0. Remove Tags Interceptor from Thanos. Tags interceptor is removed from v2.0.0 go-grpc-middleware and is not needed anymore.
155173

156174
### Removed
157175

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![CI](https://github.com/thanos-io/thanos/workflows/CI/badge.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3ACI) [![CI](https://circleci.com/gh/thanos-io/thanos.svg?style=svg)](https://circleci.com/gh/thanos-io/thanos) [![go](https://github.com/thanos-io/thanos/workflows/go/badge.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Ago) [![react](https://github.com/thanos-io/thanos/workflows/react/badge.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Areact) [![docs](https://github.com/thanos-io/thanos/workflows/docs/badge.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Adocs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/thanos-io/thanos) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=109162639)
66

7-
> 📢 [ThanosCon](https://thanos.io/blog/2023-20-11-thanoscon/) is happening on 19th March as a co-located half-day on KubeCon EU in Paris. Join us there! 🤗 CFP is open until 3rd December!
7+
> 📢 [ThanosCon](https://events.linuxfoundation.org/kubecon-cloudnativecon-europe/co-located-events/thanoscon/) happened on 19th March 2024 as a co-located half-day on KubeCon EU in Paris.
88
99
## Overview
1010

cmd/thanos/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ func getFlagsMap(flags []*kingpin.FlagModel) map[string]string {
214214
if boilerplateFlags.GetFlag(f.Name) != nil {
215215
continue
216216
}
217+
// Mask inline objstore flag which can have credentials.
218+
if f.Name == "objstore.config" || f.Name == "objstore.config-file" {
219+
flagsMap[f.Name] = "<REDACTED>"
220+
continue
221+
}
217222
flagsMap[f.Name] = f.Value.String()
218223
}
219224

cmd/thanos/query.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/go-kit/log"
1818
"github.com/go-kit/log/level"
1919
grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
20-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/tags"
2120
"github.com/oklog/run"
2221
"github.com/opentracing/opentracing-go"
2322
"github.com/pkg/errors"
@@ -259,7 +258,8 @@ func registerQuery(app *extkingpin.App) {
259258
return errors.Wrap(err, "error while parsing config for request logging")
260259
}
261260

262-
tagOpts, grpcLogOpts, err := logging.ParsegRPCOptions(reqLogConfig)
261+
grpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(reqLogConfig)
262+
263263
if err != nil {
264264
return errors.Wrap(err, "error while parsing config for request logging")
265265
}
@@ -301,7 +301,7 @@ func registerQuery(app *extkingpin.App) {
301301
tracer,
302302
httpLogOpts,
303303
grpcLogOpts,
304-
tagOpts,
304+
logFilterMethods,
305305
grpcServerConfig,
306306
*grpcCompression,
307307
*secure,
@@ -383,7 +383,7 @@ func runQuery(
383383
tracer opentracing.Tracer,
384384
httpLogOpts []logging.Option,
385385
grpcLogOpts []grpc_logging.Option,
386-
tagOpts []tags.Option,
386+
logFilterMethods []string,
387387
grpcServerConfig grpcConfig,
388388
grpcCompression string,
389389
secure bool,
@@ -806,7 +806,7 @@ func runQuery(
806806
defaultEngineType := querypb.EngineType(querypb.EngineType_value[defaultEngine])
807807
grpcAPI := apiv1.NewGRPCAPI(time.Now, queryReplicaLabels, queryableCreator, engineFactory, defaultEngineType, lookbackDeltaCreator, instantDefaultMaxSourceResolution)
808808
storeServer := store.NewLimitedStoreServer(store.NewInstrumentedStoreServer(reg, proxy), reg, storeRateLimits)
809-
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, tagOpts, comp, grpcProbe,
809+
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, logFilterMethods, comp, grpcProbe,
810810
grpcserver.WithServer(apiv1.RegisterQueryServer(grpcAPI)),
811811
grpcserver.WithServer(store.RegisterStoreServer(storeServer, logger)),
812812
grpcserver.WithServer(rules.RegisterRulesServer(rulesProxy)),

cmd/thanos/query_frontend.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,19 @@ func runQueryFrontend(
352352
if !cfg.webDisableCORS {
353353
api.SetCORS(w)
354354
}
355-
tracing.HTTPMiddleware(
356-
tracer,
357-
name,
358-
logger,
359-
ins.NewHandler(
355+
middleware.RequestID(
356+
tracing.HTTPMiddleware(
357+
tracer,
360358
name,
361-
gzhttp.GzipHandler(
362-
middleware.RequestID(
359+
logger,
360+
ins.NewHandler(
361+
name,
362+
gzhttp.GzipHandler(
363363
logMiddleware.HTTPMiddleware(name, f),
364364
),
365365
),
366+
// Cortex frontend middlewares require orgID.
366367
),
367-
// Cortex frontend middlewares require orgID.
368368
).ServeHTTP(w, r.WithContext(user.InjectOrgID(r.Context(), orgId)))
369369
})
370370
return hf

cmd/thanos/receive.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/go-kit/log"
1616
"github.com/go-kit/log/level"
1717
grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
18-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/tags"
1918
"github.com/oklog/run"
2019
"github.com/opentracing/opentracing-go"
2120
"github.com/pkg/errors"
@@ -75,7 +74,8 @@ func registerReceive(app *extkingpin.App) {
7574
return errors.New("no external labels configured for receive, uniquely identifying external labels must be configured (ideally with `receive_` prefix); see https://thanos.io/tip/thanos/storage.md#external-labels for details.")
7675
}
7776

78-
tagOpts, grpcLogOpts, err := logging.ParsegRPCOptions(conf.reqLogConfig)
77+
grpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(conf.reqLogConfig)
78+
7979
if err != nil {
8080
return errors.Wrap(err, "error while parsing config for request logging")
8181
}
@@ -105,7 +105,8 @@ func registerReceive(app *extkingpin.App) {
105105
debugLogging,
106106
reg,
107107
tracer,
108-
grpcLogOpts, tagOpts,
108+
grpcLogOpts,
109+
logFilterMethods,
109110
tsdbOpts,
110111
lset,
111112
component.Receive,
@@ -123,7 +124,7 @@ func runReceive(
123124
reg *prometheus.Registry,
124125
tracer opentracing.Tracer,
125126
grpcLogOpts []grpc_logging.Option,
126-
tagOpts []tags.Option,
127+
logFilterMethods []string,
127128
tsdbOpts *tsdb.Options,
128129
lset labels.Labels,
129130
comp component.SourceStoreAPI,
@@ -359,7 +360,7 @@ func runReceive(
359360
info.WithExemplarsInfoFunc(),
360361
)
361362

362-
srv := grpcserver.New(logger, receive.NewUnRegisterer(reg), tracer, grpcLogOpts, tagOpts, comp, grpcProbe,
363+
srv := grpcserver.New(logger, receive.NewUnRegisterer(reg), tracer, grpcLogOpts, logFilterMethods, comp, grpcProbe,
363364
grpcserver.WithServer(store.RegisterStoreServer(rw, logger)),
364365
grpcserver.WithServer(store.RegisterWritableStoreServer(rw)),
365366
grpcserver.WithServer(exemplars.RegisterExemplarsServer(exemplars.NewMultiTSDB(dbs.TSDBExemplars))),

cmd/thanos/rule.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/go-kit/log"
2222
"github.com/go-kit/log/level"
2323
grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
24-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/tags"
2524
"github.com/oklog/run"
2625
"github.com/opentracing/opentracing-go"
2726
"github.com/pkg/errors"
@@ -234,7 +233,8 @@ func registerRule(app *extkingpin.App) {
234233
return errors.Wrap(err, "error while parsing config for request logging")
235234
}
236235

237-
tagOpts, grpcLogOpts, err := logging.ParsegRPCOptions(reqLogConfig)
236+
grpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(reqLogConfig)
237+
238238
if err != nil {
239239
return errors.Wrap(err, "error while parsing config for request logging")
240240
}
@@ -250,7 +250,7 @@ func registerRule(app *extkingpin.App) {
250250
getFlagsMap(cmd.Flags()),
251251
httpLogOpts,
252252
grpcLogOpts,
253-
tagOpts,
253+
logFilterMethods,
254254
tsdbOpts,
255255
agentOpts,
256256
)
@@ -314,7 +314,7 @@ func runRule(
314314
flagsMap map[string]string,
315315
httpLogOpts []logging.Option,
316316
grpcLogOpts []grpc_logging.Option,
317-
tagOpts []tags.Option,
317+
logFilterMethods []string,
318318
tsdbOpts *tsdb.Options,
319319
agentOpts *agent.Options,
320320
) error {
@@ -762,7 +762,7 @@ func runRule(
762762
options = append(options, grpcserver.WithServer(
763763
info.RegisterInfoServer(info.NewInfoServer(component.Rule.String(), infoOptions...)),
764764
))
765-
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, tagOpts, comp, grpcProbe, options...)
765+
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, logFilterMethods, comp, grpcProbe, options...)
766766

767767
g.Add(func() error {
768768
statusProber.Ready()

cmd/thanos/sidecar.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/go-kit/log"
1717
"github.com/go-kit/log/level"
1818
grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
19-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/tags"
2019
"github.com/oklog/run"
2120
"github.com/opentracing/opentracing-go"
2221
"github.com/pkg/errors"
@@ -59,7 +58,9 @@ func registerSidecar(app *extkingpin.App) {
5958
conf := &sidecarConfig{}
6059
conf.registerFlag(cmd)
6160
cmd.Setup(func(g *run.Group, logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, _ <-chan struct{}, _ bool) error {
62-
tagOpts, grpcLogOpts, err := logging.ParsegRPCOptions(conf.reqLogConfig)
61+
62+
grpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(conf.reqLogConfig)
63+
6364
if err != nil {
6465
return errors.Wrap(err, "error while parsing config for request logging")
6566
}
@@ -101,7 +102,7 @@ func registerSidecar(app *extkingpin.App) {
101102
extprom.WrapRegistererWithPrefix("thanos_sidecar_", reg),
102103
&opts)
103104

104-
return runSidecar(g, logger, reg, tracer, rl, component.Sidecar, *conf, httpClient, grpcLogOpts, tagOpts)
105+
return runSidecar(g, logger, reg, tracer, rl, component.Sidecar, *conf, httpClient, grpcLogOpts, logFilterMethods)
105106
})
106107
}
107108

@@ -115,7 +116,7 @@ func runSidecar(
115116
conf sidecarConfig,
116117
httpClient *http.Client,
117118
grpcLogOpts []grpc_logging.Option,
118-
tagOpts []tags.Option,
119+
logFilterMethods []string,
119120
) error {
120121

121122
var m = &promMetadata{
@@ -323,7 +324,7 @@ func runSidecar(
323324
)
324325

325326
storeServer := store.NewLimitedStoreServer(store.NewInstrumentedStoreServer(reg, promStore), reg, conf.storeRateLimits)
326-
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, tagOpts, comp, grpcProbe,
327+
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, logFilterMethods, comp, grpcProbe,
327328
grpcserver.WithServer(store.RegisterStoreServer(storeServer, logger)),
328329
grpcserver.WithServer(rules.RegisterRulesServer(rules.NewPrometheus(conf.prometheus.url, c, m.Labels))),
329330
grpcserver.WithServer(targets.RegisterTargetsServer(targets.NewPrometheus(conf.prometheus.url, c, m.Labels))),

cmd/thanos/store.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/go-kit/log"
1616
"github.com/go-kit/log/level"
1717
grpclogging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
18-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/tags"
1918
"github.com/oklog/run"
2019
"github.com/opentracing/opentracing-go"
2120
"github.com/pkg/errors"
@@ -241,7 +240,8 @@ func registerStore(app *extkingpin.App) {
241240
return errors.Wrap(err, "error while parsing config for request logging")
242241
}
243242

244-
tagOpts, grpcLogOpts, err := logging.ParsegRPCOptions(conf.reqLogConfig)
243+
grpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(conf.reqLogConfig)
244+
245245
if err != nil {
246246
return errors.Wrap(err, "error while parsing config for request logging")
247247
}
@@ -254,7 +254,7 @@ func registerStore(app *extkingpin.App) {
254254
tracer,
255255
httpLogOpts,
256256
grpcLogOpts,
257-
tagOpts,
257+
logFilterMethods,
258258
*conf,
259259
getFlagsMap(cmd.Flags()),
260260
)
@@ -269,7 +269,7 @@ func runStore(
269269
tracer opentracing.Tracer,
270270
httpLogOpts []logging.Option,
271271
grpcLogOpts []grpclogging.Option,
272-
tagOpts []tags.Option,
272+
logFilterMethods []string,
273273
conf storeConfig,
274274
flagsMap map[string]string,
275275
) error {
@@ -522,7 +522,7 @@ func runStore(
522522
}
523523

524524
storeServer := store.NewInstrumentedStoreServer(reg, bs)
525-
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, tagOpts, conf.component, grpcProbe,
525+
s := grpcserver.New(logger, reg, tracer, grpcLogOpts, logFilterMethods, conf.component, grpcProbe,
526526
grpcserver.WithServer(store.RegisterStoreServer(storeServer, logger)),
527527
grpcserver.WithServer(info.RegisterInfoServer(infoSrv)),
528528
grpcserver.WithListen(conf.grpcConfig.bindAddress),

0 commit comments

Comments
 (0)