Skip to content

Commit

Permalink
prometheus-rules, default values
Browse files Browse the repository at this point in the history
  • Loading branch information
quasystaty1 committed Sep 30, 2024
1 parent e8830b0 commit 4a01516
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/hermes/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enabled = {{ .Values.rest.enabled }}

# Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful
# API requests. Default: 127.0.0.1
host = '127.0.0.1'
host = '0.0.0.0'

# Specify the port over which the built-in HTTP server will serve the restful API
# requests. Default: 3000
Expand All @@ -35,7 +35,7 @@ tx_confirmation = {{ .Values.mode.packets.txConfirmation }}

[telemetry]
enabled = {{ .Values.telemetry.enabled }}
host = '127.0.0.1'
host = '0.0.0.0'
port = {{ .Values.ports.telemetry }}

[telemetry.buckets]
Expand Down
14 changes: 14 additions & 0 deletions charts/hermes/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "hermes.labels" -}}
{{ include "hermes.selectorLabels" . }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "hermes.selectorLabels" -}}
app: {{ include "hermes.fullname" . }}
{{- end }}

{{/*
Return if ingress is stable.
*/}}
Expand Down
20 changes: 20 additions & 0 deletions charts/hermes/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.alerting.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "hermes.fullname" . }}
{{- if .Values.alerting.prometheusRule.namespace }}
namespace: {{ .Values.alerting.prometheusRule.namespace | quote }}
{{- end }}
labels:
{{- include "hermes.labels" . | nindent 4 }}
{{- if .Values.alerting.prometheusRule.additionalLabels }}
{{- toYaml .Values.alerting.prometheusRule.additionalLabels | nindent 4 }}
{{- end }}
spec:
{{- if .Values.alerting.prometheusRule.rules }}
groups:
- name: {{ template "hermes.fullname" . }}
rules: {{- toYaml .Values.alerting.prometheusRule.rules | nindent 4 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/hermes/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
targetPort: rest
{{- end }}
{{- if .Values.telemetry.enabled }}
- name: telemetry-svc
- name: telemetry
port: {{ .Values.ports.telemetry }}
targetPort: telemetry
{{- end }}
Expand Down
25 changes: 24 additions & 1 deletion charts/hermes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ global:
replicaCount: 1
logLevel: debug

image: ghcr.io/penumbra-zone/hermes:main
image: ghcr.io/astriaorg/hermes:sha-450f848
imagePullPolicy: IfNotPresent

fullnameOverride: ""
Expand Down Expand Up @@ -195,3 +195,26 @@ ingress:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

alerting:
enabled: false
interval: ""
additionalLabels:
release: kube-prometheus-stack
annotations: {}
# scrapeTimeout: 10s
# path: /metrics
prometheusRule:
enabled: true
additionalLabels:
release: kube-prometheus-stack
namespace: monitoring
rules:
- alert: Chain_Node_Down
expr: up{container="cometbft"} == 0 # Insert your query Expression
for: 1m # Rough number but should be enough to init warn
labels:
severity: critical
annotations:
summary: Chain Node is Down (instance {{ $labels.instance }})
description: "chain node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

0 comments on commit 4a01516

Please sign in to comment.