-
Notifications
You must be signed in to change notification settings - Fork 50
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: improve prometheusrules (to show more labels and fix messages) #225
base: main
Are you sure you want to change the base?
Conversation
wow, this PR is approved for a year but not merged yet. |
It needs some conflicts fixing and a review from @BeryJu |
Signed-off-by: genofire <[email protected]>
…namespace and service)
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 also prefer without
over by
so you could be sure, that you do not remove any labels from the metrics or collection which could be interesting.
Here, you delete the namespace
which is sad, if you have multiple authentik (e.g. staging) running.
@@ -161,7 +160,7 @@ spec: | |||
- alert: DisconnectedOutposts | |||
labels: | |||
severity: critical | |||
expr: max without (endpoint,instance,container,pod,job,service) (authentik_outposts_connected{uid!~"specific.*"}) < 1 | |||
expr: max by (outpost) (authentik_outposts_connected{namespace="{{ $.Release.Namespace }}", service="{{ include "authentik.names.fullname" $ }}-metrics", uid!~"specific.*"}) < 1 |
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.
missing namespace and service to identify which helm-release alerts ...
@@ -127,19 +127,18 @@ spec: | |||
- alert: NoWorkersConnected | |||
labels: | |||
severity: critical | |||
expr: max without (endpoint,instance,container,job,service) (authentik_admin_workers) < 1 | |||
expr: max by (pod) (authentik_admin_workers{namespace="{{ $.Release.Namespace }}", service="{{ include "authentik.names.fullname" $ }}-metrics"}) < 1 |
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.
extract the filter to a helm-template variable and reuse it everywhere (instatt of code copy):
{{- $filter := printf 'namespace="%s", service="%s-metrics"' .Release.Namespace (include "authentik.names.fullname" . ) }}
expr: max by (pod) (authentik_admin_workers{ {{ $filter }} }) < 1
@@ -127,30 +127,29 @@ spec: | |||
- alert: NoWorkersConnected | |||
labels: | |||
severity: critical | |||
expr: max without (pid) (authentik_admin_workers) < 1 | |||
expr: max by (pod) (authentik_admin_workers{namespace="{{ $.Release.Namespace }}", service="{{ include "authentik.names.fullname" $ }}-metrics"}) < 1 |
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.
The service is authentik-server-metrics, not just authentik-metrics, or {{ include "authentik.server.fullname" . }}-metrics
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.
maybe we should use service=~"^{{ include "authentik.server.fullname" . }}.*"
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.
Probably not
No description provided.