Skip to content

Commit

Permalink
feat: add prometheus rule for vsl rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Aug 7, 2024
1 parent 62b8ecd commit 05cf9d8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/vsl-rpc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
26 changes: 26 additions & 0 deletions charts/vsl-rpc/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.prometheusrule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "vsl-rpc.fullname" . }}
labels:
{{- include "vsl-rpc.labels" . | nindent 4 }}
{{- with .Values.prometheusrule.additionalAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
groups:
- name: {{ template "vsl-rpc.fullname" . }}
{{- with .Values.prometheusrule.spec }}
rules:
{{- range . }}
- alert: {{ .alert }}
expr: |-
{{ tpl .expr $ }}
for: {{ .for }}
labels: {{ toYaml .labels | nindent 12 }}
annotations: {{ toYaml .annotations | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
20 changes: 19 additions & 1 deletion charts/vsl-rpc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,22 @@ tolerations: []
affinity: {}

servicemonitor:
enabled: false
enabled: false
prometheusrule:
enabled: false
# Additional labels for PrometheusRule alerts
additionalLabels: {}
# Additional annotations for PrometheusRule alerts
additionalAnnotations: {}
# Spec rule for PrometheusRule alerts
spec:
- alert: L2SafeSyncRateLow
expr: |
rate(sum(op_node_default_refs_number{layer="l2", type="l2_safe",job="{{ template "vsl-rpc.fullname" . }}-node"}) by (pod)[5m]) < 0.1
for: 5m
labels:
severity: warning
chain: vsl
annotations:
summary: L2 Safe sync rate is below 10%
description: "Cluster {{ $labels.cluster_name }} pod {{ $labels.pod }} has a sync rate below 10% for the last 5 minutes."
6 changes: 3 additions & 3 deletions charts/vsl-sequencer/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: vsl-rpc
repository: file://../vsl-rpc
version: 0.2.0
version: 0.2.1
- name: op-batcher
repository: file://../op-batcher
version: 0.1.0
- name: op-proposer
repository: file://../op-proposer
version: 0.1.0
digest: sha256:af18a0542005b0ebcc31de78dedf19fa5cc4865f76ee2cc9f8f9e7970c2d2de3
generated: "2024-05-07T13:44:25.912371+08:00"
digest: sha256:7711bc7a1c3e1241ff922aa541e25b53a88a3f97b72010d1abeb11214eca73d5
generated: "2024-08-07T16:49:53.811117+08:00"
4 changes: 2 additions & 2 deletions charts/vsl-sequencer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -25,7 +25,7 @@ appVersion: "1.16.0"

dependencies:
- name: vsl-rpc
version: 0.2.0
version: 0.2.1
repository: "file://../vsl-rpc"
alias: vsl-sequencer
- name: op-batcher
Expand Down
2 changes: 2 additions & 0 deletions charts/vsl-sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ vsl-sequencer:
- --sequencer.enabled=true
- --sequencer.stopped=true
- --rpc.enable-admin=true
prometheusrule:
enabled: true

externalService:
enabled: false
Expand Down

0 comments on commit 05cf9d8

Please sign in to comment.