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

Minor dashboard fixes #4401

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Minor dashboard fixes #4401

merged 1 commit into from
Oct 1, 2021

Conversation

cstyan
Copy link
Contributor

@cstyan cstyan commented Oct 1, 2021

Fix to retention dashboard (seems like query panel without a panel(...) line to set the name throws an error, plus add links + selector copying dropdown to other dashboards (top right of dashboard, links to other dashboards and copies over cluster selectors, etc.).

dropdown to other dashboards.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
@cstyan cstyan requested a review from a team as a code owner October 1, 2021 05:07
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo a question

@@ -54,16 +53,17 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
],
} +
g.dashboard('Loki / Chunks')
$.dashboard('Loki / Chunks')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest staying away from the global $ if you can; it can cause some fun issues with jsonnet and also makes it hard to determine which function it's using.

What was the reason behind this change? AFAICS consistency with other dashboards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we can use addClusterSelectorTemplates(false) which is defined in the mixin's dashboard-utils.libsonnet, which gives us the link dropdown: https://github.com/grafana/loki/blob/main/production/loki-mixin/dashboards/dashboard-utils.libsonnet#L32-L43

I haven't written any jsonnet in ~1y so if you know a better way/possible refactor I'm all ears!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Have a look at line 1:
local utils = import 'mixin-utils/utils.libsonnet';

You can import a file to a local var, and then use that.

However it seems like we're peppering a bunch of files with $ so let me not hold you up on this.

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

Successfully merging this pull request may close these issues.

2 participants