Skip to content

Commit

Permalink
Merge pull request #20 from Starttoaster/prometheusrules
Browse files Browse the repository at this point in the history
Add some prometheus rules to the helm chart
  • Loading branch information
Starttoaster authored Mar 11, 2024
2 parents 3f068b3 + d5d3129 commit ad4e92f
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ config:
# optional: If you change this, change the service.port value too
port: '8080'

# optional
# optional: creates a ServiceMonitor that targets this exporter's service -- for use with the kube-prometheus operator
serviceMonitor:
enabled: false
## The label to use to retrieve the job name from.
Expand All @@ -82,6 +82,10 @@ serviceMonitor:
targetLabels: []
relabelings: []
metricRelabelings: []

# optional: creates a PrometheusRule with some basic alerts for proxmox clusters -- for use with the kube-prometheus operator
prometheusRule:
enabled: false
```
Install the chart:
Expand Down Expand Up @@ -143,7 +147,7 @@ A Grafana dashboard that implements this exporter with metrics from node_exporte

## Alerting

Some Prometheus alert rules that use metrics from this exporter are in the works. Contributions are welcome for this as well.
The Helm chart in this repository comes with some Prometheus rules for PVE servers. More alerts are being added to it over time. Find that in the `chart/proxmox-exporter/templates` directory.

## Metrics

Expand Down
2 changes: 1 addition & 1 deletion chart/proxmox-exporter/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.2
version: 0.1.3

# 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
47 changes: 47 additions & 0 deletions chart/proxmox-exporter/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "proxmox-exporter.fullname" . }}
labels:
{{- include "proxmox-exporter.labels" . | nindent 4 }}
spec:
groups:
- name: ProxmoxNodes
rules:
- alert: ProxmoxNodeDown
annotations:
title: Proxmox node {{ $labels.node }} is down
expr: |
proxmox_node_up == 0
for: 1m
labels:
severity: critical
- alert: ProxmoxNodeTargetLost
annotations:
title: Proxmox node up metric absent for {{ $labels.node }}
description: Something wrong with the exporter, the Proxmox API server(s) it is configured to make requests to, or the server the exporter is running on
expr: |
absent_over_time(proxmox_node_up[1h])
for: 1m
labels:
severity: critical
- alert: ProxmoxGuestDown
annotations:
title: Proxmox guest {{ $labels.name }} is down
description: Guest {{ $labels.name }} of type {{ $labels.type }} on node {{ $labels.node }} is down
expr: |
proxmox_guest_up == 0
for: 1m
labels:
severity: critical
- alert: ProxmoxGuestTargetLost
annotations:
title: Proxmox guest up metric absent for {{ $labels.name }}
description: Guest {{ $labels.name }} of type {{ $labels.type }} on node {{ $labels.node }} may be down
expr: |
absent_over_time(proxmox_guest_up[1h])
for: 1m
labels:
severity: critical
{{- end }}
3 changes: 3 additions & 0 deletions chart/proxmox-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ serviceMonitor:
relabelings: []
metricRelabelings: []

prometheusRule:
enabled: false

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit ad4e92f

Please sign in to comment.