Comments (3)
There is probably some room for improvement on the wording there, happy to take suggestions/PRs on how to word this more clearly.
The "Tenant Metrics" section is about annotating Thanos' "self-monitoring metrics" with tenant information - i.e this is about metrics Thanos exports about Thanos itself. For example the Thanos Query component exports metrics such as http_requests_total
or thanos_store_api_query_duration_seconds_bucket
(exposed by querier even though it's prefixed thanos_store
...). To these metrics a tenant
label matching the tenant of the incoming requests is added, which allows one to do some kind of reasoning of various things on the query path on a per tenant-level. A basic question this allow us to answer could be "which tenant made the most queries". This can be useful even without any enforcement enabled.
from thanos.
This was not a scenario we considered when designing the tenant feature, so yes this won't work at the moment at least. As it is now you can either have enforcement fully enabled on all queries, or not at all. When no tenant header is sent along with the request to the querier, it will use the default tenant for enforcement which can be configured using query.default-tenant-id
.
For now you'd need to setup two different query paths, one for global view where the tenant enforcement is disabled in the querier, and another where enforcement is enabled.
The reason for having tenant information at all when enforcement is disabled, is in order to get self-monitoring metrics for each tenant (for example to determine the query load on a per-tenant basis).
from thanos.
Thanks @jacobbaungard for the input.
Not sure if it just me or documentation could be more clear on that - I read the "Tenant Metrics" paragraph and I was under the impression that all I need to do is pass the tenant id along with the header to get the tenant specific metrics.
Then the next paragraph "Tenant Enforcement" tells how you can actually enforce this behavior, if you want. But from your explanation they should be combined into one (e.g. there is no tenant-specific metrics without enforcement and vice versa).
Tenant Metrics
Tenant information is captured in relevant Thanos exported metrics in the Querier, Query Frontend and Store. In order make use of this functionality requests to the Query/Query Frontend component should include the tenant-id in the appropriate HTTP request header as configured with --query.tenant-header. The tenant information is passed through components (including Query Frontend), down to the Thanos Store, enabling per-tenant metrics in these components also. If no tenant header is set to requests to the query component, the default tenant as defined by --query.tenant-default-id will be used.Tenant Enforcement
Enforcement of tenancy can be enabled using --query.enforce-tenancy. If enabled, queries will only fetch series containing a specific matcher, while evaluating PromQL expressions. The matcher label name is --query.tenant-label-name and the matcher value matches the tenant, as sent to the querier in the HTTP header configured with --query-tenant-header. This functionality requires that metrics are injected with a tenant label when ingested into Thanos. This can be done for example by enabling tenancy in the Thanos Receive component.
from thanos.
Related Issues (20)
- Read value of remote_user in Slow Query Logs of Query Frontend from a HTTP header HOT 3
- Thanos Receive doesn't announce external_labels which are set in hashrings.json when it works in routing and ingesting mode. HOT 1
- Issue with deduplication alogrithm in Thanos HOT 4
- Query Stats Returned with query including query bytes fetched HOT 5
- Max and min pointed at Sidecars not working on 0.35 HOT 15
- `ThanosSidecarBucketOperationsFailed` alert is flaky
- PR Title Validation
- Thanos Receive Pod is crashing with Readiness and livness Probe Failed
- Thanos ruler vs. eventual consistency of metrics
- Can Huawei's OBS storage be supported? HOT 2
- Thanos React-app : Proxy server for thanos-query
- Query: update of endpoint failed...context deadline exceeded
- Thanos Chart 0.34.0 app version 12.23.1
- Thanos receive fails "no space left on device"
- sidecar: Greatly increased Thanos sidecar memory usage from 0.32.2 to 0.32.3, still exists in 0.35.0 HOT 3
- api/v1/label returns wrong values HOT 3
- Regression in thanos v0.35.1 HOT 3
- Thanos Receiver: Router/Ingestor setup no longer returns `thanos_receive_write_timeseries_*` and `thanos_receive_write_samples_*` metrics with thanos v0.35.1 HOT 3
- Extend Thanos bucket rewrite to support filtered archiving of existing blocks
- Support additional aggregates for downsampling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thanos.