Chose a default bucket to always load #536
-
Whenever I go to the dashboard, I need to re-select the proper bucket, because it just picks the first one in alphabetical order. It can save the older choice so it can go back to it, or pick the default bucket from influxdb settings in the data source section, |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
Not sure I follow, can you share a screenshot on what you mean? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I only have 1 bucket. I don't know what two other buckets you see come from. Where did you get the grafana template? |
Beta Was this translation helpful? Give feedback.
-
i mean, that depends on your influxdb setup. Do you have other buckets on your db that don't appear on the dashboard? If you have only 1 bucket in the influxdb, it makes sense to have only one here. |
Beta Was this translation helpful? Give feedback.
-
I have a lot of buckets, one for each service. And each bucket has its own token. When you create the datasource for speedtest in grafana, and you specify the token specific for the speedtest bucket, all the others are filtered because that token has rights only for that specific bucket. So how did you configure your bucket and also your grafana datasource? Here's mine: you can see that when I click Save & Test, only 1 bucket is found because the token I used is mapped to that specific bucket. |
Beta Was this translation helpful? Give feedback.
-
Also, when you select the bucket from the dashboard, have you tried saving the dashboard? I think it should also save the bucket selection. |
Beta Was this translation helpful? Give feedback.
-
Converting this to a discussion as it's not directly related to the app. |
Beta Was this translation helpful? Give feedback.
-
The token I use get information for all the 3 buckets, which is the correct behaviour. Now, I am pretty sure if I use a more restricted token to get only the bucket I want for speedtest, I will get only 1 bucket here, and thus it will show only 1 bucket in the dashboard. But that would only be a patch over a wound, since the db can have multiple buckets fetched by one token. In the dashboard we should still be able to select one default bucket to show, or at least save the last bucket shown. |
Beta Was this translation helpful? Give feedback.
That's not the correct way, from a best practice point of view. But you can do as you want with your data. :)
Anyway, the dashboard uses a function to populate the variable for the bucket list. You can change that in a fixed bucket. Go to edit dashboard, then in variables section, and click on the bucket variable:
In the edit window, you can either modify the Sort to reverse it, so your wanted bucket always comes first:
Or, you change the bucket variable type, from query to custom so you can specify the bucket manually, like in the following screenshot:
And then save the dashboard.