1
0
Fork 0

fix prometheus rule selector and bump versions

This commit is contained in:
Massaki Archambault 2021-12-16 15:46:23 -05:00
parent d3c4b602c4
commit 29024da142
5 changed files with 46 additions and 7 deletions

View File

@ -14,11 +14,12 @@ spec:
containers:
- name: helium-blockchain-exporter
image: badjware/helium-blockchain-exporter
imagePullPolicy: Always
env:
- name: ACCOUNTS
valueFrom:
configMapKeyRef:
name: blackbox-exporter-config
name: helium-blockchain-exporter-config
key: ACCOUNTS
args:
- -accounts

View File

@ -0,0 +1,34 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: helium-blockchain-exporter-rules
labels:
monitor: prometheus
spec:
groups:
- name: helium-blockchain-exporter-rules
interval: 5m
rules:
# Accounts
- record: account:helium_account_deposits_hnt:increase30m
expr: sum by (account) (increase(helium_account_deposits_hnt_total[30m]))
- record: account:helium_account_withdrawals_hnt:increase30m
expr: -sum by (account) (increase(helium_account_withdrawals_hnt_total[30m]))
- record: type:helium_account_activity:floor_increase30m
expr: sum by (account, type) (floor(increase(helium_account_activity_total[30m])))
- record: account:helium_account_rewards_hnt:increase1h
expr: sum by (account) (increase(helium_account_rewards_hnt_total[1h]))
- record: account:helium_account_rewards_hnt:increase24h
expr: sum by (account) (increase(helium_account_rewards_hnt_total[24h]))
# Hotspots
- record: type:helium_hotspot_activity:floor_increase30m
expr: sum by (account, hotspot, hotspot_name, type) (floor(increase(helium_hotspot_activity_total[30m])))
- record: hotspot:helium_hotspot_rewards_hnt:increase30m
expr: sum by (account, hotspot, hotspot_name) (increase(helium_hotspot_rewards_hnt_total[30m]))
- record: hotspot:helium_hotspot_rewards_hnt:increase1h
expr: sum by (account, hotspot, hotspot_name) (increase(helium_hotspot_rewards_hnt_total[1h]))
- record: hotspot:helium_hotspot_rewards_hnt:increase24h
expr: sum by (account, hotspot, hotspot_name) (increase(helium_hotspot_rewards_hnt_total[24h]))
- record: hotspot:helium_hotspot_rewards_hnt:increase7d
expr: sum by (account, hotspot, hotspot_name) (increase(helium_hotspot_rewards_hnt_total[7d]))

View File

@ -1,9 +1,10 @@
resources:
- helium-blockchain-exporter-deployment.yaml
- helium-blockchain-exporter-servicemonitor.yaml
- helium-blockchain-exporter-prometheusrule.yaml
configMapGenerator:
- name: blackbox-exporter-config
- name: helium-blockchain-exporter-config
literals:
# set the helium accounts to scrape here
- ACCOUNTS=

View File

@ -4,6 +4,9 @@ metadata:
name: prometheus
spec:
serviceAccountName: prometheus
ruleSelector:
matchLabels:
monitor: prometheus
serviceMonitorSelector:
matchLabels:
monitor: prometheus

View File

@ -10,18 +10,18 @@ resources:
images:
- name: gitea/gitea
newTag: 1.15.0
newTag: 1.15.7
- name: grafana/grafana
newTag: 8.1.3
newTag: 8.3.3
- name: prom/node-exporter
newTag: v0.18.1
- name: prom/blackbox-exporter
newName: badjware/blackbox-exporter-tweak
newTag: 0.19.0-1
- name: drone/drone
newTag: 2.0.6
newTag: 2.7.0
- name: drone/drone-runner-kube
newTag: 1.0.0-beta.9
newTag: 1.0.0-rc.2
- name: nextcloud
newName: badjware/nextcloud-tweak
newTag: 22.1.0-2
@ -31,7 +31,7 @@ images:
newTag: 6.2.5
configMapGenerator:
- name: blackbox-exporter-config
- name: helium-blockchain-exporter-config
behavior: replace
literals:
- ACCOUNTS=13ntuT3ZC5A1RKEUciXh7qxvQvZ38azqBPHSdUGTpun8evVVTVy