diff --git a/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml index 88067d4..dbc0de2 100644 --- a/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml +++ b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml @@ -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 diff --git a/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-prometheusrule.yaml b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-prometheusrule.yaml new file mode 100644 index 0000000..03651fb --- /dev/null +++ b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-prometheusrule.yaml @@ -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])) \ No newline at end of file diff --git a/kustomize/bases/helium-blockchain-exporter/kustomization.yaml b/kustomize/bases/helium-blockchain-exporter/kustomization.yaml index 4cf9958..9b38900 100644 --- a/kustomize/bases/helium-blockchain-exporter/kustomization.yaml +++ b/kustomize/bases/helium-blockchain-exporter/kustomization.yaml @@ -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= \ No newline at end of file diff --git a/kustomize/bases/prometheus/prometheus.yaml b/kustomize/bases/prometheus/prometheus.yaml index df9b673..a8e874a 100644 --- a/kustomize/bases/prometheus/prometheus.yaml +++ b/kustomize/bases/prometheus/prometheus.yaml @@ -4,6 +4,9 @@ metadata: name: prometheus spec: serviceAccountName: prometheus + ruleSelector: + matchLabels: + monitor: prometheus serviceMonitorSelector: matchLabels: monitor: prometheus diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index ff7a640..08c3cdf 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -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