Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive: Allow specifying tenant-specific external labels #5434

Closed
fpetkovski opened this issue Jun 22, 2022 · 7 comments · Fixed by #5777
Closed

Receive: Allow specifying tenant-specific external labels #5434

fpetkovski opened this issue Jun 22, 2022 · 7 comments · Fixed by #5777

Comments

@fpetkovski
Copy link
Contributor

fpetkovski commented Jun 22, 2022

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.

@squat
Copy link
Member

squat commented Jun 22, 2022

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.

@fpetkovski
Copy link
Contributor Author

I think the tenant configuration file would also be a great place to add this 👍

@hamees-sayed
Copy link

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?

@ahsenkamal
Copy link

Hey folks, came here from the LFX mentorship projects and I'd like to contribute to this. Any help on where to get started?

@rajivharlalka
Copy link
Contributor

rajivharlalka commented Aug 26, 2022

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.

@sharadgaur
Copy link

sharadgaur commented Sep 15, 2022

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))

@haanhvu
Copy link
Contributor

haanhvu commented May 25, 2023

@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.

@junotx junotx mentioned this issue Jul 4, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants