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

Fix cluster variable in mixins #16778

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Fix cluster variable in mixins #16778

merged 1 commit into from
Oct 17, 2023

Conversation

QuentinBisson
Copy link
Contributor

Fix mixin cluster parameter otherwise generated mixins looks like this:

{"type":"prometheus","uid":"${datasource}"},"label":"cluster","name":"job","query":"label_values(etcd_server_has_leader{job=~\".*etcd.*\"}, job)","refresh":2,"type":"query"}]},"time":{"from":"now-15m","to":"now"},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"etcd","uid":"c2f4e12cdf69feb95caa41a5a1b423d9"}`}}

where name is job when the variable name used in dashboard queries is cluster.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

Issue came up here: prometheus-community/helm-charts#3880 (comment)

Fix mixin cluster parameter otherwise generated mixins looks like this:

```json
{"type":"prometheus","uid":"${datasource}"},"label":"cluster","name":"job","query":"label_values(etcd_server_has_leader{job=~\".*etcd.*\"}, job)","refresh":2,"type":"query"}]},"time":{"from":"now-15m","to":"now"},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"etcd","uid":"c2f4e12cdf69feb95caa41a5a1b423d9"}`}}
```

where name is job when the variable name used in dashboard queries is cluster.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
@QuentinBisson QuentinBisson changed the title Fix cluster query Fix cluster variable in mixins Oct 16, 2023
@QuentinBisson
Copy link
Contributor Author

cc @ahrtr as I see you refactored to grafonnet recently

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Thanks for raising @QuentinBisson.

For context here is the original pr that introduced configurable cluster label: https://github.com/etcd-io/etcd/pull/13255/files

Potential regression when we refactored the mixin recently.

Can take a look at this tonight and provide some feedback.

cc @v-zhuravlev

@QuentinBisson
Copy link
Contributor Author

Thank you @jmhbnz.

As you can see in this line https://github.com/etcd-io/etcd/pull/13255/files#diff-007651fd1693f51e6c72b237590b65d2a1a72fa3bba2d24993c2bf417bb25792R1294 the variable name used to be cluster but it is now set to config.clusterLabel which is job by default as you can see in my PR :)

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for fixing this @QuentinBisson.

@ahrtr
Copy link
Member

ahrtr commented Oct 17, 2023

cc @v-zhuravlev to double confirm.

@v-zhuravlev
Copy link
Contributor

v-zhuravlev commented Oct 17, 2023

@ahrtr , @QuentinBisson ,
my bad, tested this with cluster value of clusterLabel, therefore not realizing issue with other labels (such as job which is default).
Fix in this PR looks correct to me.

@ahrtr
Copy link
Member

ahrtr commented Oct 17, 2023

thx @v-zhuravlev for the quick confirmation.

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

Successfully merging this pull request may close these issues.

None yet

4 participants