Giter Club home page Giter Club logo

Comments (3)

jeff-french avatar jeff-french commented on May 24, 2024 1

Awesome! Thanks for sharing!

from awesome-prometheus-alerts.

jeff-french avatar jeff-french commented on May 24, 2024

@TheKangaroo If the custom KSM config means the rules aren't a good fit here, would mind sharing them in a Gist (or anywhere else)? I'm about to write alerts for Flux in the week or so and would love to have a jump start!

from awesome-prometheus-alerts.

TheKangaroo avatar TheKangaroo commented on May 24, 2024

Sure these are basically our alerts (helm template). We'll improve them over time but for now we started with this.
As I said earlier, they rely on the kube-state-metrics config in the flux monitoring-example repo.

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: flux.rules
  labels:
    app.kubernetes.io/part-of: flux
    app.kubernetes.io/component: monitoring
spec:
  groups:
  - name: flux.rules
    rules:
    - alert: FluxKustomizationFailing
      annotations:
        description: Flux Kustomization {{`{{`}} $labels.name {{`}}`}} in namespace {{`{{`}} $labels.namespace {{`}}`}} failed.
        runbook_url: {{ .Values.defaultRules.runbookUrl }}/{{ .Template.Name }}
        summary: Errors while reconcile Flux Kustomization(s)
      expr: gotk_resource_info{customresource_kind=~"Kustomization",
        ready="False"}
      for: 5m
      labels:
        severity: warning
{{- if .Values.defaultRules.additionalRuleLabels }}
{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}
{{- end }}
    - alert: FluxHelmReleaseFailing
      annotations:
        description: Flux HelmRelease {{`{{`}} $labels.name {{`}}`}} in namespace {{`{{`}} $labels.namespace {{`}}`}} failed.
        runbook_url: {{ .Values.defaultRules.runbookUrl }}/{{ .Template.Name }}
        summary: Errors while reconcile Flux HelmRelease(s)
      expr: gotk_resource_info{customresource_kind=~"HelmRelease",
        ready="False"}
      for: 5m
      labels:
        severity: warning
{{- if .Values.defaultRules.additionalRuleLabels }}
{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}
{{- end }}
    - alert: FluxSourceFailing
      annotations:
        description: Flux Source {{`{{`}} $labels.name {{`}}`}} in namespace {{`{{`}} $labels.namespace {{`}}`}} failed.
        runbook_url: {{ .Values.defaultRules.runbookUrl }}/{{ .Template.Name }}
        summary: Errors while reconcile Flux Source(s)
      expr: gotk_resource_info{customresource_kind=~"GitRepository|HelmRepository|Bucket|OCIRepository",
        ready="False"}
      for: 5m
      labels:
        severity: warning
{{- if .Values.defaultRules.additionalRuleLabels }}
{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}
{{- end }}
    - alert: FluxResourceSuspended
      annotations:
        description: Flux Resource {{`{{`}} $labels.name {{`}}`}} in namespace {{`{{`}} $labels.namespace {{`}}`}} suspended.
        runbook_url: {{ .Values.defaultRules.runbookUrl }}/{{ .Template.Name }}
        summary: Flux Resource(s) are suspended for an extended period of time.
      expr: gotk_resource_info{suspended="true"}
      for: 2h
      labels:
        severity: none
{{- if .Values.defaultRules.additionalRuleLabels }}
{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}
{{- end }}

We send alerts for failing resources like GitRepo, Kustomization, HelmCharts and HelmReleases.
We added the "suspended" alert with a timeout of 2h in case someone is troubleshooting something and forgets to resume a flux resource after that.

from awesome-prometheus-alerts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.