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: change saturation-gauge from using sum to max #637

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local createSliValueRule(sliSpec, sliMetadata, config) =
expr: |||
sum without (%(selectorLabels)s) (label_replace(label_replace(
(
sum by(%(selectorLabels)s) (avg_over_time((%(targetMetric)s{%(selectors)s} > bool %(counterPercentTarget)s)[%(evalInterval)s:%(evalInterval)s]))
max by(%(selectorLabels)s) (avg_over_time((%(targetMetric)s{%(selectors)s} > bool %(counterPercentTarget)s)[%(evalInterval)s:%(evalInterval)s]))
/
count by(%(selectorLabels)s) (count_over_time(%(targetMetric)s{%(selectors)s}[%(evalInterval)s]))
),
Expand Down Expand Up @@ -73,19 +73,19 @@ local createGraphPanel(sliSpec) =
).addTarget(
prometheus.target(
|||
sum(avg_over_time(%(targetMetric)s{%(selectors)s}[%(evalInterval)s]) > 0 or vector(0))
max(avg_over_time(%(targetMetric)s{%(selectors)s}[%(evalInterval)s]) > 0 or vector(0))
||| % {
targetMetric: targetMetrics.target,
counterPercentTarget: sliSpec.counterPercentTarget,
selectors: std.join(',', dashboardSelectors),
evalInterval: sliSpec.evalInterval,
},
legendFormat='avg saturation',
legendFormat='maximum saturation',
),
).addTarget(
prometheus.target(
|||
sum(avg_over_time((%(targetMetric)s{%(selectors)s} > bool %(counterPercentTarget)s)[%(evalInterval)s:%(evalInterval)s]) or vector(0))
max(avg_over_time((%(targetMetric)s{%(selectors)s} > bool %(counterPercentTarget)s)[%(evalInterval)s:%(evalInterval)s]) or vector(0))
/
count(count_over_time(%(targetMetric)s{%(selectors)s}[%(evalInterval)s]))
||| % {
Expand All @@ -94,16 +94,16 @@ local createGraphPanel(sliSpec) =
selectors: std.join(',', dashboardSelectors),
evalInterval: sliSpec.evalInterval,
},
legendFormat='avg period where saturation > %s percentage' % sliSpec.counterPercentTarget,
legendFormat='avg period where maximum saturation > %s percentage' % sliSpec.counterPercentTarget,
)
).addSeriesOverride(
{
alias: '/avg period where saturation > %s percentage/' % sliSpec.counterPercentTarget,
alias: '/avg period where maximum saturation > %s percentage/' % sliSpec.counterPercentTarget,
color: 'red',
},
).addSeriesOverride(
{
alias: '/avg saturation/',
alias: '/maximum saturation/',
color: 'green',
},
);
Expand Down
Loading