-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: mixin generation when cluster label is changed #12613
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e858975
Fix mixin generation when cluster label is changed
QuentinBisson 61451fc
Merge branch 'main' into fix-cluster-label
QuentinBisson 152d533
Merge branch 'main' into fix-cluster-label
QuentinBisson 7f413b7
Merge branch 'main' into fix-cluster-label
QuentinBisson dd95b2e
Merge branch 'main' into fix-cluster-label
QuentinBisson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
groups: | ||
- name: loki_alerts | ||
rules: | ||
- alert: LokiRequestErrors | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestPanics | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestLatency | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
cluster_namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*|/schedulerpb.SchedulerForQuerier/QuerierLoop"} > 1 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiTooManyCompactorsRunning | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
- name: loki_alerts | ||
rules: | ||
- alert: LokiRequestErrors | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestPanics | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestLatency | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
cluster_namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*|/schedulerpb.SchedulerForQuerier/QuerierLoop"} > 1 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiTooManyCompactorsRunning | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: 5m | ||
labels: | ||
severity: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,39 @@ | ||
groups: | ||
- name: loki_rules | ||
rules: | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, job)) | ||
record: cluster_job:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, job)) | ||
record: cluster_job:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job) / sum(rate(loki_request_duration_seconds_count[1m])) | ||
by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_count:sum_rate | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, job, route)) | ||
record: cluster_job_route:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, job, route)) | ||
record: cluster_job_route:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job, route) | ||
/ sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job, | ||
route) | ||
record: cluster_job_route:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds_count:sum_rate | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, namespace, job, route)) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) | ||
by (le, cluster, namespace, job, route)) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, namespace, | ||
job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, | ||
namespace, job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, namespace, | ||
job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, namespace, | ||
job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, namespace, | ||
job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_count:sum_rate | ||
- name: loki_rules | ||
rules: | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job)) | ||
record: cluster_job:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job)) | ||
record: cluster_job:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job) / sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job) | ||
record: cluster_job:loki_request_duration_seconds_count:sum_rate | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job, route)) | ||
record: cluster_job_route:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job, route)) | ||
record: cluster_job_route:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, job, route) | ||
record: cluster_job_route:loki_request_duration_seconds_count:sum_rate | ||
- expr: histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, namespace, job, route)) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:99quantile | ||
- expr: histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, namespace, job, route)) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:50quantile | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, namespace, job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, namespace, job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds:avg | ||
- expr: sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, cluster, namespace, job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_bucket:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_sum[1m])) by (cluster, namespace, job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_sum:sum_rate | ||
- expr: sum(rate(loki_request_duration_seconds_count[1m])) by (cluster, namespace, job, route) | ||
record: cluster_namespace_job_route:loki_request_duration_seconds_count:sum_rate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
groups: | ||
- name: loki_alerts | ||
rules: | ||
- alert: LokiRequestErrors | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestPanics | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestLatency | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
cluster_namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*|/schedulerpb.SchedulerForQuerier/QuerierLoop"} > 1 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiTooManyCompactorsRunning | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
- name: loki_alerts | ||
rules: | ||
- alert: LokiRequestErrors | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestPanics | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestLatency | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
cluster_namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*|/schedulerpb.SchedulerForQuerier/QuerierLoop"} > 1 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiTooManyCompactorsRunning | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: 5m | ||
labels: | ||
severity: warning |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
are these indentation changes intentional or from your editor? can you please keep the original indentation so as to keep this diff clean? thank you!
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.
Those happen when we generate the alerts from the mixins so I can realign them sure but they probably hsould not have been indented at all :D
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 do you want me to do?
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 think the confusion here was caused by differences in
jsonnet
versions that were generating the compiled mixin, that's my fault. I added the github action to check the jsonnet linting and compiled mixins, which is using a different version ofjsonnet
within the build image. So unfortunatelymake loki-mixin
andmake BUILD_IN_CONTAINER=false loki-mixin
will get you different results at the moment. I'm working on resolving that today.