Skip to content
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(charts): rollup application monitoring #1601

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/composer/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.1.4
version: 0.1.5

# 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
21 changes: 21 additions & 0 deletions charts/composer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ Namepsace to deploy elements into.
{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{/*
application name to deploy elements into.
*/}}
{{- define "composer.appName" -}}
composer
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "composer.selectorLabels" -}}
app: {{ include "rollup.appName" . }}
{{- end }}

{{/*
Single entry of rollup names
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/composer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
ports:
{{- if .Values.metrics.enabled }}
- containerPort: {{ .Values.ports.metrics }}
name: metrics
name: composer-metrics
{{- end }}
- containerPort: {{ .Values.ports.healthApi }}
name: health-api
Expand Down
6 changes: 3 additions & 3 deletions charts/composer/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ spec:
kind: Service
apiVersion: v1
metadata:
name: metrics
name: composer-metrics
namespace: {{ include "composer.namespace" . }}
labels:
app: composer
spec:
selector:
app: composer
ports:
- name: metrics
- name: composer-metrics
port: {{ .Values.ports.metrics }}
targetPort: geth-metr
targetPort: composer-metrics
{{- end }}
2 changes: 1 addition & 1 deletion charts/composer/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
matchLabels:
app: composer
endpoints:
- port: metrics
- port: composer-metrics
path: /
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
Expand Down
23 changes: 23 additions & 0 deletions charts/composer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@ serviceMonitor:
additionalLabels:
release: kube-prometheus-stack

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: Composer_Node_Down
expr: up{container="composer"} == 0 # Insert your query Expression
for: 1m # Rough number but should be enough to init warn
labels:
severity: warning
annotations:
summary: Composer is Down (instance {{ $labels.instance }})
description: "composer node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

# When deploying in a production environment should use a secret provider
# This is configured for use with GCP, need to set own resource names
# and keys
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-bridge-withdrawer/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.3.0
version: 0.3.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
21 changes: 21 additions & 0 deletions charts/evm-bridge-withdrawer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,24 @@ Namepsace to deploy elements into.
{{- define "evm-bridge-withdrawer.image" -}}
{{ .Values.images.evmBridgeWithdrawer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.evmBridgeWithdrawer.devTag }}{{ else }}{{ .Values.images.evmBridgeWithdrawer.tag }}{{ end }}
{{- end }}

{{/*
application name to deploy elements into.
*/}}
{{- define "evm-bridge-withdrawer.appName" -}}
evm-bridge-withdrawer
{{- end }}

{{/*
Common labels
*/}}
{{- define "evm-bridge-withdrawer.labels" -}}
{{ include "evm-bridge-withdrawer.selectorLabels" . }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "evm-bridge-withdrawer.selectorLabels" -}}
app: {{ include "evm-bridge-withdrawer.appName" . }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/evm-bridge-withdrawer/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: evm-bridge-withdrawer-alerting
{{- if .Values.alerting.prometheusRule.namespace }}
namespace: {{ .Values.alerting.prometheusRule.namespace | quote }}
{{- end }}
labels:
{{- include "evm-bridge-withdrawer.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 "evm-bridge-withdrawer.appName" . }}
rules: {{- toYaml .Values.alerting.prometheusRule.rules | nindent 4 }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/evm-bridge-withdrawer/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ apiVersion: v1
metadata:
name: evm-bridge-withdrawer-metrics
namespace: {{ include "evm-bridge-withdrawer.namespace" . }}
labels:
{{- include "evm-bridge-withdrawer.labels" . | nindent 4 }}
spec:
selector:
app: evm-bridge-withdrawer
{{- include "evm-bridge-withdrawer.labels" . | nindent 4 }}
ports:
{{- if .Values.metrics.enabled }}
- name: metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
matchLabels:
app: evm-bridge-withdrawer
endpoints:
- port: metric
- port: metrics
path: /
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
Expand Down
23 changes: 23 additions & 0 deletions charts/evm-bridge-withdrawer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@ serviceMonitor:
additionalLabels:
release: kube-prometheus-stack

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: Bridge_Withdrawer_Down
expr: up{container="evm-bridge-withdrawer"} == 0 # Insert your query Expression
for: 1m # Rough number but should be enough to init warn
labels:
severity: warning
annotations:
summary: Bridge Withdrawer is Down (instance {{ $labels.instance }})
description: "bridge withdrawer node '{{ $labels.namespace }}' has disappeared from Prometheus target discovery.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

# When deploying in a production environment should use a secret provider
# This is configured for use with GCP, need to set own resource names
# and keys
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-rollup/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.27.5
version: 0.27.6

# 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
2 changes: 1 addition & 1 deletion charts/evm-rollup/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
{{- toYaml .Values.alerting.prometheusRule.additionalLabels | nindent 4 }}
{{- end }}
spec:
{{- if .Values.config.rollup.alerting.prometheusRule.rules }}
{{- if .Values.alerting.prometheusRule.rules }}
groups:
- name: {{ template "rollup.name" . }}
rules: {{- toYaml .Values.alerting.prometheusRule.rules | nindent 4 }}
Expand Down
10 changes: 5 additions & 5 deletions charts/evm-stack/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ dependencies:
version: 0.3.6
- name: evm-rollup
repository: file://../evm-rollup
version: 0.27.5
version: 0.27.6
- name: composer
repository: file://../composer
version: 0.1.4
version: 0.1.5
- name: evm-faucet
repository: file://../evm-faucet
version: 0.1.2
- name: evm-bridge-withdrawer
repository: file://../evm-bridge-withdrawer
version: 0.3.0
version: 0.3.1
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 15.2.4
- name: blockscout-stack
repository: https://blockscout.github.io/helm-charts
version: 1.6.2
digest: sha256:2d7e2f23cd9bbdb43b7cf42112db9ede0a7d5eee9e426b0b2344e43fcf52e1b1
generated: "2024-10-02T09:43:51.238571-04:00"
digest: sha256:0428a6d56fd86c170e322ad79c7b5f87628b6187a1df5ad47ae7c2281b7f12da
generated: "2024-10-14T15:11:45.153501+02:00"
8 changes: 4 additions & 4 deletions charts/evm-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ 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.6.2
version: 0.6.3

dependencies:
- name: celestia-node
version: 0.3.6
repository: "file://../celestia-node"
condition: celestia-node.enabled
- name: evm-rollup
version: 0.27.5
version: 0.27.6
repository: "file://../evm-rollup"
- name: composer
version: 0.1.4
version: 0.1.5
repository: "file://../composer"
condition: composer.enabled
- name: evm-faucet
version: 0.1.2
repository: "file://../evm-faucet"
condition: evm-faucet.enabled
- name: evm-bridge-withdrawer
version: 0.3.0
version: 0.3.1
repository: "file://../evm-bridge-withdrawer"
condition: evm-bridge-withdrawer.enabled
- name: postgresql
Expand Down
Loading