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

Tenant dropdown not working without creating new datasource variable #4

Open
geekdave opened this issue Jan 31, 2025 · 4 comments
Open

Comments

@geekdave
Copy link

geekdave commented Jan 31, 2025

First off, big thanks to @dmyerscough for implementing the dynamic tenant query as a dashboard variable!

I'm not sure if I am missing a step, but after this change the dashboards no longer worked out of the box and required some tweaking. On all 3 dashboards I got this error in the Tenant dropdown:

Datasource ${datasource} was not found

Image

Looks like the template variable for the tenant is expecting another ${datasource} variable here:

        "datasource": {
          "type": "prometheus",
          "uid": "${datasource}"
        },
        "definition": "label_values(cortex_distributor_requests_in_total,user)",
        "description": "Tenants for mimir",

I tried adding my own Prometheus datasource variable to each dashboard like so:

Image

...and that fixed the issue! 🎉

But before I submit a PR with this datasource included in each dashboard, I wanted to check if there was something obvious I was missing that would have allowed these dashboards to work without that change?

@dmyerscough
Copy link
Contributor

@geekdave I didn't get this error when importing the dashboard, let me try again this weekend and Ill let you know if I hit this error. The change I made grabs the tenants from Prometheus metrics, Ill check to see if I get the error you're getting.

@samui-aug
Copy link

samui-aug commented Feb 6, 2025

I get the same error as @geekdave but fetch datasource name from prometheus won't help me because my datasource name not align with my tenant id setup

fixed it by selecting correct datasource with the same query get me a list of tenant now

@dmyerscough
Copy link
Contributor

I tested this yesterday, I didn't get asked to select a datasource for Prometheus so that will likely need to be patch. I only get asked to select the json backend for the canary analysis datasource.

@samui-aug
Copy link

This is what happen when I access the Settings -> Variables the first time from imported dashboard

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants