thanos
thanos copied to clipboard
Receive: Allow specifying tenant-specific external labels
Is your proposal related to a problem?
We would like to partition and select tenant blocks from Receivers in an arbitrary manner.
Describe the solution you'd like
I would like to be able to add additional external labels to tenants created in Thanos Receivers.
Currently it is only possible to add external labels to Receivers directly, but not to individual tenants created in those Receivers. Having a header like THANOS-TENANT-LABELS
that will set external labels when the tenant TSDB is created could be a possible solution.
Describe alternatives you've considered
Running tenant-specific Prometheus instances, but that can be hard to manage at a larger scale.
I think this make a lot of sense. It's also something that could integrate pretty naturally into the tenant configuration file. If this were the path, we might want to change to yaml for the configuration so we can more naturally mirror a prometheus relabel-config.
I think the tenant configuration file would also be a great place to add this 👍
Hello, I'm interested in contributing to this project as a part of lfx mentorship program. Any related PR or docs I can check out to get started?
Hey folks, came here from the LFX mentorship projects and I'd like to contribute to this. Any help on where to get started?
I was going through the code base and wanted to understand more on how multi-tenancy is currently achieved in Thanos as it wasn't very much clear with the docs as well.It would be great if I may get some relevant blogs/papers as related to what currently is implemented. Thanks in advance.
Hey folks, came here from the LFX mentorship projects and I'd like to contribute to this. Any help on where to get started?
@ahsenkamal @rajivharlalka I think you can start from adding external labels to hashring config here. Currently, its only supports tenant name as external label value for tenant-label-name command line flag.
once you have some kinda map to hold tenant name to external label-value mapping in hash-ring config, you need to wire them to here https://github.com/thanos-io/thanos/blob/main/pkg/receive/multitsdb.go#L443
lset := labelpb.ExtendSortedLabels(t.labels, labels.FromStrings(t.tenantLabelName, tenantID))
@saswatamcode @fpetkovski PR #5777 only does the main parts of the proposal #5720 Should we create an issue to track doing the remaining parts, before moving the proposal to proposals-done
? Some users may want to contribute.