Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prometheus scraper for jobportal busniess metrics provided by n8n #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion roles/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ And include it in your playbook.

## Docs

### Predefined srape configs
### Predefined scrape configs

The `prometheus.yml` template contains predefined srcape jobs that lookup proxy configurations of `prometheus_hosts` in the Ansible inventory.

Expand All @@ -90,6 +90,24 @@ The `prometheus.yml` template contains predefined srcape jobs that lookup proxy
* **n8n https**: Targets are `nginx_proxies` with exporter `n8n`.
* **blackbox**: Targets are `nginx_proxies` with `monitor` not false and host is `blackbox01:9115`.

### Custom scrapers

override the variable `prometheus_custom_scrapers`
example:
```
prometheus_custom_scrapers: |
- job_name: n8n business metrics https
metrics_path: "/webhook/metrics"
scrape_interval: 60s
honor_labels: true
scheme: https
basic_auth:
username: {{ prometheus_n8n_business_metrics_username }}
password: {{ prometheus_n8n_business_metrics_password }}
static_configs:
- targets: ['n8n.example.com']
```

### Deploy Prometheus container

Select multiple inventories when deploying.
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 @@ -19,6 +19,7 @@ prometheus_n8n_exporter_proxy_basic_auth_password: "'{{ vault_prometheus_n8n_exp
prometheus_meilisearch_exporter_api_key: "{{ vault_prometheus_meilisearch_exporter_api_key }}"
prometheus_alerting: {}
prometheus_rules: {}
prometheus_custom_scrapers: ""
# system.yml: |
# {% raw %}
# groups:
Expand Down
2 changes: 1 addition & 1 deletion roles/prometheus/templates/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ scrape_configs:
- target_label: __address__
replacement: {{ blackbox_exporter_hostname }}:9115
{% endif %}

{% if prometheus_n8n_exporter_proxy_basic_auth_username is defined %}
- job_name: n8n https
metrics_path: "/n8n-exporter/metrics"
Expand All @@ -164,3 +163,4 @@ scrape_configs:
static_configs:
- targets: {{ prometheus_hosts | map('extract', hostvars) | json_query('[*].nginx_proxies[?exporter!=null && contains(exporter, `meilisearch`)].src_hostname') | flatten }}
{% endif %}
{{ prometheus_custom_scrapers | indent(2) }}