Skip to content

Commit

Permalink
Merge branch 'release-0.19' into merge-v0.19
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	VERSION
#	cmd/thanos/receive.go
#	pkg/receive/handler_test.go
  • Loading branch information
bwplotka committed Apr 9, 2021
2 parents f1d0172 + ba6c5c4 commit 99899b2
Show file tree
Hide file tree
Showing 31 changed files with 221 additions and 211 deletions.
13 changes: 5 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan

We use _breaking :warning:_ to mark changes that are not backward compatible (relates only to v0.y.z releases.)

## Unreleased

### Added

- [#4029](https://github.com/thanos-io/thanos/pull/4029) Mixin: Remove dependency on the rule dashboard when generating the compact dashboard
- [#4019](https://github.com/thanos-io/thanos/pull/4019) Query: Adds query range histogram.
- [#3350](https://github.com/thanos-io/thanos/pull/3350) Query/Sidecar: Added targets API support. You can now configure you Querier to fetch Prometheus targets from leaf Prometheus-es!

### Added

- [#3977](https://github.com/thanos-io/thanos/pull/3903) Expose exemplars for `http_request_duration_seconds` histogram if tracing is enabled.
- [#3903](https://github.com/thanos-io/thanos/pull/3903) Store: Returning custom grpc code when reaching series/chunk limits.
- [#3919](https://github.com/thanos-io/thanos/pull/3919) Allow to disable automatically setting CORS headers using `--web.disable-cors` flag in each component that exposes an API.
Expand All @@ -40,9 +38,7 @@ We use _breaking :warning:_ to mark changes that are not backward compatible (re

### Removed

## [v0.19.0-rc.2](https://github.com/thanos-io/thanos/releases/tag/v0.19.0-rc.2) - 2021.03.24

### Added
## [v0.19.0](https://github.com/thanos-io/thanos/releases/tag/v0.19.0) - 2021.03.31

- [#3700](https://github.com/thanos-io/thanos/pull/3700) Compact/Web: Make old bucket viewer UI work with vanilla Prometheus blocks.
- [#3657](https://github.com/thanos-io/thanos/pull/3657) *: It's now possible to configure HTTP transport options for S3 client.
Expand All @@ -65,7 +61,8 @@ We use _breaking :warning:_ to mark changes that are not backward compatible (re
- [#3815](https://github.com/thanos-io/thanos/pull/3815) Receive: Improve handling of empty time series from clients
- [#3795](https://github.com/thanos-io/thanos/pull/3795) s3: A truncated "get object" response is reported as error.
- [#3899](https://github.com/thanos-io/thanos/pull/3899) Receive: Correct the inference of client gRPC configuration.
- [#3943](https://github.com/thanos-io/thanos/pull/3943): Receive: Fixed memory regression introduced in v0.17.0.
- [#3943](https://github.com/thanos-io/thanos/pull/3943) Receive: Fixed memory regression introduced in v0.17.0.
- [#3960](https://github.com/thanos-io/thanos/pull/3960) Query: Fixed deduplication of equal alerts with different labels.

### Changed

Expand Down
14 changes: 12 additions & 2 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func registerReceive(app *extkingpin.App) {
rwClientCert := cmd.Flag("remote-write.client-tls-cert", "TLS Certificates to use to identify this client to the server.").Default("").String()
rwClientKey := cmd.Flag("remote-write.client-tls-key", "TLS Key for the client's certificate.").Default("").String()
rwClientServerCA := cmd.Flag("remote-write.client-tls-ca", "TLS CA Certificates to use to verify servers.").Default("").String()
rwClientServerName := cmd.Flag("remote-write.client-server-name", "Server name to verify the hostname on the returned gRPC certificates. See https://tools.ietf.org/html/rfc4366#section-3.1").Default("").String()
rwClientServerName := cmd.Flag("remote-write.client-server-name", "Server name to verify the hostname on the returned TLS certificates. See https://tools.ietf.org/html/rfc4366#section-3.1").Default("").String()

dataDir := cmd.Flag("tsdb.path", "Data directory of TSDB.").
Default("./data").String()
Expand Down Expand Up @@ -233,7 +233,17 @@ func runReceive(
if err != nil {
return err
}
dialOpts, err := extgrpc.StoreClientGRPCOpts(logger, reg, tracer, rwServerCert != "", rwServerClientCA == "", rwClientCert, rwClientKey, rwClientServerCA, rwClientServerName)
dialOpts, err := extgrpc.StoreClientGRPCOpts(
logger,
reg,
tracer,
rwServerCert != "",
rwServerClientCA == "",
rwClientCert,
rwClientKey,
rwClientServerCA,
rwClientServerName,
)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion docs/components/receive.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Flags:
TLS CA Certificates to use to verify servers.
--remote-write.client-server-name=""
Server name to verify the hostname on the
returned gRPC certificates. See
returned TLS certificates. See
https://tools.ietf.org/html/rfc4366#section-3.1
--tsdb.path="./data" Data directory of TSDB.
--label=key="value" ... External labels to announce. This flag will be
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/query/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ func NewMetricMetadataHandler(client metadata.UnaryClient, enablePartialResponse
}

return func(r *http.Request) (interface{}, []error, *api.ApiError) {
req := &metadatapb.MetadataRequest{
req := &metadatapb.MetricMetadataRequest{
// By default we use -1, which means no limit.
Limit: -1,
Metric: r.URL.Query().Get("metric"),
Expand All @@ -924,7 +924,7 @@ func NewMetricMetadataHandler(client metadata.UnaryClient, enablePartialResponse
req.Limit = int32(limit)
}

t, warnings, err := client.Metadata(r.Context(), req)
t, warnings, err := client.MetricMetadata(r.Context(), req)
if err != nil {
return nil, nil, &api.ApiError{Typ: api.ErrorInternal, Err: errors.Wrap(err, "retrieving metadata")}
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (

var _ UnaryClient = &GRPCClient{}

// UnaryClient is gRPC metadatapb.Metadata client which expands streaming metadata API. Useful for consumers that does not
// UnaryClient is a gRPC metadatapb.Metadata client which expands streaming metadata API. Useful for consumers that does not
// support streaming.
type UnaryClient interface {
Metadata(ctx context.Context, req *metadatapb.MetadataRequest) (map[string][]metadatapb.Meta, storage.Warnings, error)
MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]metadatapb.Meta, storage.Warnings, error)
}

// GRPCClient allows to retrieve metadata from local gRPC streaming server implementation.
Expand All @@ -31,7 +31,7 @@ func NewGRPCClient(ts metadatapb.MetadataServer) *GRPCClient {
}
}

func (rr *GRPCClient) Metadata(ctx context.Context, req *metadatapb.MetadataRequest) (map[string][]metadatapb.Meta, storage.Warnings, error) {
func (rr *GRPCClient) MetricMetadata(ctx context.Context, req *metadatapb.MetricMetadataRequest) (map[string][]metadatapb.Meta, storage.Warnings, error) {
srv := &metadataServer{ctx: ctx, metric: req.Metric, limit: int(req.Limit)}

if req.Limit >= 0 {
Expand All @@ -46,16 +46,16 @@ func (rr *GRPCClient) Metadata(ctx context.Context, req *metadatapb.MetadataRequ
srv.metadataMap = make(map[string][]metadatapb.Meta)
}

if err := rr.proxy.Metadata(req, srv); err != nil {
return nil, nil, errors.Wrap(err, "proxy Metadata")
if err := rr.proxy.MetricMetadata(req, srv); err != nil {
return nil, nil, errors.Wrap(err, "proxy MetricMetadata")
}

return srv.metadataMap, srv.warnings, nil
}

type metadataServer struct {
// This field just exist to pseudo-implement the unused methods of the interface.
metadatapb.Metadata_MetadataServer
metadatapb.Metadata_MetricMetadataServer
ctx context.Context

metric string
Expand All @@ -65,7 +65,7 @@ type metadataServer struct {
metadataMap map[string][]metadatapb.Meta
}

func (srv *metadataServer) Send(res *metadatapb.MetadataResponse) error {
func (srv *metadataServer) Send(res *metadatapb.MetricMetadataResponse) error {
if res.GetWarning() != "" {
srv.warnings = append(srv.warnings, errors.New(res.GetWarning()))
return nil
Expand Down
12 changes: 6 additions & 6 deletions pkg/metadata/metadatapb/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
"unsafe"
)

func NewMetadataResponse(metadata *MetricMetadata) *MetadataResponse {
return &MetadataResponse{
Result: &MetadataResponse_Metadata{
func NewMetricMetadataResponse(metadata *MetricMetadata) *MetricMetadataResponse {
return &MetricMetadataResponse{
Result: &MetricMetadataResponse_Metadata{
Metadata: metadata,
},
}
}

func NewWarningMetadataResponse(warning error) *MetadataResponse {
return &MetadataResponse{
Result: &MetadataResponse_Warning{
func NewWarningMetadataResponse(warning error) *MetricMetadataResponse {
return &MetricMetadataResponse{
Result: &MetricMetadataResponse_Warning{
Warning: warning.Error(),
},
}
Expand Down
Loading

0 comments on commit 99899b2

Please sign in to comment.