Skip to content

Commit

Permalink
Merge branch 'main' into feature/remove-old-ui
Browse files Browse the repository at this point in the history
Signed-off-by: Augustin Husson <augustin.husson@amadeus.com>
  • Loading branch information
Nexucis committed May 22, 2021
2 parents beec37a + 063962c commit 66674d9
Show file tree
Hide file tree
Showing 137 changed files with 5,658 additions and 1,711 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
vendor: false
schedule:
interval: "weekly"
labels: ["dependencies"]
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
labels: ["dependencies"]

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ We use _breaking :warning:_ to mark changes that are not backward compatible (re

- [#4107](https://github.com/thanos-io/thanos/pull/4107) Store: `LabelNames` and `LabelValues` now support label matchers.
- [#4171](https://github.com/thanos-io/thanos/pull/4171) Docker: Busybox image updated to latest (1.33.1)
- [#4175](https://github.com/thanos-io/thanos/pull/4175) Added Tag Configuration Support Lightstep Tracing
- [#4176](https://github.com/thanos-io/thanos/pull/4176) Query API: Adds optional `Stats param` to return stats for query APIs
- [#4125](https://github.com/thanos-io/thanos/pull/4125) Rule: Add `--alert.relabel-config` / `--alert.relabel-config-file` allowing to specify alert relabel configurations like [Prometheus](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
- [#4211](https://github.com/thanos-io/thanos/pull/4211) Add TLS and basic authentication to Thanos APIs
- [#4249](https://github.com/thanos-io/thanos/pull/4249) UI: add dark theme
- [#4163](https://github.com/thanos-io/thanos/pull/4163) Old UI is removed in favor of the react-app.

### Fixed
Expand All @@ -24,6 +29,11 @@ We use _breaking :warning:_ to mark changes that are not backward compatible (re
-
### Removed
-
## [v0.20.2](https://github.com/thanos-io/thanos/releases/tag/v0.20.2) - 2021.05.20

### Fixed

- [#4208](https://github.com/thanos-io/thanos/pull/4208) UI: Fix infinite redirection loop on root (/).

## [v0.20.1](https://github.com/thanos-io/thanos/releases/tag/v0.20.1) - 2021.04.30

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ First of all please follow the [CODE_OF_CONDUCT](/CODE_OF_CONDUCT.md) in all you

The philosophy of Thanos and our community borrows heavily from UNIX philosophy and the Golang programming language.

* Each sub command should do one thing and do it well.
* Each subcommand should do one thing and do it well.
* eg. thanos query proxies incoming calls to known store API endpoints merging the result
* Write components that work together.
* e.g. blocks should be stored in native prometheus format
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions.
ARG SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM quay.io/prometheus/busybox@sha256:${SHA}
ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA}
LABEL maintainer="The Thanos Authors"

COPY /thanos_tmp_for_docker /bin/thanos
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.multi-stage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions.
ARG SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM golang:1.16-alpine3.12 as builder

WORKDIR $GOPATH/src/github.com/thanos-io/thanos
Expand All @@ -16,7 +16,7 @@ RUN git update-index --refresh; make build

# -----------------------------------------------------------------------------

FROM quay.io/prometheus/busybox@sha256:${SHA}
FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA}
LABEL maintainer="The Thanos Authors"

COPY --from=builder /go/bin/thanos /bin/thanos
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ DOCKER_IMAGE_REPO ?= quay.io/thanos/thanos
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short HEAD)
DOCKER_CI_TAG ?= test

SHA=''
BASE_DOCKER_SHA=''
arch = $(shell uname -m)
# Run `DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect quay.io/prometheus/busybox:latest` to get SHA or
# just visit https://quay.io/repository/prometheus/busybox?tag=latest&tab=tags.
# TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly (dependabot?)
# Update at 2020.2.01
# TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly.
# Update at 2021.6.07
ifeq ($(arch), x86_64)
# amd64
SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
BASE_DOCKER_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb"
else ifeq ($(arch), armv8)
# arm64
SHA="4dd2d3bba195563e6cb2b286f23dc832d0fda6c6662e6de2e86df454094b44d8"
BASE_DOCKER_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed"
else
echo >&2 "only support amd64 or arm64 arch" && exit 1
endif
Expand Down Expand Up @@ -147,7 +147,7 @@ docker: build
@echo ">> copying Thanos from $(PREFIX) to ./thanos_tmp_for_docker"
@cp $(PREFIX)/thanos ./thanos_tmp_for_docker
@echo ">> building docker image 'thanos'"
@docker build -t "thanos" --build-arg SHA=$(SHA) .
@docker build -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) .
@rm ./thanos_tmp_for_docker
else
docker: docker-multi-stage
Expand All @@ -157,7 +157,7 @@ endif
docker-multi-stage: ## Builds 'thanos' docker image using multi-stage.
docker-multi-stage:
@echo ">> building docker image 'thanos' with Dockerfile.multi-stage"
@docker build -f Dockerfile.multi-stage -t "thanos" --build-arg SHA=$(SHA) .
@docker build -f Dockerfile.multi-stage -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) .

.PHONY: docker-push
docker-push: ## Pushes 'thanos' docker image build to "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)".
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Deployment with Receive:

The philosophy of Thanos and our community is borrowing much from UNIX philosophy and the golang programming language.

* Each sub command should do one thing and do it well
* Each subcommand should do one thing and do it well
* eg. thanos query proxies incoming calls to known store API endpoints merging the result
* Write components that work together
* e.g. blocks should be stored in native prometheus format
Expand Down
3 changes: 2 additions & 1 deletion cmd/thanos/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func runCompact(
srv := httpserver.New(logger, reg, component, httpProbe,
httpserver.WithListen(conf.http.bindAddress),
httpserver.WithGracePeriod(time.Duration(conf.http.gracePeriod)),
httpserver.WithTLSConfig(conf.http.tlsConfig),
)

g.Add(func() error {
Expand Down Expand Up @@ -294,7 +295,7 @@ func runCompact(
}()
// Instantiate the compactor with different time slices. Timestamps in TSDB
// are in milliseconds.
comp, err := tsdb.NewLeveledCompactor(ctx, reg, logger, levels, downsample.NewPool())
comp, err := tsdb.NewLeveledCompactor(ctx, reg, logger, levels, downsample.NewPool(), nil)
if err != nil {
return errors.Wrap(err, "create compactor")
}
Expand Down
7 changes: 7 additions & 0 deletions cmd/thanos/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (gc *grpcConfig) registerFlag(cmd extkingpin.FlagClause) *grpcConfig {

type httpConfig struct {
bindAddress string
tlsConfig string
gracePeriod model.Duration
}

Expand All @@ -54,6 +55,10 @@ func (hc *httpConfig) registerFlag(cmd extkingpin.FlagClause) *httpConfig {
cmd.Flag("http-grace-period",
"Time to wait after an interrupt received for HTTP Server.").
Default("2m").SetValue(&hc.gracePeriod)
cmd.Flag(
"http.config",
"[EXPERIMENTAL] Path to the configuration file that can enable TLS or authentication for all HTTP endpoints.",
).Default("").StringVar(&hc.tlsConfig)
return hc
}

Expand Down Expand Up @@ -202,6 +207,7 @@ type alertMgrConfig struct {
alertmgrsDNSSDInterval time.Duration
alertExcludeLabels []string
alertQueryURL *string
alertRelabelConfigPath *extflag.PathOrContent
}

func (ac *alertMgrConfig) registerFlag(cmd extflag.FlagClause) *alertMgrConfig {
Expand All @@ -215,5 +221,6 @@ func (ac *alertMgrConfig) registerFlag(cmd extflag.FlagClause) *alertMgrConfig {
ac.alertQueryURL = cmd.Flag("alert.query-url", "The external Thanos Query URL that would be set in all alerts 'Source' field").String()
cmd.Flag("alert.label-drop", "Labels by name to drop before sending to alertmanager. This allows alert to be deduplicated on replica label (repeated). Similar Prometheus alert relabelling").
StringsVar(&ac.alertExcludeLabels)
ac.alertRelabelConfigPath = extflag.RegisterPathOrContent(cmd, "alert.relabel-config", "YAML file that contains alert relabelling configuration.", false)
return ac
}
2 changes: 2 additions & 0 deletions cmd/thanos/downsample.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func RunDownsample(
logger log.Logger,
reg *prometheus.Registry,
httpBindAddr string,
httpTLSConfig string,
httpGracePeriod time.Duration,
dataDir string,
objStoreConfig *extflag.PathOrContent,
Expand Down Expand Up @@ -136,6 +137,7 @@ func RunDownsample(
srv := httpserver.New(logger, reg, comp, httpProbe,
httpserver.WithListen(httpBindAddr),
httpserver.WithGracePeriod(httpGracePeriod),
httpserver.WithTLSConfig(httpTLSConfig),
)

g.Add(func() error {
Expand Down
5 changes: 4 additions & 1 deletion cmd/thanos/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func registerQuery(app *extkingpin.App) {
comp := component.Query
cmd := app.Command(comp.String(), "Query node exposing PromQL enabled Query API with data retrieved from multiple store nodes.")

httpBindAddr, httpGracePeriod := extkingpin.RegisterHTTPFlags(cmd)
httpBindAddr, httpGracePeriod, httpTLSConfig := extkingpin.RegisterHTTPFlags(cmd)
grpcBindAddr, grpcGracePeriod, grpcCert, grpcKey, grpcClientCA := extkingpin.RegisterGRPCFlags(cmd)

secure := cmd.Flag("grpc-client-tls-secure", "Use TLS when talking to the gRPC server").Default("false").Bool()
Expand Down Expand Up @@ -227,6 +227,7 @@ func registerQuery(app *extkingpin.App) {
*caCert,
*serverName,
*httpBindAddr,
*httpTLSConfig,
time.Duration(*httpGracePeriod),
*webRoutePrefix,
*webExternalPrefix,
Expand Down Expand Up @@ -287,6 +288,7 @@ func runQuery(
caCert string,
serverName string,
httpBindAddr string,
httpTLSConfig string,
httpGracePeriod time.Duration,
webRoutePrefix string,
webExternalPrefix string,
Expand Down Expand Up @@ -593,6 +595,7 @@ func runQuery(
srv := httpserver.New(logger, reg, comp, httpProbe,
httpserver.WithListen(httpBindAddr),
httpserver.WithGracePeriod(httpGracePeriod),
httpserver.WithTLSConfig(httpTLSConfig),
)
srv.Handle("/", router)

Expand Down
1 change: 1 addition & 0 deletions cmd/thanos/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func runQueryFrontend(
srv := httpserver.New(logger, reg, comp, httpProbe,
httpserver.WithListen(cfg.http.bindAddress),
httpserver.WithGracePeriod(time.Duration(cfg.http.gracePeriod)),
httpserver.WithTLSConfig(cfg.http.tlsConfig),
)

instr := func(f http.HandlerFunc) http.HandlerFunc {
Expand Down
Loading

0 comments on commit 66674d9

Please sign in to comment.