Skip to content

Commit

Permalink
Merge pull request #34 from oliverbeck-dev/feature/prometheus-uptime-…
Browse files Browse the repository at this point in the history
…kuma

Add uptime-kuma scraper to prometheus
  • Loading branch information
janikvonrotz authored Jan 30, 2025
2 parents 41dc486 + 15a893f commit 6b07b29
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ prometheus_odoo_exporter_basic_auth_password: # default: "{{ vault_prometheus_od
prometheus_n8n_exporter_basic_auth_username: n8n-exporter
prometheus_n8n_exporter_basic_auth_password: # default: "{{ vault_prometheus_n8n_exporter_basic_auth_password }}"
prometheus_meilisearch_exporter_api_key: "{{ vault_prometheus_meilisearch_exporter_api_key }}"
prometheus_uptime_kuma_exporter_password: "{{ vault_prometheus_uptime_kuma_exporter_password }}"
```
Ensure the targets nginx proxy includes the exporter config:
Expand Down
1 change: 1 addition & 0 deletions roles/prometheus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ prometheus_mysqld_exporter_basic_auth_password: "{{ vault_prometheus_mysqld_expo
prometheus_odoo_exporter_basic_auth_password: "{{ vault_prometheus_odoo_exporter_basic_auth_password }}"
prometheus_n8n_exporter_proxy_basic_auth_password: "'{{ vault_prometheus_n8n_exporter_proxy_basic_auth_password }}'"
prometheus_meilisearch_exporter_api_key: "{{ vault_prometheus_meilisearch_exporter_api_key }}"
prometheus_uptime_kuma_exporter_password: "{{ vault_prometheus_uptime_kuma_exporter_password }}"
prometheus_alerting: {}
prometheus_rules: {}
prometheus_custom_scrapers: ""
Expand Down
12 changes: 12 additions & 0 deletions roles/prometheus/templates/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ scrape_configs:
static_configs:
- targets: {{ prometheus_hosts | map('extract', hostvars) | json_query('[*].nginx_proxies[?exporter!=null && contains(exporter, `n8n`)].src_hostname') | flatten }}
{% endif %}
{% if prometheus_uptime_kuma_exporter_username is defined %}
- job_name: uptime-kuma https
metrics_path: "/metrics"
scrape_interval: 15s
honor_labels: true
scheme: https
basic_auth:
username: {{ prometheus_uptime_kuma_exporter_username }}
password: {{ prometheus_uptime_kuma_exporter_password }}
static_configs:
- targets: {{ prometheus_hosts | map('extract', hostvars) | json_query('[*].nginx_proxies[?exporter!=null && contains(exporter, `uptime-kuma`)].src_hostname') | flatten }}
{% endif %}
{% if prometheus_meilisearch_exporter_api_key is defined %}
- job_name: meilisearch https
metrics_path: "/metrics"
Expand Down

0 comments on commit 6b07b29

Please sign in to comment.