diff --git a/docs/components/receive.md b/docs/components/receive.md index 16dfd8a42f..542546b6e1 100644 --- a/docs/components/receive.md +++ b/docs/components/receive.md @@ -44,6 +44,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` The example content of `hashring.json`: diff --git a/docs/components/sidecar.md b/docs/components/sidecar.md index 57b69311b4..7a7deeb8e9 100644 --- a/docs/components/sidecar.md +++ b/docs/components/sidecar.md @@ -56,6 +56,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` ## Upload compacted blocks diff --git a/docs/components/store.md b/docs/components/store.md index 1162ad9946..3071e7b928 100644 --- a/docs/components/store.md +++ b/docs/components/store.md @@ -15,6 +15,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` In general, an average of 6 MB of local disk space is required per TSDB block stored in the object storage bucket, but for high cardinality blocks with large label set it can even go up to 30MB and more. It is for the pre-computed index, which includes symbols and postings offsets as well as metadata JSON. diff --git a/docs/components/tools.md b/docs/components/tools.md index 80ceed9585..776164aeb0 100644 --- a/docs/components/tools.md +++ b/docs/components/tools.md @@ -101,6 +101,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` Bucket can be extended to add more subcommands that will be helpful when working with object storage buckets by adding a new command within [`/cmd/thanos/tools_bucket.go`](../../cmd/thanos/tools_bucket.go) . @@ -601,6 +602,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` ```$ mdox-exec="thanos tools bucket downsample --help" @@ -675,6 +677,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` ```$ mdox-exec="thanos tools bucket mark --help" diff --git a/docs/storage.md b/docs/storage.md index fa1c988c8f..47f2bd3f19 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -96,6 +96,7 @@ config: kms_encryption_context: {} encryption_key: "" sts_endpoint: "" +prefix: "" ``` At a minimum, you will need to provide a value for the `bucket`, `endpoint`, `access_key`, and `secret_key` keys. The rest of the keys are optional. @@ -257,6 +258,7 @@ type: GCS config: bucket: "" service_account: "" +prefix: "" ``` ##### Using GOOGLE_APPLICATION_CREDENTIALS @@ -358,6 +360,7 @@ config: key_file: "" server_name: "" insecure_skip_verify: false +prefix: "" ``` If `msi_resource` is used, authentication is done via system-assigned managed identity. The value for Azure should be `https://.blob.core.windows.net`. @@ -398,6 +401,7 @@ config: connect_timeout: 10s timeout: 5m use_dynamic_large_objects: false +prefix: "" ``` #### Tencent COS @@ -423,6 +427,7 @@ config: max_idle_conns: 100 max_idle_conns_per_host: 100 max_conns_per_host: 0 +prefix: "" ``` The `secret_key` and `secret_id` field is required. The `http_config` field is optional for optimize HTTP transport settings. There are two ways to configure the required bucket information: @@ -444,6 +449,7 @@ config: bucket: "" access_key_id: "" access_key_secret: "" +prefix: "" ``` Use --objstore.config-file to reference to this configuration file. @@ -459,6 +465,7 @@ config: endpoint: "" access_key: "" secret_key: "" +prefix: "" ``` #### Filesystem @@ -471,6 +478,7 @@ NOTE: This storage type is experimental and might be inefficient. It is NOT advi type: FILESYSTEM config: directory: "" +prefix: "" ``` ### How to add a new client to Thanos? diff --git a/pkg/objstore/prefixed_bucket.go b/pkg/objstore/prefixed_bucket.go index a5a809ac82..130f14d439 100644 --- a/pkg/objstore/prefixed_bucket.go +++ b/pkg/objstore/prefixed_bucket.go @@ -31,6 +31,7 @@ func conditionalPrefix(prefix, name string) string { if len(name) > 0 { return withPrefix(prefix, name) } + return name }