From ff9612dfab98a8ac7eb20dfefb0a44da25ce1019 Mon Sep 17 00:00:00 2001 From: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:15:09 +0530 Subject: [PATCH 01/31] adding flags Signed-off-by: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> --- cmd/thanos/compact.go | 3 ++ cmd/thanos/tools_bucket.go | 17 ++++--- pkg/api/blocks/v1.go | 22 ++++++--- .../src/thanos/pages/blocks/BlockDetails.tsx | 49 +++++++++++-------- 4 files changed, 56 insertions(+), 35 deletions(-) diff --git a/cmd/thanos/compact.go b/cmd/thanos/compact.go index 711e38daec..f8d5c6a7f5 100644 --- a/cmd/thanos/compact.go +++ b/cmd/thanos/compact.go @@ -678,6 +678,7 @@ type compactConfig struct { skipBlockWithOutOfOrderChunks bool progressCalculateInterval time.Duration filterConf *store.FilterConfig + disableAdminOperations bool } func (cc *compactConfig) registerFlag(cmd extkingpin.FlagClause) { @@ -786,4 +787,6 @@ func (cc *compactConfig) registerFlag(cmd extkingpin.FlagClause) { cc.webConf.registerFlag(cmd) cmd.Flag("bucket-web-label", "External block label to use as group title in the bucket web UI").StringVar(&cc.label) + + cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&cc.disableAdminOperations) } diff --git a/cmd/thanos/tools_bucket.go b/cmd/thanos/tools_bucket.go index 9a31444f0e..231ec2c0dc 100644 --- a/cmd/thanos/tools_bucket.go +++ b/cmd/thanos/tools_bucket.go @@ -112,13 +112,14 @@ type bucketLsConfig struct { } type bucketWebConfig struct { - webRoutePrefix string - webExternalPrefix string - webPrefixHeaderName string - webDisableCORS bool - interval time.Duration - label string - timeout time.Duration + webRoutePrefix string + webExternalPrefix string + webPrefixHeaderName string + webDisableCORS bool + interval time.Duration + label string + timeout time.Duration + disableAdminOperations bool } type bucketReplicateConfig struct { @@ -203,6 +204,8 @@ func (tbc *bucketWebConfig) registerBucketWebFlag(cmd extkingpin.FlagClause) *bu cmd.Flag("timeout", "Timeout to download metadata from remote storage").Default("5m").DurationVar(&tbc.timeout) cmd.Flag("label", "External block label to use as group title").StringVar(&tbc.label) + + cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&tbc.disableAdminOperations) return tbc } diff --git a/pkg/api/blocks/v1.go b/pkg/api/blocks/v1.go index 515c4623f7..c0da07d9bb 100644 --- a/pkg/api/blocks/v1.go +++ b/pkg/api/blocks/v1.go @@ -25,12 +25,13 @@ import ( // BlocksAPI is a very simple API used by Thanos Block Viewer. type BlocksAPI struct { - baseAPI *api.BaseAPI - logger log.Logger - globalBlocksInfo *BlocksInfo - loadedBlocksInfo *BlocksInfo - disableCORS bool - bkt objstore.Bucket + baseAPI *api.BaseAPI + logger log.Logger + globalBlocksInfo *BlocksInfo + loadedBlocksInfo *BlocksInfo + disableCORS bool + bkt objstore.Bucket + disableAdminOperations bool } type BlocksInfo struct { @@ -61,6 +62,7 @@ func parse(s string) ActionType { // NewBlocksAPI creates a simple API to be used by Thanos Block Viewer. func NewBlocksAPI(logger log.Logger, disableCORS bool, label string, flagsMap map[string]string, bkt objstore.Bucket) *BlocksAPI { + disableAdminOperations := flagsMap["disable-admin-operations"] == "true" return &BlocksAPI{ baseAPI: api.NewBaseAPI(logger, disableCORS, flagsMap), logger: logger, @@ -72,8 +74,9 @@ func NewBlocksAPI(logger log.Logger, disableCORS bool, label string, flagsMap ma Blocks: []metadata.Meta{}, Label: label, }, - disableCORS: disableCORS, - bkt: bkt, + disableCORS: disableCORS, + bkt: bkt, + disableAdminOperations: disableAdminOperations, } } @@ -87,6 +90,9 @@ func (bapi *BlocksAPI) Register(r *route.Router, tracer opentracing.Tracer, logg } func (bapi *BlocksAPI) markBlock(r *http.Request) (interface{}, []error, *api.ApiError, func()) { + if bapi.disableAdminOperations { + return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.New("Admin operations are disabled")}, func() {} + } idParam := r.FormValue("id") actionParam := r.FormValue("action") detailParam := r.FormValue("detail") diff --git a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx index 7e4573df41..63800d497f 100644 --- a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx +++ b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx @@ -4,6 +4,8 @@ import styles from './blocks.module.css'; import moment from 'moment'; import { Button, Modal, ModalBody, Form, Input, ModalHeader, ModalFooter } from 'reactstrap'; import { download } from './helpers'; +import { FlagMap } from '../../../pages/flags/Flags'; +import { useFetch } from '../../../hooks/useFetch'; export interface BlockDetailsProps { block: Block | undefined; @@ -40,6 +42,9 @@ export const BlockDetails: FC = ({ block, selectBlock }) => { } }; + const { response: flagsRes } = useFetch(`/api/v1/status/flags`); + const disableAdminOperations = flagsRes?.data?.['disable-admin-operations'] || false; + return (
{block && ( @@ -100,26 +105,30 @@ export const BlockDetails: FC = ({ block, selectBlock }) => {
-
- -
-
- -
+ {!disableAdminOperations && ( +
+ +
+ )} + {!disableAdminOperations && ( +
+ +
+ )} setModalAction('')}> From dae9fbc5b9e4ec39886bb89344e7481f1fc2a82e Mon Sep 17 00:00:00 2001 From: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> Date: Fri, 11 Aug 2023 21:06:52 +0530 Subject: [PATCH 02/31] adding changes requested in code review Signed-off-by: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> --- CHANGELOG.md | 4 +- cmd/thanos/compact.go | 2 +- cmd/thanos/tools_bucket.go | 2 +- docs/components/compact.md | 47 ++++--- docs/components/query-frontend.md | 68 ++++----- docs/components/query.md | 66 ++++----- docs/components/receive.md | 72 +++++----- docs/components/rule.md | 58 ++++---- docs/components/sidecar.md | 48 +++---- docs/components/store.md | 54 ++++---- docs/components/tools.md | 131 +++++++++--------- .../thanos/pages/blocks/BlockDetails.test.tsx | 1 + .../src/thanos/pages/blocks/BlockDetails.tsx | 50 +++---- .../src/thanos/pages/blocks/Blocks.tsx | 6 +- 14 files changed, 308 insertions(+), 301 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e14a5e6f..2e407afe62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -562,11 +562,11 @@ The binaries published with this release are built with Go1.17.8 to avoid [CVE-2 ### Changed -- +- ### Removed -- +- ## [v0.20.0](https://github.com/thanos-io/thanos/releases/tag/v0.20.0) - 2021.04.28 diff --git a/cmd/thanos/compact.go b/cmd/thanos/compact.go index f8d5c6a7f5..7ab7e05639 100644 --- a/cmd/thanos/compact.go +++ b/cmd/thanos/compact.go @@ -788,5 +788,5 @@ func (cc *compactConfig) registerFlag(cmd extkingpin.FlagClause) { cmd.Flag("bucket-web-label", "External block label to use as group title in the bucket web UI").StringVar(&cc.label) - cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&cc.disableAdminOperations) + cmd.Flag("disable-admin-operations", "Disable UI/API admin operations like marking blocks for deletion and no compaction.").Default("false").BoolVar(&cc.disableAdminOperations) } diff --git a/cmd/thanos/tools_bucket.go b/cmd/thanos/tools_bucket.go index 231ec2c0dc..754a639517 100644 --- a/cmd/thanos/tools_bucket.go +++ b/cmd/thanos/tools_bucket.go @@ -205,7 +205,7 @@ func (tbc *bucketWebConfig) registerBucketWebFlag(cmd extkingpin.FlagClause) *bu cmd.Flag("label", "External block label to use as group title").StringVar(&tbc.label) - cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&tbc.disableAdminOperations) + cmd.Flag("disable-admin-operations", "Disable UI/API admin operations like marking blocks for deletion and no compaction.").Default("false").BoolVar(&tbc.disableAdminOperations) return tbc } diff --git a/docs/components/compact.md b/docs/components/compact.md index 958ea07b21..dbc7f7d153 100644 --- a/docs/components/compact.md +++ b/docs/components/compact.md @@ -279,28 +279,28 @@ usage: thanos compact [] Continuously compacts blocks in an object store bucket. Flags: - --block-files-concurrency=1 + --block-files-concurrency=1 Number of goroutines to use when fetching/uploading block files from object storage. - --block-meta-fetch-concurrency=32 + --block-meta-fetch-concurrency=32 Number of goroutines to use when fetching block metadata from object storage. - --block-viewer.global.sync-block-interval=1m + --block-viewer.global.sync-block-interval=1m Repeat interval for syncing the blocks between local and remote view for /global Block Viewer UI. - --block-viewer.global.sync-block-timeout=5m + --block-viewer.global.sync-block-timeout=5m Maximum time for syncing the blocks between local and remote view for /global Block Viewer UI. - --bucket-web-label=BUCKET-WEB-LABEL + --bucket-web-label=BUCKET-WEB-LABEL External block label to use as group title in the bucket web UI - --compact.blocks-fetch-concurrency=1 + --compact.blocks-fetch-concurrency=1 Number of goroutines to use when download block during compaction. - --compact.cleanup-interval=5m + --compact.cleanup-interval=5m How often we should clean up partially uploaded blocks and blocks with deletion mark in the background when --wait has been enabled. Setting @@ -308,7 +308,7 @@ Flags: happen at the end of an iteration. --compact.concurrency=1 Number of goroutines to use when compacting groups. - --compact.progress-interval=5m + --compact.progress-interval=5m Frequency of calculating the compaction progress in the background when --wait has been enabled. Setting it to "0s" disables it. Now compaction, @@ -329,7 +329,7 @@ Flags: based deduplication algorithm will be used. At least one replica label has to be set via --deduplication.replica-label flag. - --deduplication.replica-label=DEDUPLICATION.REPLICA-LABEL ... + --deduplication.replica-label=DEDUPLICATION.REPLICA-LABEL ... Label to treat as a replica indicator of blocks that can be deduplicated (repeated flag). This will merge multiple replica blocks into one. @@ -355,7 +355,10 @@ Flags: block loaded, or compactor is ignoring the deletion because it's compacting the block at the same time. - --downsample.concurrency=1 + --disable-admin-operations + Disable UI/API admin operations like marking + blocks for deletion and no compaction. + --downsample.concurrency=1 Number of goroutines to use when downsampling blocks. --downsampling.disable Disables downsampling. This is not recommended @@ -371,7 +374,7 @@ Flags: Possible values are: "", "SHA256". -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -381,7 +384,7 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --max-time=9999-12-31T23:59:59Z + --max-time=9999-12-31T23:59:59Z End of time range limit to compact. Thanos Compactor will compact only blocks, which happened earlier than this value. Option @@ -389,36 +392,36 @@ Flags: duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --min-time=0000-01-01T00:00:00Z + --min-time=0000-01-01T00:00:00Z Start of time range limit to compact. Thanos Compactor will compact only blocks, which happened later than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --retention.resolution-1h=0d + --retention.resolution-1h=0d How long to retain samples of resolution 2 (1 hour) in bucket. Setting this to 0d will retain samples of this resolution forever - --retention.resolution-5m=0d + --retention.resolution-5m=0d How long to retain samples of resolution 1 (5 minutes) in bucket. Setting this to 0d will retain samples of this resolution forever - --retention.resolution-raw=0d + --retention.resolution-raw=0d How long to retain raw samples in bucket. Setting this to 0d will retain samples of this resolution forever - --selector.relabel-config= + --selector.relabel-config= Alternative to 'selector.relabel-config-file' flag (mutually exclusive). Content of YAML file that contains relabeling @@ -426,18 +429,18 @@ Flags: blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - --selector.relabel-config-file= + --selector.relabel-config-file= Path to YAML file that contains relabeling configuration that allows selecting blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/query-frontend.md b/docs/components/query-frontend.md index 20e197d7db..5ddd032aed 100644 --- a/docs/components/query-frontend.md +++ b/docs/components/query-frontend.md @@ -185,46 +185,46 @@ Query frontend command implements a service deployed in front of queriers to improve query parallelization and caching. Flags: - --cache-compression-type="" + --cache-compression-type="" Use compression in results cache. Supported values are: 'snappy' and ” (disable compression). -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. --http.config="" [EXPERIMENTAL] Path to the configuration file that can enable TLS or authentication for all HTTP endpoints. - --labels.default-time-range=24h + --labels.default-time-range=24h The default metadata time range duration for retrieving labels through Labels and Series API when the range parameters are not specified. - --labels.max-query-parallelism=14 + --labels.max-query-parallelism=14 Maximum number of labels requests will be scheduled in parallel by the Frontend. - --labels.max-retries-per-request=5 + --labels.max-retries-per-request=5 Maximum number of retries for a single label/series API request; beyond this, the downstream error is returned. --labels.partial-response Enable partial response for labels requests if no partial_response param is specified. --no-labels.partial-response for disabling. - --labels.response-cache-config= + --labels.response-cache-config= Alternative to 'labels.response-cache-config-file' flag (mutually exclusive). Content of YAML file that contains response cache configuration. - --labels.response-cache-config-file= + --labels.response-cache-config-file= Path to YAML file that contains response cache configuration. - --labels.response-cache-max-freshness=1m + --labels.response-cache-max-freshness=1m Most recent allowed cacheable result for labels requests, to prevent caching very recent results that might still be in flux. - --labels.split-interval=24h + --labels.split-interval=24h Split labels requests by an interval and execute in parallel, it should be greater than 0 when labels.response-cache-config is @@ -241,9 +241,9 @@ Flags: LogStartAndFinishCall : Logs the start and finish call of the requests. NoLogCall : Disable request logging. - --query-frontend.compress-responses + --query-frontend.compress-responses Compress HTTP responses. - --query-frontend.downstream-tripper-config= + --query-frontend.downstream-tripper-config= Alternative to 'query-frontend.downstream-tripper-config-file' flag (mutually exclusive). Content of YAML file @@ -252,23 +252,23 @@ Flags: 127.0.0.1 then it is highly recommended to increase max_idle_conns_per_host to at least 100. - --query-frontend.downstream-tripper-config-file= + --query-frontend.downstream-tripper-config-file= Path to YAML file that contains downstream tripper configuration. If your downstream URL is localhost or 127.0.0.1 then it is highly recommended to increase max_idle_conns_per_host to at least 100. - --query-frontend.downstream-url="http://localhost:9090" + --query-frontend.downstream-url="http://localhost:9090" URL of downstream Prometheus Query compatible API. - --query-frontend.forward-header= ... + --query-frontend.forward-header= ... List of headers forwarded by the query-frontend to downstream queriers, default is empty - --query-frontend.log-queries-longer-than=0 + --query-frontend.log-queries-longer-than=0 Log queries that are slower than the specified duration. Set to 0 to disable. Set to < 0 to enable on all queries. - --query-frontend.org-id-header= ... + --query-frontend.org-id-header= ... Request header names used to identify the source of slow queries (repeated flag). The values of the header will be added to @@ -276,37 +276,37 @@ Flags: multiple headers match the request, the first matching arg specified will take precedence. If no headers match 'anonymous' will be used. - --query-frontend.vertical-shards=QUERY-FRONTEND.VERTICAL-SHARDS + --query-frontend.vertical-shards=QUERY-FRONTEND.VERTICAL-SHARDS Number of shards to use when distributing shardable PromQL queries. For more details, you can refer to the Vertical query sharding proposal: https://thanos.io/tip/proposals-accepted/202205-vertical-query-sharding.md - --query-range.align-range-with-step + --query-range.align-range-with-step Mutate incoming queries to align their start and end with their step for better cache-ability. Note: Grafana dashboards do that by default. - --query-range.horizontal-shards=0 + --query-range.horizontal-shards=0 Split queries in this many requests when query duration is below query-range.max-split-interval. - --query-range.max-query-length=0 + --query-range.max-query-length=0 Limit the query time range (end - start time) in the query-frontend, 0 disables it. - --query-range.max-query-parallelism=14 + --query-range.max-query-parallelism=14 Maximum number of query range requests will be scheduled in parallel by the Frontend. - --query-range.max-retries-per-request=5 + --query-range.max-retries-per-request=5 Maximum number of retries for a single query range request; beyond this, the downstream error is returned. - --query-range.max-split-interval=0 + --query-range.max-split-interval=0 Split query range below this interval in query-range.horizontal-shards. Queries with a range longer than this value will be split in multiple requests of this length. - --query-range.min-split-interval=0 + --query-range.min-split-interval=0 Split query range requests above this interval in query-range.horizontal-shards requests of equal range. Using @@ -314,48 +314,48 @@ Flags: query-range.split-interval. One should also set query-range.split-min-horizontal-shards to a value greater than 1 to enable splitting. - --query-range.partial-response + --query-range.partial-response Enable partial response for query range requests if no partial_response param is specified. --no-query-range.partial-response for disabling. - --query-range.request-downsampled + --query-range.request-downsampled Make additional query for downsampled data in case of empty or incomplete response to range request. - --query-range.response-cache-config= + --query-range.response-cache-config= Alternative to 'query-range.response-cache-config-file' flag (mutually exclusive). Content of YAML file that contains response cache configuration. - --query-range.response-cache-config-file= + --query-range.response-cache-config-file= Path to YAML file that contains response cache configuration. - --query-range.response-cache-max-freshness=1m + --query-range.response-cache-max-freshness=1m Most recent allowed cacheable result for query range requests, to prevent caching very recent results that might still be in flux. - --query-range.split-interval=24h + --query-range.split-interval=24h Split query range requests by an interval and execute in parallel, it should be greater than 0 when query-range.response-cache-config is configured. - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/query.md b/docs/components/query.md index 7142472a0b..b87314dfc3 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -269,7 +269,7 @@ Query node exposing PromQL enabled Query API with data retrieved from multiple store nodes. Flags: - --alert.query-url=ALERT.QUERY-URL + --alert.query-url=ALERT.QUERY-URL The external Thanos Query URL that would be set in all alerts 'Source' field. --enable-feature= ... Comma separated experimental feature names @@ -280,27 +280,27 @@ Flags: prefixed with 'dns+' or 'dnssrv+' to detect Thanos API servers through respective DNS lookups. - --endpoint-group= ... + --endpoint-group= ... Experimental: DNS name of statically configured Thanos API server groups (repeatable). Targets resolved from the DNS name will be queried in a round-robin, instead of a fanout manner. This flag should be used when connecting a Thanos Query to HA groups of Thanos components. - --endpoint-group-strict= ... + --endpoint-group-strict= ... Experimental: DNS name of statically configured Thanos API server groups (repeatable) that are always used, even if the health check fails. - --endpoint-strict= ... + --endpoint-strict= ... Addresses of only statically configured Thanos API servers that are always used, even if the health check fails. Useful if you have a caching layer on top. - --grpc-address="0.0.0.0:10901" + --grpc-address="0.0.0.0:10901" Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components. - --grpc-client-server-name="" + --grpc-client-server-name="" Server name to verify the hostname on the returned gRPC certificates. See https://tools.ietf.org/html/rfc4366#section-3.1 @@ -310,20 +310,20 @@ Flags: to the server --grpc-client-tls-key="" TLS Key for the client's certificate --grpc-client-tls-secure Use TLS when talking to the gRPC server - --grpc-client-tls-skip-verify + --grpc-client-tls-skip-verify Disable TLS certificate verification i.e self signed, signed by fake CA --grpc-compression=none Compression algorithm to use for gRPC requests to other clients. Must be one of: snappy, none --grpc-grace-period=2m Time to wait after an interrupt received for GRPC Server. - --grpc-server-max-connection-age=60m + --grpc-server-max-connection-age=60m The grpc server max connection age. This controls how often to re-establish connections and redo TLS handshakes. --grpc-server-tls-cert="" TLS Certificate for gRPC server, leave blank to disable TLS - --grpc-server-tls-client-ca="" + --grpc-server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) @@ -331,7 +331,7 @@ Flags: disable TLS -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -350,16 +350,16 @@ Flags: LogStartAndFinishCall: Logs the start and finish call of the requests. NoLogCall: Disable request logging. - --query.active-query-path="" + --query.active-query-path="" Directory to log currently active queries in the queries.active file. --query.auto-downsampling Enable automatic adjustment (step / 5) to what source of data should be used in store gateways if no max_source_resolution param is specified. - --query.conn-metric.label=external_labels... ... + --query.conn-metric.label=external_labels... ... Optional selection of query connection metric labels to be collected from endpoint set - --query.default-evaluation-interval=1m + --query.default-evaluation-interval=1m Set default evaluation interval for sub queries. --query.default-step=1s Set default step for range queries. Default @@ -369,7 +369,7 @@ Flags: = max(rangeSeconds / 250, defaultStep)). This will not work from Grafana, but Grafana has __step variable which can be used. - --query.lookback-delta=QUERY.LOOKBACK-DELTA + --query.lookback-delta=QUERY.LOOKBACK-DELTA The maximum lookback duration for retrieving metrics during expression evaluations. PromQL always evaluates the query for the @@ -384,10 +384,10 @@ Flags: If unset it will use the promql default of 5m. --query.max-concurrent=20 Maximum number of queries processed concurrently by query node. - --query.max-concurrent-select=4 + --query.max-concurrent-select=4 Maximum number of select requests made concurrently per a query. - --query.metadata.default-time-range=0s + --query.metadata.default-time-range=0s The default metadata time range duration for retrieving labels through Labels and Series API when the range parameters are not specified. @@ -396,35 +396,35 @@ Flags: --query.partial-response Enable partial response for queries if no partial_response param is specified. --no-query.partial-response for disabling. - --query.promql-engine=prometheus + --query.promql-engine=prometheus Default PromQL engine to use. - --query.replica-label=QUERY.REPLICA-LABEL ... + --query.replica-label=QUERY.REPLICA-LABEL ... Labels to treat as a replica indicator along which data is deduplicated. Still you will be able to query without deduplication using 'dedup=false' parameter. Data includes time series, recording rules, and alerting rules. - --query.telemetry.request-duration-seconds-quantiles=0.1... ... + --query.telemetry.request-duration-seconds-quantiles=0.1... ... The quantiles for exporting metrics about the request duration quantiles. - --query.telemetry.request-samples-quantiles=100... ... + --query.telemetry.request-samples-quantiles=100... ... The quantiles for exporting metrics about the samples count quantiles. - --query.telemetry.request-series-seconds-quantiles=10... ... + --query.telemetry.request-series-seconds-quantiles=10... ... The quantiles for exporting metrics about the series count quantiles. --query.timeout=2m Maximum time to process query by query node. - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --selector-label=="" ... + --selector-label=="" ... Query selector labels that will be exposed in info endpoint (repeated). --store= ... Deprecation Warning - This flag is deprecated @@ -433,46 +433,46 @@ Flags: (repeatable). The scheme may be prefixed with 'dns+' or 'dnssrv+' to detect store API servers through respective DNS lookups. - --store-strict= ... + --store-strict= ... Deprecation Warning - This flag is deprecated and replaced with `endpoint-strict`. Addresses of only statically configured store API servers that are always used, even if the health check fails. Useful if you have a caching layer on top. - --store.limits.request-samples=0 + --store.limits.request-samples=0 The maximum samples allowed for a single Series request, The Series call fails if this limit is exceeded. 0 means no limit. NOTE: For efficiency the limit is internally implemented as 'chunks limit' considering each chunk contains a maximum of 120 samples. - --store.limits.request-series=0 + --store.limits.request-series=0 The maximum series allowed for a single Series request. The Series call fails if this limit is exceeded. 0 means no limit. - --store.response-timeout=0ms + --store.response-timeout=0ms If a Store doesn't send any data in this specified duration then a Store will be ignored and partial data will be returned if it's enabled. 0 disables timeout. - --store.sd-dns-interval=30s + --store.sd-dns-interval=30s Interval between DNS resolutions. - --store.sd-files= ... + --store.sd-files= ... Path to files that contain addresses of store API servers. The path can be a glob pattern (repeatable). --store.sd-interval=5m Refresh interval to re-read file SD files. It is used as a resync fallback. - --store.unhealthy-timeout=5m + --store.unhealthy-timeout=5m Timeout before an unhealthy store is cleaned from the store UI page. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/receive.md b/docs/components/receive.md index 8ec28f9af6..371e5f4a7f 100644 --- a/docs/components/receive.md +++ b/docs/components/receive.md @@ -256,19 +256,19 @@ usage: thanos receive [] Accept Prometheus remote write API requests and write to local tsdb. Flags: - --grpc-address="0.0.0.0:10901" + --grpc-address="0.0.0.0:10901" Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components. --grpc-grace-period=2m Time to wait after an interrupt received for GRPC Server. - --grpc-server-max-connection-age=60m + --grpc-server-max-connection-age=60m The grpc server max connection age. This controls how often to re-establish connections and redo TLS handshakes. --grpc-server-tls-cert="" TLS Certificate for gRPC server, leave blank to disable TLS - --grpc-server-tls-client-ca="" + --grpc-server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) @@ -282,7 +282,7 @@ Flags: Possible values are: "", "SHA256". -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -295,125 +295,125 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --receive.default-tenant-id="default-tenant" + --receive.default-tenant-id="default-tenant" Default tenant ID to use when none is provided via a header. - --receive.grpc-compression=snappy + --receive.grpc-compression=snappy Compression algorithm to use for gRPC requests to other receivers. Must be one of: snappy, none - --receive.hashrings= + --receive.hashrings= Alternative to 'receive.hashrings-file' flag (lower priority). Content of file that contains the hashring configuration. - --receive.hashrings-algorithm=hashmod + --receive.hashrings-algorithm=hashmod The algorithm used when distributing series in the hashrings. Must be one of hashmod, ketama. Will be overwritten by the tenant-specific algorithm in the hashring config. - --receive.hashrings-file= + --receive.hashrings-file= Path to file that contains the hashring configuration. A watcher is initialized to watch changes and update the hashring dynamically. - --receive.hashrings-file-refresh-interval=5m + --receive.hashrings-file-refresh-interval=5m Refresh interval to re-read the hashring configuration file. (used as a fallback) - --receive.local-endpoint=RECEIVE.LOCAL-ENDPOINT + --receive.local-endpoint=RECEIVE.LOCAL-ENDPOINT Endpoint of local receive node. Used to identify the local node in the hashring configuration. If it's empty AND hashring configuration was provided, it means that receive will run in RoutingOnly mode. - --receive.relabel-config= + --receive.relabel-config= Alternative to 'receive.relabel-config-file' flag (mutually exclusive). Content of YAML file that contains relabeling configuration. - --receive.relabel-config-file= + --receive.relabel-config-file= Path to YAML file that contains relabeling configuration. - --receive.replica-header="THANOS-REPLICA" + --receive.replica-header="THANOS-REPLICA" HTTP header specifying the replica number of a write request. - --receive.replication-factor=1 + --receive.replication-factor=1 How many times to replicate incoming write requests. - --receive.tenant-certificate-field= + --receive.tenant-certificate-field= Use TLS client's certificate field to determine tenant for write requests. Must be one of organization, organizationalUnit or commonName. This setting will cause the receive.tenant-header flag value to be ignored. - --receive.tenant-header="THANOS-TENANT" + --receive.tenant-header="THANOS-TENANT" HTTP header to determine tenant for write requests. - --receive.tenant-label-name="tenant_id" + --receive.tenant-label-name="tenant_id" Label name through which the tenant will be announced. - --remote-write.address="0.0.0.0:19291" + --remote-write.address="0.0.0.0:19291" Address to listen on for remote write requests. - --remote-write.client-server-name="" + --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 - --remote-write.client-tls-ca="" + --remote-write.client-tls-ca="" TLS CA Certificates to use to verify servers. - --remote-write.client-tls-cert="" + --remote-write.client-tls-cert="" TLS Certificates to use to identify this client to the server. - --remote-write.client-tls-key="" + --remote-write.client-tls-key="" TLS Key for the client's certificate. - --remote-write.server-tls-cert="" + --remote-write.server-tls-cert="" TLS Certificate for HTTP server, leave blank to disable TLS. - --remote-write.server-tls-client-ca="" + --remote-write.server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) - --remote-write.server-tls-key="" + --remote-write.server-tls-key="" TLS Key for the HTTP server, leave blank to disable TLS. - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --store.limits.request-samples=0 + --store.limits.request-samples=0 The maximum samples allowed for a single Series request, The Series call fails if this limit is exceeded. 0 means no limit. NOTE: For efficiency the limit is internally implemented as 'chunks limit' considering each chunk contains a maximum of 120 samples. - --store.limits.request-series=0 + --store.limits.request-series=0 The maximum series allowed for a single Series request. The Series call fails if this limit is exceeded. 0 means no limit. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tsdb.allow-overlapping-blocks + --tsdb.allow-overlapping-blocks Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge. Does not do anything, enabled all the time. @@ -437,7 +437,7 @@ Flags: refer to the Tenant lifecycle management section in the Receive documentation: https://thanos.io/tip/components/receive.md/#tenant-lifecycle-management - --tsdb.too-far-in-future.time-window=0s + --tsdb.too-far-in-future.time-window=0s [EXPERIMENTAL] Configures the allowed time window for ingesting samples too far in the future. Disabled (0s) by defaultPlease note diff --git a/docs/components/rule.md b/docs/components/rule.md index 93e5e91cfe..946f3ea49c 100644 --- a/docs/components/rule.md +++ b/docs/components/rule.md @@ -262,22 +262,22 @@ Ruler evaluating Prometheus rules against given Query nodes, exposing Store API and storing old blocks in bucket. Flags: - --alert.label-drop=ALERT.LABEL-DROP ... + --alert.label-drop=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 - --alert.query-url=ALERT.QUERY-URL + --alert.query-url=ALERT.QUERY-URL The external Thanos Query URL that would be set in all alerts 'Source' field - --alert.relabel-config= + --alert.relabel-config= Alternative to 'alert.relabel-config-file' flag (mutually exclusive). Content of YAML file that contains alert relabelling configuration. - --alert.relabel-config-file= + --alert.relabel-config-file= Path to YAML file that contains alert relabelling configuration. - --alertmanagers.config= + --alertmanagers.config= Alternative to 'alertmanagers.config-file' flag (mutually exclusive). Content of YAML file that contains alerting @@ -286,19 +286,19 @@ Flags: If defined, it takes precedence over the '--alertmanagers.url' and '--alertmanagers.send-timeout' flags. - --alertmanagers.config-file= + --alertmanagers.config-file= Path to YAML file that contains alerting configuration. See format details: https://thanos.io/tip/components/rule.md/#configuration. If defined, it takes precedence over the '--alertmanagers.url' and '--alertmanagers.send-timeout' flags. - --alertmanagers.sd-dns-interval=30s + --alertmanagers.sd-dns-interval=30s Interval between DNS resolutions of Alertmanager hosts. - --alertmanagers.send-timeout=10s + --alertmanagers.send-timeout=10s Timeout for sending alerts to Alertmanager - --alertmanagers.url=ALERTMANAGERS.URL ... + --alertmanagers.url=ALERTMANAGERS.URL ... Alertmanager replica URLs to push firing alerts. Ruler claims success if push to at least one alertmanager from discovered @@ -317,19 +317,19 @@ Flags: period. --for-outage-tolerance=1h Max time to tolerate prometheus outage for restoring "for" state of alert. - --grpc-address="0.0.0.0:10901" + --grpc-address="0.0.0.0:10901" Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components. --grpc-grace-period=2m Time to wait after an interrupt received for GRPC Server. - --grpc-server-max-connection-age=60m + --grpc-server-max-connection-age=60m The grpc server max connection age. This controls how often to re-establish connections and redo TLS handshakes. --grpc-server-tls-cert="" TLS Certificate for gRPC server, leave blank to disable TLS - --grpc-server-tls-client-ca="" + --grpc-server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) @@ -343,14 +343,14 @@ Flags: Possible values are: "", "SHA256". -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. --http.config="" [EXPERIMENTAL] Path to the configuration file that can enable TLS or authentication for all HTTP endpoints. - --label=="" ... + --label=="" ... Labels to be applied to all generated metrics (repeated). Similar to external labels for Prometheus, used to identify ruler and its @@ -367,13 +367,13 @@ Flags: LogStartAndFinishCall: Logs the start and finish call of the requests. NoLogCall: Disable request logging. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration @@ -389,7 +389,7 @@ Flags: https://thanos.io/tip/components/rule.md/#configuration. If defined, it takes precedence over the '--query' and '--query.sd-files' flags. - --query.config-file= + --query.config-file= Path to YAML file that contains query API servers configuration. See format details: https://thanos.io/tip/components/rule.md/#configuration. @@ -400,15 +400,15 @@ Flags: restoration. --query.http-method=POST HTTP method to use when sending queries. Possible options: [GET, POST] - --query.sd-dns-interval=30s + --query.sd-dns-interval=30s Interval between DNS resolutions. - --query.sd-files= ... + --query.sd-files= ... Path to file that contains addresses of query API servers. The path can be a glob pattern (repeatable). --query.sd-interval=5m Refresh interval to re-read file SD files. (used as a fallback) - --remote-write.config= + --remote-write.config= Alternative to 'remote-write.config-file' flag (mutually exclusive). Content of YAML config for the remote-write @@ -420,7 +420,7 @@ Flags: ruler's TSDB. If an empty config (or file) is provided, the flag is ignored and ruler is run with its own TSDB. - --remote-write.config-file= + --remote-write.config-file= Path to YAML config for the remote-write configurations, that specify servers where samples should be sent to (see @@ -430,19 +430,19 @@ Flags: ruler's TSDB. If an empty config (or file) is provided, the flag is ignored and ruler is run with its own TSDB. - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration --resend-delay=1m Minimum amount of time to wait before resending an alert to Alertmanager. - --restore-ignored-label=RESTORE-IGNORED-LABEL ... + --restore-ignored-label=RESTORE-IGNORED-LABEL ... Label names to be ignored when restoring alerts from the remote storage. This is only used in stateless mode. @@ -451,29 +451,29 @@ Flags: Note that rules are not automatically detected, use SIGHUP or do HTTP POST /-/reload to re-read them. - --shipper.upload-compacted + --shipper.upload-compacted If true shipper will try to upload compacted blocks as well. Useful for migration purposes. Works only if compaction is disabled on Prometheus. Do it once and then disable the flag when done. - --store.limits.request-samples=0 + --store.limits.request-samples=0 The maximum samples allowed for a single Series request, The Series call fails if this limit is exceeded. 0 means no limit. NOTE: For efficiency the limit is internally implemented as 'chunks limit' considering each chunk contains a maximum of 120 samples. - --store.limits.request-series=0 + --store.limits.request-series=0 The maximum series allowed for a single Series request. The Series call fails if this limit is exceeded. 0 means no limit. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/sidecar.md b/docs/components/sidecar.md index 9bc309734a..13bde923ce 100644 --- a/docs/components/sidecar.md +++ b/docs/components/sidecar.md @@ -76,19 +76,19 @@ usage: thanos sidecar [] Sidecar for Prometheus server. Flags: - --grpc-address="0.0.0.0:10901" + --grpc-address="0.0.0.0:10901" Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components. --grpc-grace-period=2m Time to wait after an interrupt received for GRPC Server. - --grpc-server-max-connection-age=60m + --grpc-server-max-connection-age=60m The grpc server max connection age. This controls how often to re-establish connections and redo TLS handshakes. --grpc-server-tls-cert="" TLS Certificate for gRPC server, leave blank to disable TLS - --grpc-server-tls-client-ca="" + --grpc-server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) @@ -102,7 +102,7 @@ Flags: Possible values are: "", "SHA256". -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -112,89 +112,89 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --min-time=0000-01-01T00:00:00Z + --min-time=0000-01-01T00:00:00Z Start of time range limit to serve. Thanos sidecar will serve only metrics, which happened later than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --prometheus.get_config_interval=30s + --prometheus.get_config_interval=30s How often to get Prometheus config - --prometheus.get_config_timeout=5s + --prometheus.get_config_timeout=5s Timeout for getting Prometheus config - --prometheus.http-client= + --prometheus.http-client= Alternative to 'prometheus.http-client-file' flag (mutually exclusive). Content of YAML file or string with http client configs. See Format details: https://thanos.io/tip/components/sidecar.md/#configuration. - --prometheus.http-client-file= + --prometheus.http-client-file= Path to YAML file or string with http client configs. See Format details: https://thanos.io/tip/components/sidecar.md/#configuration. - --prometheus.ready_timeout=10m + --prometheus.ready_timeout=10m Maximum time to wait for the Prometheus instance to start up - --prometheus.url=http://localhost:9090 + --prometheus.url=http://localhost:9090 URL at which to reach Prometheus's API. For better performance use local network. - --reloader.config-envsubst-file="" + --reloader.config-envsubst-file="" Output file for environment variable substituted config file. --reloader.config-file="" Config file watched by the reloader. - --reloader.retry-interval=5s + --reloader.retry-interval=5s Controls how often reloader retries config reload in case of error. - --reloader.rule-dir=RELOADER.RULE-DIR ... + --reloader.rule-dir=RELOADER.RULE-DIR ... Rule directories for the reloader to refresh (repeated field). - --reloader.watch-interval=3m + --reloader.watch-interval=3m Controls how often reloader re-reads config and rules. - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --shipper.upload-compacted + --shipper.upload-compacted If true shipper will try to upload compacted blocks as well. Useful for migration purposes. Works only if compaction is disabled on Prometheus. Do it once and then disable the flag when done. - --store.limits.request-samples=0 + --store.limits.request-samples=0 The maximum samples allowed for a single Series request, The Series call fails if this limit is exceeded. 0 means no limit. NOTE: For efficiency the limit is internally implemented as 'chunks limit' considering each chunk contains a maximum of 120 samples. - --store.limits.request-series=0 + --store.limits.request-series=0 The maximum series allowed for a single Series request. The Series call fails if this limit is exceeded. 0 means no limit. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/store.md b/docs/components/store.md index ac0234f1df..11caf5b25c 100644 --- a/docs/components/store.md +++ b/docs/components/store.md @@ -29,14 +29,14 @@ Store node giving access to blocks in a bucket provider. Now supported GCS, S3, Azure, Swift, Tencent COS and Aliyun OSS. Flags: - --block-meta-fetch-concurrency=32 + --block-meta-fetch-concurrency=32 Number of goroutines to use when fetching block metadata from object storage. - --block-sync-concurrency=20 + --block-sync-concurrency=20 Number of goroutines to use when constructing index-cache.json blocks from object storage. Must be equal or greater than 1. - --bucket-web-label=BUCKET-WEB-LABEL + --bucket-web-label=BUCKET-WEB-LABEL External block label to use as group title in the bucket web UI --cache-index-header Cache TSDB index-headers on disk to reduce @@ -60,19 +60,19 @@ Flags: cause the store to read them. For such use cases use Prometheus + sidecar. Ignored if --no-cache-index-header option is specified. - --grpc-address="0.0.0.0:10901" + --grpc-address="0.0.0.0:10901" Listen ip:port address for gRPC endpoints (StoreAPI). Make sure this address is routable from other components. --grpc-grace-period=2m Time to wait after an interrupt received for GRPC Server. - --grpc-server-max-connection-age=60m + --grpc-server-max-connection-age=60m The grpc server max connection age. This controls how often to re-establish connections and redo TLS handshakes. --grpc-server-tls-cert="" TLS Certificate for gRPC server, leave blank to disable TLS - --grpc-server-tls-client-ca="" + --grpc-server-tls-client-ca="" TLS CA to verify clients against. If no client CA is specified, there is no client verification on server side. (tls.NoClientCert) @@ -80,14 +80,14 @@ Flags: disable TLS -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. --http.config="" [EXPERIMENTAL] Path to the configuration file that can enable TLS or authentication for all HTTP endpoints. - --ignore-deletion-marks-delay=24h + --ignore-deletion-marks-delay=24h Duration after which the blocks marked for deletion will be filtered out while fetching blocks. The idea of ignore-deletion-marks-delay @@ -111,54 +111,54 @@ Flags: --index-cache-size=250MB Maximum size of items held in the in-memory index cache. Ignored if --index-cache.config or --index-cache.config-file option is specified. - --index-cache.config= + --index-cache.config= Alternative to 'index-cache.config-file' flag (mutually exclusive). Content of YAML file that contains index cache configuration. See format details: https://thanos.io/tip/components/store.md/#index-cache - --index-cache.config-file= + --index-cache.config-file= Path to YAML file that contains index cache configuration. See format details: https://thanos.io/tip/components/store.md/#index-cache --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --max-time=9999-12-31T23:59:59Z + --max-time=9999-12-31T23:59:59Z End of time range limit to serve. Thanos Store will serve only blocks, which happened earlier than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --min-time=0000-01-01T00:00:00Z + --min-time=0000-01-01T00:00:00Z Start of time range limit to serve. Thanos Store will serve only metrics, which happened later than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --request.logging-config= + --request.logging-config= Alternative to 'request.logging-config-file' flag (mutually exclusive). Content of YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --request.logging-config-file= + --request.logging-config-file= Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --selector.relabel-config= + --selector.relabel-config= Alternative to 'selector.relabel-config-file' flag (mutually exclusive). Content of YAML file that contains relabeling @@ -166,47 +166,47 @@ Flags: blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - --selector.relabel-config-file= + --selector.relabel-config-file= Path to YAML file that contains relabeling configuration that allows selecting blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - --store.enable-index-header-lazy-reader + --store.enable-index-header-lazy-reader If true, Store Gateway will lazy memory map index-header only once the block is required by a query. - --store.grpc.downloaded-bytes-limit=0 + --store.grpc.downloaded-bytes-limit=0 Maximum amount of downloaded (either fetched or touched) bytes in a single Series/LabelNames/LabelValues call. The Series call fails if this limit is exceeded. 0 means no limit. - --store.grpc.series-max-concurrency=20 + --store.grpc.series-max-concurrency=20 Maximum number of concurrent Series calls. - --store.grpc.series-sample-limit=0 + --store.grpc.series-sample-limit=0 DEPRECATED: use store.limits.request-samples. - --store.grpc.touched-series-limit=0 + --store.grpc.touched-series-limit=0 DEPRECATED: use store.limits.request-series. - --store.limits.request-samples=0 + --store.limits.request-samples=0 The maximum samples allowed for a single Series request, The Series call fails if this limit is exceeded. 0 means no limit. NOTE: For efficiency the limit is internally implemented as 'chunks limit' considering each chunk contains a maximum of 120 samples. - --store.limits.request-series=0 + --store.limits.request-series=0 The maximum series allowed for a single Series request. The Series call fails if this limit is exceeded. 0 means no limit. --sync-block-duration=3m Repeat interval for syncing the blocks between local and remote view. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/docs/components/tools.md b/docs/components/tools.md index 3c552bf3a9..7c4c3c00a3 100644 --- a/docs/components/tools.md +++ b/docs/components/tools.md @@ -16,12 +16,12 @@ Flags: --help-man). --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -116,21 +116,21 @@ Flags: --help-man). --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -210,9 +210,12 @@ usage: thanos tools bucket web [] Web interface for remote storage bucket. Flags: + --disable-admin-operations + Disable UI/API admin operations like marking + blocks for deletion and no compaction. -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -223,7 +226,7 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --max-time=9999-12-31T23:59:59Z + --max-time=9999-12-31T23:59:59Z End of time range limit to serve. Thanos tool bucket web will serve only blocks, which happened earlier than this value. Option @@ -231,26 +234,26 @@ Flags: duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --min-time=0000-01-01T00:00:00Z + --min-time=0000-01-01T00:00:00Z Start of time range limit to serve. Thanos tool bucket web will serve only blocks, which happened later than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration --refresh=30m Refresh interval to download metadata from remote storage - --selector.relabel-config= + --selector.relabel-config= Alternative to 'selector.relabel-config-file' flag (mutually exclusive). Content of YAML file that contains relabeling @@ -258,19 +261,19 @@ Flags: blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config - --selector.relabel-config-file= + --selector.relabel-config-file= Path to YAML file that contains relabeling configuration that allows selecting blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config --timeout=5m Timeout to download metadata from remote storage - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -342,14 +345,14 @@ Flags: --id=ID ... Block IDs to verify (and optionally repair) only. If none is specified, all blocks will be verified. Repeated field - -i, --issues=index_known_issues... ... + -i, --issues=index_known_issues... ... Issues to verify (and optionally repair). Possible issue to verify, without repair: [overlapped_blocks]; Possible issue to verify and repair: [index_known_issues duplicated_compaction] --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore-backup.config= + --objstore-backup.config= Alternative to 'objstore-backup.config-file' flag (mutually exclusive). Content of YAML file that contains object store-backup @@ -357,29 +360,29 @@ Flags: https://thanos.io/tip/thanos/storage.md/#configuration Used for repair logic to backup blocks before removal. - --objstore-backup.config-file= + --objstore-backup.config-file= Path to YAML file that contains object store-backup configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration Used for repair logic to backup blocks before removal. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration -r, --repair Attempt to repair blocks for which issues were detected - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -408,24 +411,24 @@ Flags: --help-man). --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration -o, --output="" Optional format in which to print each block's information. Options are 'json', 'wide' or a custom template. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -454,19 +457,19 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration --output=table Output format for result. Currently supports table, cvs, tsv. - -l, --selector==\"\" ... + -l, --selector==\"\" ... Selects blocks based on label, e.g. '-l key1=\"value1\" -l key2=\"value2\"'. All key value pairs must match. @@ -475,12 +478,12 @@ Flags: UNTIL'. I.e., if the 'FROM' value is equal the rows are then further sorted by the 'UNTIL' value. --timeout=5m Timeout to download metadata from remote storage - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -507,7 +510,7 @@ Replicate data from one object storage to another. NOTE: Currently it works only with Thanos blocks (meta.json has to have Thanos metadata). Flags: - --compaction=COMPACTION ... + --compaction=COMPACTION ... Only blocks with these compaction levels will be replicated. Repeated flag. Overrides compaction-min and compaction-max if set. @@ -517,7 +520,7 @@ Flags: will be replicated. -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -529,7 +532,7 @@ Flags: matchers will be ignored. When specified, this command will be run only once after successful replication. Repeated field - --ignore-marked-for-deletion + --ignore-marked-for-deletion Do not replicate blocks that have deletion mark. --log.format=logfmt Log format to use. Possible options: logfmt or json. @@ -537,51 +540,51 @@ Flags: --matcher=MATCHER blocks whose external labels match this matcher will be replicated. All Prometheus matchers are supported, including =, !=, =~ and !~. - --max-time=9999-12-31T23:59:59Z + --max-time=9999-12-31T23:59:59Z End of time range limit to replicate. Thanos Replicate will replicate only metrics, which happened earlier than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --min-time=0000-01-01T00:00:00Z + --min-time=0000-01-01T00:00:00Z Start of time range limit to replicate. Thanos Replicate will replicate only metrics, which happened later than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y. - --objstore-to.config= + --objstore-to.config= Alternative to 'objstore-to.config-file' flag (mutually exclusive). Content of YAML file that contains object store-to configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration The object storage which replicate data to. - --objstore-to.config-file= + --objstore-to.config-file= Path to YAML file that contains object store-to configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration The object storage which replicate data to. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration --resolution=0s... ... Only blocks with these resolutions will be replicated. Repeated flag. --single-run Run replication only one time, then exit. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -615,13 +618,13 @@ usage: thanos tools bucket downsample [] Continuously downsamples blocks in an object store bucket. Flags: - --block-files-concurrency=1 + --block-files-concurrency=1 Number of goroutines to use when fetching/uploading block files from object storage. --data-dir="./data" Data directory in which to cache blocks and process downsamplings. - --downsample.concurrency=1 + --downsample.concurrency=1 Number of goroutines to use when downsampling blocks. --hash-func= Specify which hash function to use when @@ -632,7 +635,7 @@ Flags: are: "", "SHA256". -h, --help Show context-sensitive help (also try --help-long and --help-man). - --http-address="0.0.0.0:10902" + --http-address="0.0.0.0:10902" Listen host:port for HTTP endpoints. --http-grace-period=2m Time to wait after an interrupt received for HTTP Server. @@ -642,22 +645,22 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -704,22 +707,22 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. --marker=MARKER Marker to be put. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration --remove Remove the marker. - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -790,13 +793,13 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. - --objstore.config= + --objstore.config= Alternative to 'objstore.config-file' flag (mutually exclusive). Content of YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration - --objstore.config-file= + --objstore.config-file= Path to YAML file that contains object store configuration. See format details: https://thanos.io/tip/thanos/storage.md/#configuration @@ -806,31 +809,31 @@ Flags: --rewrite.add-change-log If specified, all modifications are written to new block directory. Disable if latency is to high. - --rewrite.to-delete-config= + --rewrite.to-delete-config= Alternative to 'rewrite.to-delete-config-file' flag (mutually exclusive). Content of YAML file that contains []metadata.DeletionRequest that will be applied to blocks - --rewrite.to-delete-config-file= + --rewrite.to-delete-config-file= Path to YAML file that contains []metadata.DeletionRequest that will be applied to blocks - --rewrite.to-relabel-config= + --rewrite.to-relabel-config= Alternative to 'rewrite.to-relabel-config-file' flag (mutually exclusive). Content of YAML file that contains relabel configs that will be applied to blocks - --rewrite.to-relabel-config-file= + --rewrite.to-relabel-config-file= Path to YAML file that contains relabel configs that will be applied to blocks - --tmp.dir="/tmp/thanos-rewrite" + --tmp.dir="/var/folders/yn/c6y00yq11klbr1pk_92j61580000gn/T/thanos-rewrite" Working directory for temporary files - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration @@ -865,12 +868,12 @@ Flags: --log.format=logfmt Log format to use. Possible options: logfmt or json. --log.level=info Log filtering level. --rules=RULES ... The rule files glob to check (repeated). - --tracing.config= + --tracing.config= Alternative to 'tracing.config-file' flag (mutually exclusive). Content of YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration - --tracing.config-file= + --tracing.config-file= Path to YAML file with tracing configuration. See format details: https://thanos.io/tip/thanos/tracing.md/#configuration diff --git a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.test.tsx b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.test.tsx index 23bf869dea..076205e9c6 100644 --- a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.test.tsx +++ b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.test.tsx @@ -15,6 +15,7 @@ describe('BlockDetails', () => { selectBlock: (): void => { // do nothing }, + disableAdminOperations: false, }; window.URL.createObjectURL = jest.fn(); const blockDetails = mount(); diff --git a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx index 63800d497f..6d28565b96 100644 --- a/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx +++ b/pkg/ui/react-app/src/thanos/pages/blocks/BlockDetails.tsx @@ -4,15 +4,14 @@ import styles from './blocks.module.css'; import moment from 'moment'; import { Button, Modal, ModalBody, Form, Input, ModalHeader, ModalFooter } from 'reactstrap'; import { download } from './helpers'; -import { FlagMap } from '../../../pages/flags/Flags'; -import { useFetch } from '../../../hooks/useFetch'; export interface BlockDetailsProps { block: Block | undefined; selectBlock: React.Dispatch>; + disableAdminOperations: boolean; } -export const BlockDetails: FC = ({ block, selectBlock }) => { +export const BlockDetails: FC = ({ block, selectBlock, disableAdminOperations }) => { const [modalAction, setModalAction] = useState(''); const [detailValue, setDetailValue] = useState(null); @@ -42,9 +41,6 @@ export const BlockDetails: FC = ({ block, selectBlock }) => { } }; - const { response: flagsRes } = useFetch(`/api/v1/status/flags`); - const disableAdminOperations = flagsRes?.data?.['disable-admin-operations'] || false; - return (
{block && ( @@ -106,27 +102,27 @@ export const BlockDetails: FC = ({ block, selectBlock }) => {
{!disableAdminOperations && ( -
- -
- )} - {!disableAdminOperations && ( -
- +
+
+ +
+
+ +
)} diff --git a/pkg/ui/react-app/src/thanos/pages/blocks/Blocks.tsx b/pkg/ui/react-app/src/thanos/pages/blocks/Blocks.tsx index 30252a912c..081d157d73 100644 --- a/pkg/ui/react-app/src/thanos/pages/blocks/Blocks.tsx +++ b/pkg/ui/react-app/src/thanos/pages/blocks/Blocks.tsx @@ -14,6 +14,7 @@ import { sortBlocks, getBlockByUlid, getFilteredBlockPools } from './helpers'; import styles from './blocks.module.css'; import TimeRange from './TimeRange'; import Checkbox from '../../../components/Checkbox'; +import { FlagMap } from '../../../pages/flags/Flags'; export interface BlockListProps { blocks: Block[]; @@ -74,6 +75,9 @@ export const BlocksContent: FC<{ data: BlockListProps }> = ({ data }) => { const filteredBlocks = useMemo(() => getBlockByUlid(blocks, blockSearch), [blocks, blockSearch]); const filteredBlockPools = useMemo(() => getFilteredBlockPools(blockPools, filteredBlocks), [filteredBlocks, blockPools]); + const { response: flagsRes } = useFetch(`/api/v1/status/flags`); + const disableAdminOperations = flagsRes?.data?.['disable-admin-operations'] === 'true' || false; + const setViewTime = (times: number[]): void => { setQuery({ 'min-time': times[0], @@ -180,7 +184,7 @@ export const BlocksContent: FC<{ data: BlockListProps }> = ({ data }) => { onChange={setViewTime} />
- + ) : ( From 35c2658d2fe4351440d74634693d7378f6bf5a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Fri, 11 Aug 2023 13:25:18 +0300 Subject: [PATCH 03/31] components/query: add a paragraph about filter (#6607) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the why/what from https://github.com/thanos-io/thanos/issues/6257 in the Querier documentation. Signed-off-by: Giedrius Statkevičius --- docs/components/query.md | 10 ++++++++++ docs/proposals-accepted/20221129-avoid-global-sort.md | 11 ++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/components/query.md b/docs/components/query.md index b87314dfc3..60615724fd 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -103,6 +103,16 @@ thanos query \ This logic can also be controlled via parameter on QueryAPI. More details below. +### Deduplication on non-external labels + +In `v0.31.0` we have implemented an [optimization](../proposals-accepted/20221129-avoid-global-sort.md) which broke deduplication on non-external labels. We think that it was just a coincidence that deduplication worked at all on non-external labels in previous versions. + +External labels always override any labels a series might have and this makes it so that it is possible to remove replica labels on series returned by a StoreAPI as an optimization. If deduplication happens on internal labels then that might lead to unsorted series from a StoreAPI and that breaks deduplication. + +To fix this use-case, in 0.32.0 we've implemented a cuckoo filter on label names that is updated every 10 seconds. Using it we can detect whether deduplication was requested on internal labels. If that is the case then the series set is resorted before being sent off to the querier. It is strongly recommended to set replica labels which are external labels because otherwise the optimization cannot be applied and your queries will be slower by 20-30%. + +In the future we have plans to expose this cuckoo filter through the InfoAPI. This will allow better scoping queries to StoreAPIs. + ## Experimental PromQL Engine By default, Thanos querier comes with standard Prometheus PromQL engine. However, when `--query.promql-engine=thanos` is specified, Thanos will use [experimental Thanos PromQL engine](http://github.com/thanos-community/promql-engine) which is a drop-in, efficient implementation of PromQL engine with query planner and optimizers. diff --git a/docs/proposals-accepted/20221129-avoid-global-sort.md b/docs/proposals-accepted/20221129-avoid-global-sort.md index 19de5d88b5..1a56a74140 100644 --- a/docs/proposals-accepted/20221129-avoid-global-sort.md +++ b/docs/proposals-accepted/20221129-avoid-global-sort.md @@ -1,7 +1,12 @@ -## Avoid Global Sort on Querier Select +--- +type: proposal +title: Avoid Global Sort on Querier Select +status: approved +owner: bwplotka,fpetkovski +menu: proposals-accepted +--- -* **Owners:** - * @bwplotka, @fpetkovski +## Avoid Global Sort on Querier Select * **Related Tickets:** * https://github.com/thanos-io/thanos/issues/5719 From bd1c4cb7fc3a3d13ab760d784915e4f45a8d5f08 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Fri, 11 Aug 2023 18:26:34 +0800 Subject: [PATCH 04/31] cache: remove unnecessary nil check (#6603) From the Go docs: "If the map is nil, the number of iterations is 0." [1] Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun --- pkg/cache/caching_bucket_config.go | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/pkg/cache/caching_bucket_config.go b/pkg/cache/caching_bucket_config.go index 3422783d6b..e17b2f27b1 100644 --- a/pkg/cache/caching_bucket_config.go +++ b/pkg/cache/caching_bucket_config.go @@ -38,30 +38,20 @@ func NewCachingBucketConfig() *CachingBucketConfig { // SetCacheImplementation sets the value of Cache for all configurations. func (cfg *CachingBucketConfig) SetCacheImplementation(c Cache) { - if cfg.get != nil { - for k := range cfg.get { - cfg.get[k].Cache = c - } + for k := range cfg.get { + cfg.get[k].Cache = c } - if cfg.iter != nil { - for k := range cfg.iter { - cfg.iter[k].Cache = c - } + for k := range cfg.iter { + cfg.iter[k].Cache = c } - if cfg.exists != nil { - for k := range cfg.exists { - cfg.exists[k].Cache = c - } + for k := range cfg.exists { + cfg.exists[k].Cache = c } - if cfg.getRange != nil { - for k := range cfg.getRange { - cfg.getRange[k].Cache = c - } + for k := range cfg.getRange { + cfg.getRange[k].Cache = c } - if cfg.attributes != nil { - for k := range cfg.attributes { - cfg.attributes[k].Cache = c - } + for k := range cfg.attributes { + cfg.attributes[k].Cache = c } } From a76bd25fae0a2ad1d61a2ef3bb6030c23f4336e9 Mon Sep 17 00:00:00 2001 From: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:20:30 +0530 Subject: [PATCH 05/31] fixing docs ci Signed-off-by: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> Signed-off-by: Harsh Pratap Singh <119954739+harsh-ps-2003@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/feature-request.md | 2 +- CHANGELOG.md | 18 +- CODE_OF_CONDUCT.md | 4 +- CONTRIBUTING.md | 14 +- MAINTAINERS.md | 2 +- README.md | 4 +- docs/blog/2022-09-08-thanos-at-medallia.md | 6 +- ...6-02-lfx-mentorship-query-observability.md | 4 +- docs/components/compact.md | 64 +++---- docs/components/query-frontend.md | 96 +++++----- docs/components/query.md | 118 ++++++------ docs/components/receive.md | 116 +++++------ docs/components/rule.md | 124 ++++++------ docs/components/sidecar.md | 76 ++++---- docs/components/store.md | 80 ++++---- docs/components/tools.md | 180 +++++++++--------- docs/contributing/coding-style-guide.md | 4 +- .../contributing/how-to-contribute-to-docs.md | 2 +- docs/contributing/mentorship.md | 2 +- docs/design.md | 2 +- docs/getting-started.md | 4 +- docs/operating/binary-index-header.md | 2 +- .../cross-cluster-tls-communication.md | 20 +- docs/operating/https.md | 2 +- .../202012-deletions-object-storage.md | 2 +- .../202106-automated-per-endpoint-mTLS.md | 4 +- ...more-granular-query-performance-metrics.md | 10 +- .../202206-active-series-limiting-hashring.md | 22 +-- .../202209-receive-tenant-external-labels.md | 2 +- .../20221129-avoid-global-sort.md | 6 +- .../201812-thanos-remote-receive.md | 2 +- .../201912-thanos-binary-index-header.md | 2 +- .../202001-thanos-query-health-handling.md | 2 +- .../202003-thanos-rules-federation.md | 22 +-- docs/proposals-done/202005-query-logging.md | 4 +- .../202005-scalable-rule-storage.md | 2 +- .../202005-version-documentation.md | 6 +- docs/proposals-rejected/201807-config.md | 22 +-- docs/quick-tutorial.md | 26 +-- docs/storage.md | 12 +- examples/alerts/alerts.md | 6 +- mixin/README.md | 10 +- mixin/runbook.md | 4 +- pkg/ui/react-app/README.md | 8 +- tutorials/killercoda/README.md | 2 +- tutorials/kubernetes-helm/README.md | 10 +- 46 files changed, 566 insertions(+), 566 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index ae06a990a4..57e052308e 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -33,7 +33,7 @@ assignees: '' (Write your answer here.) -### Additional context +### Additional contex