feat(ntfy): enable prometheus metrics (#11389)

**Description**
ntfy support prometheus metrics: https://docs.ntfy.sh/config/#monitoring
This PR adds the ckeckbox in questions.yaml and the metrics: section in
values.yaml. The ntfy metrics variable is activated if user selects
prometheus metrics. It is disabled by default

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [x] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: polarstack <42521003+polarstack@users.noreply.github.com>
This commit is contained in:
polarstack 2023-08-12 10:23:24 +02:00 committed by GitHub
parent ea93a6153b
commit 39fa2a3361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

View File

@ -18,7 +18,7 @@ name: ntfy
sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/ntfy
- https://github.com/binwiederhier/ntfy/
version: 6.0.0
version: 6.0.1
annotations:
truecharts.org/catagories: |
- media

View File

@ -321,6 +321,8 @@ questions:
default: 568
# Include{resources}
# Include{metrics}
# Include{prometheusRule}
# Include{advanced}
# Include{addons}
# Include{codeserver}

View File

@ -50,6 +50,7 @@ workload:
ENABLE_CACHE_FILE: false
ENABLE_ATTACHMENT_CACHE_DIR: false
ENABLE_AUTH_FILE: false
NTFY_ENABLE_METRICS: "{{ .Values.metrics.main.enabled }}"
# NTFY_CACHE_DURATION: "12h"
# NTFY_KEEPALIVE_INTERVAL: "45s"
# NTFY_MANAGER_INTERVAL: "1m"
@ -76,3 +77,31 @@ workload:
envFrom:
- configMapRef:
name: "ntfy"
metrics:
main:
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
# @default -- See values.yaml
enabled: false
type: "servicemonitor"
endpoints:
- port: main
path: /metrics
# -- 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: UnifiPollerAbsent
# annotations:
# description: Unifi Poller has disappeared from Prometheus service discovery.
# summary: Unifi Poller is down.
# expr: |
# absent(up{job=~".*unifi-poller.*"} == 1)
# for: 5m
# labels:
# severity: critical