-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
WIP: production/promtail-mixin: Make dashboard queries configurable #1978
Conversation
|
You mean you don't like the |
I don't mind using
Instead of "globally" merging mixins. But the location is something we can discuss in another forum as well (@sh0rez and a few others already started this a bit), let's rather focus on the configuration knobs themselves here. |
I like the configuration knobs.
We might want to make sure to show what is configurable since other variables are just for computation. It's a good start for sure. |
I support this change! We recently did a similar thing for the Cortex mixin: grafana/cortex-jsonnet#43 We've stopped globally merging mixins a few weeks ago: https://github.com/grafana/jsonnet-libs/blob/master/prometheus-ksonnet/mixins.libsonnet#L3, but its kinda up to the user of the mixin. I think we should still use the |
Agreed. In particular something we've been experimenting with is specifying everything within |
clusterLabel:: 'cluster', | ||
clusterMatchers:: if cfg.showMultiCluster then [utils.selector.eq(cfg.clusterLabel, '$cluster')] else [], | ||
|
||
matchers:: [utils.selector.eq('job', '$namespace/$name')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if our job
label doesn't take this form? I've been using serviceMonitors with prometheus-operator and our jobLabels are unfortunately just the service name currently. I've been meaning to fix it but haven't quite figured out the best method to get job=$namespace/$name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a jsonnet newbie, but In hindsight, I'm guessing I would just override matchers
to do that. I'm kind wondering still if we could avoid using job
labels entirely with dashboards since it's a label that seems fairly inconsistent, while pod
, container
and namespace
should be fairly universal (once #2070 is fixed).
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Still on my to do list |
Sorry, misread the title. Moved my comment to a separate issue. |
Closing this as no activities over year(s). Feel free to send new PR if anyone want's to revive the work |
What this PR does / why we need it:
Note I'm not entirely happy with where configuration is, but this could potentially be a direction for resolving #1830, making the mixin more configurable and not quite force specific relabeling rules for them to work.
Which issue(s) this PR fixes:
Fixes #1830
Special notes for your reviewer:
Mainly looking for feedback at this point, before I put more work into doing this. One thing we could do is instead move the configuration to the root of the exported object, which would kind of force people to not use the global merge pattern that we sadly advocated for in the beginning of monitoring mixins (cc @sh0rez).
Checklist
@cyriltovena