mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 07:59:02 +00:00
[promcord] metrics refactor (#1179)
* [promcord] metrics refactor * use include Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
This commit is contained in:
parent
e9595b94b0
commit
379e69a974
@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
appVersion: latest
|
appVersion: latest
|
||||||
description: Discord bot that provides metrics from a Discord server
|
description: Discord bot that provides metrics from a Discord server
|
||||||
name: promcord
|
name: promcord
|
||||||
version: 4.0.0
|
version: 5.0.0
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- promcord
|
- promcord
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# promcord
|
# promcord
|
||||||
|
|
||||||
![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
|
![Version: 5.0.0](https://img.shields.io/badge/Version-5.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
|
||||||
|
|
||||||
Discord bot that provides metrics from a Discord server
|
Discord bot that provides metrics from a Discord server
|
||||||
|
|
||||||
@ -80,7 +80,12 @@ N/A
|
|||||||
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
|
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
|
||||||
| image.repository | string | `"biospheere/promcord"` | image repository |
|
| image.repository | string | `"biospheere/promcord"` | image repository |
|
||||||
| image.tag | string | `"latest"` | image tag |
|
| image.tag | string | `"latest"` | image tag |
|
||||||
| prometheus.serviceMonitor | object | See values.yaml | Enable and configure a Prometheus podMonitor for the chart under this key. |
|
| metrics.enabled | bool | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. |
|
||||||
|
| metrics.prometheusRule | object | See values.yaml | Enable and configure Prometheus Rules for the chart under this key. |
|
||||||
|
| metrics.prometheusRule.rules | list | See prometheusrules.yaml | Configure additionial rules for the chart under this key. |
|
||||||
|
| metrics.serviceMonitor.interval | string | `"1m"` | |
|
||||||
|
| metrics.serviceMonitor.labels | object | `{}` | |
|
||||||
|
| metrics.serviceMonitor.scrapeTimeout | string | `"30s"` | |
|
||||||
| service | object | See values.yaml | Configures service settings for the chart. |
|
| service | object | See values.yaml | Configures service settings for the chart. |
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
@ -89,6 +94,12 @@ All notable changes to this application Helm chart will be documented in this fi
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
### [5.0.0]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- **BREAKING**: Refactored Prometheus metrics section to add rules. Enabling metrics automatically enables the serviceMonitor.
|
||||||
|
|
||||||
### [4.0.0]
|
### [4.0.0]
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
@ -113,6 +124,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
- New chart
|
- New chart
|
||||||
|
|
||||||
|
[5.0.0]: #500
|
||||||
[4.0.0]: #400
|
[4.0.0]: #400
|
||||||
[2.0.0]: #200
|
[2.0.0]: #200
|
||||||
[1.0.1]: #101
|
[1.0.1]: #101
|
||||||
|
@ -9,6 +9,12 @@ All notable changes to this application Helm chart will be documented in this fi
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
### [5.0.0]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- **BREAKING**: Refactored Prometheus metrics section to add rules. Enabling metrics automatically enables the serviceMonitor.
|
||||||
|
|
||||||
### [4.0.0]
|
### [4.0.0]
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
@ -33,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
- New chart
|
- New chart
|
||||||
|
|
||||||
|
[5.0.0]: #500
|
||||||
[4.0.0]: #400
|
[4.0.0]: #400
|
||||||
[2.0.0]: #200
|
[2.0.0]: #200
|
||||||
[1.0.1]: #101
|
[1.0.1]: #101
|
||||||
|
27
charts/stable/promcord/templates/prometheusrules.yaml
Normal file
27
charts/stable/promcord/templates/prometheusrules.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PrometheusRule
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.metrics.prometheusRule.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
groups:
|
||||||
|
- name: promcord
|
||||||
|
rules:
|
||||||
|
- alert: PromcordAbsent
|
||||||
|
annotations:
|
||||||
|
description: Promcord has disappeared from Prometheus service discovery.
|
||||||
|
summary: Promcord is down.
|
||||||
|
expr: |
|
||||||
|
absent(up{job=~".*promcord.*"} == 1)
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
{{- with .Values.metrics.prometheusRule.rules }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -1,11 +1,11 @@
|
|||||||
{{- if .Values.prometheus.serviceMonitor.enabled }}
|
{{- if .Values.metrics.enabled }}
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "common.names.fullname" . }}
|
name: {{ include "common.names.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
{{- include "common.labels" . | nindent 4 }}
|
||||||
{{- with .Values.prometheus.serviceMonitor.additionalLabels }}
|
{{- with .Values.metrics.serviceMonitor.labels }}
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
@ -14,10 +14,10 @@ spec:
|
|||||||
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
endpoints:
|
endpoints:
|
||||||
- port: metrics
|
- port: metrics
|
||||||
{{- with .Values.prometheus.serviceMonitor.interval }}
|
{{- with .Values.metrics.serviceMonitor.interval }}
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.prometheus.serviceMonitor.scrapeTimeout }}
|
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
scrapeTimeout: {{ . }}
|
scrapeTimeout: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
|
@ -33,11 +33,28 @@ env:
|
|||||||
# -- Discord bot token
|
# -- Discord bot token
|
||||||
# DISCORD_TOKEN:
|
# DISCORD_TOKEN:
|
||||||
|
|
||||||
prometheus:
|
metrics:
|
||||||
# -- Enable and configure a Prometheus podMonitor for the chart under this key.
|
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
|
||||||
# @default -- See values.yaml
|
# @default -- See values.yaml
|
||||||
|
enabled: false
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
|
||||||
interval: 1m
|
interval: 1m
|
||||||
scrapeTimeout: 30s
|
scrapeTimeout: 30s
|
||||||
additionalLabels: {}
|
labels: {}
|
||||||
|
# -- Enable and configure Prometheus Rules for the chart under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
prometheusRule:
|
||||||
|
enabled: false
|
||||||
|
labels: {}
|
||||||
|
# -- Configure additionial rules for the chart under this key.
|
||||||
|
# @default -- See prometheusrules.yaml
|
||||||
|
rules: []
|
||||||
|
# - alert: PromcordAbsent
|
||||||
|
# annotations:
|
||||||
|
# description: Promcord has disappeared from Prometheus service discovery.
|
||||||
|
# summary: Promcord is disabled.
|
||||||
|
# expr: |
|
||||||
|
# absent(up{job=~".promcord.*"} == 1)
|
||||||
|
# for: 15m
|
||||||
|
# labels:
|
||||||
|
# severity: critical
|
||||||
|
Loading…
Reference in New Issue
Block a user