Compare commits
21 Commits
8e5f14cf5f
...
main
Author | SHA1 | Date | |
---|---|---|---|
57e6341eac | |||
2c0f69c7d4 | |||
cc60702464 | |||
00808cdd68 | |||
603575ef4f | |||
d292f6dca1 | |||
3276795293 | |||
09347dfb4b | |||
4903dc467d | |||
0799a41a01 | |||
07f55dae29 | |||
999ebbffed | |||
e966b8abc2 | |||
ff4e3b5e68 | |||
e5d1adeded | |||
b0e49711cb | |||
e46839c397 | |||
52b7b73a25 | |||
834b1a6d5e | |||
ad01295f6c | |||
2a0b7d44ca |
9
LICENSE
Normal file
9
LICENSE
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 ansible-roles
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -15,7 +15,10 @@ The present role :
|
||||
- mysql
|
||||
- postgres
|
||||
- mongodb
|
||||
- elasticsearch
|
||||
- nginx
|
||||
- opensearch (via plugin for opensearch https://github.com/aiven/prometheus-exporter-plugin-for-opensearch)
|
||||
- rabbitmq
|
||||
- Deploys Grafana with a dashboard for each exporter configured.
|
||||
- Supports deploying VictoriaMetrics as the Prometheus backend.
|
||||
|
||||
@ -27,6 +30,7 @@ The role has been successfully tested on :
|
||||
- Debian 9
|
||||
- Debian 10
|
||||
- Debian 11
|
||||
- Debian 12
|
||||
|
||||
Forced upgrade of installed exporters can be done by setting the extra parameters "exporter_upgrade" to "yes".
|
||||
|
||||
@ -90,7 +94,7 @@ TODO
|
||||
License
|
||||
-------
|
||||
|
||||
GPLv3
|
||||
MIT
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
@ -70,6 +70,8 @@ prometheus_postgres_exporter_user: "postgres"
|
||||
prometheus_postgres_exporter_password: "changeme_"
|
||||
prometheus_postgres_exporter_port: 5432
|
||||
|
||||
prometheus_proxmox_venv_path: "/opt/venv/prometheus-pve-exporter"
|
||||
|
||||
prometheus_redis_exporter_addr: "redis://localhost:6379"
|
||||
prometheus_redis_exporter_user: ""
|
||||
prometheus_redis_exporter_password: ""
|
||||
@ -86,3 +88,7 @@ grafana_log_level: error
|
||||
grafana_router_logging: false
|
||||
grafana_disable_sanitize_html: true
|
||||
grafana_traefik_entrypoint: 'websecure'
|
||||
|
||||
# cloudflare
|
||||
|
||||
prometheus_cloudflare_dns: "1.1.1.1"
|
||||
|
@ -62,6 +62,9 @@
|
||||
| prometheus_postgres_exporter_user | The user for Postgres exporter | String | "postgres" |
|
||||
| prometheus_postgres_exporter_password | The password for Postgres exporter | String | "changeme_" |
|
||||
| prometheus_postgres_exporter_port | The port for Postgres exporter | Integer | 5432 |
|
||||
| prometheus_proxmox_exporter_user | Username used to contact Proxmox API | String | "" |
|
||||
| prometheus_proxmox_exporter_password | Password for previous username | String | "" |
|
||||
| prometheus_proxmox_exporter_node | Proxmox node to metrics from | String | "" |
|
||||
| prometheus_redis_exporter_addr | The address for Redis exporter | String | "redis://localhost:6379" |
|
||||
| prometheus_redis_exporter_user | The user for Redis exporter | String | "" |
|
||||
| prometheus_redis_exporter_password | The password for Redis exporter | String | "" |
|
||||
|
4751
files/dashboards/elasticsearch.json
Normal file
4751
files/dashboards/elasticsearch.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,11 +18,9 @@
|
||||
"description": "NFS Prometheus Dashboard",
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"gnetId": 6257,
|
||||
"graphTooltip": 0,
|
||||
"id": 30,
|
||||
"id": 13,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
@ -36,11 +34,13 @@
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 20,
|
||||
"gradientMode": "none",
|
||||
@ -50,7 +50,7 @@
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineInterpolation": "smooth",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
@ -72,8 +72,7 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@ -92,7 +91,6 @@
|
||||
"y": 0
|
||||
},
|
||||
"id": 243,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [
|
||||
@ -108,11 +106,12 @@
|
||||
"sortDesc": true
|
||||
},
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.1.1",
|
||||
"pluginVersion": "11.6.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
@ -121,7 +120,7 @@
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (instance) (rate(node_nfs_requests_total{instance=~\"$node\", job=~\"$job\", proto=\"4\"}[5m]))",
|
||||
"expr": "sum by (instance) (rate(node_nfs_requests_total{instance=~\"$node\"}[5m]))",
|
||||
"format": "time_series",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
@ -149,11 +148,13 @@
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "Connections",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 20,
|
||||
"gradientMode": "none",
|
||||
@ -163,7 +164,7 @@
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineInterpolation": "smooth",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
@ -185,8 +186,7 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@ -205,7 +205,6 @@
|
||||
"y": 10
|
||||
},
|
||||
"id": 267,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [
|
||||
@ -221,11 +220,12 @@
|
||||
"sortDesc": true
|
||||
},
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.1.1",
|
||||
"pluginVersion": "11.6.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
@ -234,7 +234,7 @@
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (method) (rate(node_nfs_requests_total{instance=~\"$node\", job=~\"$job\", proto=\"4\"}[5m]))",
|
||||
"expr": "sum by (method) (rate(node_nfs_requests_total{instance=~\"$node\"}[5m]))",
|
||||
"format": "time_series",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
@ -263,21 +263,23 @@
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 10,
|
||||
"gradientMode": "hue",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineInterpolation": "smooth",
|
||||
"lineStyle": {
|
||||
"fill": "solid"
|
||||
},
|
||||
@ -302,8 +304,7 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@ -322,7 +323,6 @@
|
||||
"y": 20
|
||||
},
|
||||
"id": 268,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [
|
||||
@ -335,11 +335,12 @@
|
||||
"sortDesc": true
|
||||
},
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.1.1",
|
||||
"pluginVersion": "11.6.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
@ -348,13 +349,13 @@
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "100 - (node_filesystem_avail_bytes{instance=~\"$node\", job=\"$job\", fstype=\"nfs4\"} * 100 / node_filesystem_size_bytes{instance=~\"$node\", job=\"$job\", fstype=\"nfs4\"})",
|
||||
"expr": "avg(100 - (node_filesystem_avail_bytes{instance=~\"$node\", fstype=\"$type\"} * 100 / node_filesystem_size_bytes{instance=~\"$node\", fstype=\"$type\"})) by (mountpoint)",
|
||||
"format": "time_series",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
"intervalFactor": 1,
|
||||
"legendFormat": "{{instance}} {{device}}",
|
||||
"legendFormat": "{{device}}",
|
||||
"range": true,
|
||||
"refId": "C",
|
||||
"step": 240,
|
||||
@ -377,13 +378,15 @@
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 10,
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "hue",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
@ -391,7 +394,7 @@
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineInterpolation": "smooth",
|
||||
"lineStyle": {
|
||||
"fill": "solid"
|
||||
},
|
||||
@ -416,8 +419,7 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@ -436,7 +438,6 @@
|
||||
"y": 20
|
||||
},
|
||||
"id": 269,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [
|
||||
@ -449,11 +450,12 @@
|
||||
"sortDesc": true
|
||||
},
|
||||
"tooltip": {
|
||||
"hideZeros": false,
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.1.1",
|
||||
"pluginVersion": "11.6.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
@ -462,13 +464,13 @@
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "node_filesystem_device_error{instance=~\"$node\", job=\"$job\", fstype=\"nfs4\"}",
|
||||
"expr": "avg(node_filesystem_device_error{instance=~\"$node\", fstype=\"$type\"}) by (mountpoint)",
|
||||
"format": "time_series",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
"intervalFactor": 1,
|
||||
"legendFormat": "{{instance}} {{device}}",
|
||||
"legendFormat": "{{device}}",
|
||||
"range": true,
|
||||
"refId": "C",
|
||||
"step": 240,
|
||||
@ -479,65 +481,54 @@
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
"refresh": "5m",
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"schemaVersion": 41,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"current": {
|
||||
"selected": false,
|
||||
"text": "node",
|
||||
"value": "node"
|
||||
"text": "All",
|
||||
"value": "$__all"
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "yPhvsDP7k"
|
||||
},
|
||||
"definition": "",
|
||||
"hide": 2,
|
||||
"includeAll": false,
|
||||
"label": "Job",
|
||||
"multi": false,
|
||||
"name": "job",
|
||||
"definition": "label_values(node_boot_time_seconds,instance)",
|
||||
"includeAll": true,
|
||||
"label": "Host:",
|
||||
"name": "node",
|
||||
"options": [],
|
||||
"query": "label_values(node_boot_time_seconds, job)",
|
||||
"query": {
|
||||
"qryType": 1,
|
||||
"query": "label_values(node_boot_time_seconds,instance)",
|
||||
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 1,
|
||||
"tagValuesQuery": "",
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
"current": {
|
||||
"selected": true,
|
||||
"text": [],
|
||||
"value": []
|
||||
"text": "All",
|
||||
"value": "$__all"
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "yPhvsDP7k"
|
||||
},
|
||||
"definition": "",
|
||||
"hide": 0,
|
||||
"definition": "label_values(node_filesystem_avail_bytes{instance=~\"$node\"},fstype)",
|
||||
"includeAll": true,
|
||||
"label": "Host:",
|
||||
"multi": true,
|
||||
"name": "node",
|
||||
"label": "Type",
|
||||
"name": "type",
|
||||
"options": [],
|
||||
"query": "label_values(node_boot_time_seconds{job=~\"$job\"}, instance)",
|
||||
"query": {
|
||||
"qryType": 1,
|
||||
"query": "label_values(node_filesystem_avail_bytes{instance=~\"$node\"},fstype)",
|
||||
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 1,
|
||||
"tagValuesQuery": "",
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
"regex": "/^nfs4?.*/",
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -545,34 +536,9 @@
|
||||
"from": "now-24h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
"time_options": [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
]
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "browser",
|
||||
"title": "NFS",
|
||||
"uid": "cc0d5bef-8b9d-47df-8be7-cf75c3efeece",
|
||||
"version": 12,
|
||||
"weekStart": ""
|
||||
"version": 3
|
||||
}
|
||||
|
@ -88,7 +88,7 @@
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 20,
|
||||
"h": 8,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
@ -872,7 +872,7 @@
|
||||
]
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 11,
|
||||
"h": 20,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 21
|
||||
|
8389
files/dashboards/rabbitmq.json
Normal file
8389
files/dashboards/rabbitmq.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -103,3 +103,10 @@
|
||||
state: restarted
|
||||
enabled: yes
|
||||
tags: ['prometheus']
|
||||
|
||||
- name: 'elasticsearch-exporter-restart'
|
||||
systemd:
|
||||
name: prometheus-elasticsearch-exporter.service
|
||||
state: restarted
|
||||
enabled: yes
|
||||
tags: ['prometheus']
|
||||
|
@ -3,7 +3,7 @@ galaxy_info:
|
||||
author: Ludovic Cartier
|
||||
description: Install and configure Prometheus and exporters
|
||||
company: brainsys
|
||||
license: GPLv3
|
||||
license: MIT
|
||||
min_ansible_version: 2.8
|
||||
issue_tracker_url: https://github.com/ludal13/ansible-role-prometheus/issues
|
||||
github_branch: master
|
||||
issue_tracker_url: https://git.brainsys.io/ansible-roles/prometheus/issues
|
||||
github_branch: main
|
||||
|
3
tasks/exporter/services/elasticsearch.yml
Normal file
3
tasks/exporter/services/elasticsearch.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- include_tasks: ../common.yml
|
||||
tags: ['prometheus_elasticsearch_exporter']
|
@ -7,11 +7,22 @@
|
||||
- prometheus_proxmox_exporter_node is defined
|
||||
tags: ['prometheus_proxmox']
|
||||
|
||||
- name: 'proxmox exporter | install package through pip3'
|
||||
- name: 'proxmox exporter | create dedicated venv path'
|
||||
file:
|
||||
path: "{{ prometheus_proxmox_venv_path | default('/opt/venv/prometheus-pve-exporter') }}"
|
||||
state: directory
|
||||
tags: ['prometheus_proxmox']
|
||||
|
||||
- name: 'proxmox exporter | create dedicated venv'
|
||||
command:
|
||||
cmd: python3 -m venv "{{ prometheus_proxmox_venv_path | default('/opt/venv/prometheus-pve-exporter') }}"
|
||||
tags: ['prometheus_proxmox']
|
||||
|
||||
- name: 'proxmox exporter | install package into a dedicated venv'
|
||||
pip:
|
||||
name:
|
||||
- prometheus-pve-exporter
|
||||
executable: pip3
|
||||
virtualenv: "{{ prometheus_proxmox_venv_path | default('/opt/venv/prometheus-pve-exporter') }}"
|
||||
tags: ['prometheus_proxmox']
|
||||
|
||||
- name: 'proxmox exporter | configuration'
|
||||
|
@ -292,3 +292,23 @@
|
||||
mode: '0750'
|
||||
when: prometheus_nginx_exporter_targets is defined
|
||||
notify: "grafana-prometheus-restart"
|
||||
|
||||
- name: "grafana-prometheus | import grafana elasticsearch dashboard"
|
||||
copy:
|
||||
src: dashboards/elasticsearch.json
|
||||
dest: /opt/docker-compose/grafana-prometheus/dashboards/elasticsearch.json
|
||||
owner: '1000'
|
||||
group: '1000'
|
||||
mode: '0750'
|
||||
when: prometheus_elasticsearch_exporter_targets is defined
|
||||
notify: "grafana-prometheus-restart"
|
||||
|
||||
- name: "grafana-prometheus | import grafana rabbitmq dashboard"
|
||||
copy:
|
||||
src: dashboards/rabbitmq.json
|
||||
dest: /opt/docker-compose/grafana-prometheus/dashboards/rabbitmq.json
|
||||
owner: '1000'
|
||||
group: '1000'
|
||||
mode: '0750'
|
||||
when: prometheus_rabbitmq_exporter_targets is defined
|
||||
notify: "grafana-prometheus-restart"
|
@ -18,3 +18,5 @@ services:
|
||||
- 8082:8080
|
||||
networks:
|
||||
- {{ prometheus_docker_network }}
|
||||
dns:
|
||||
- "{{ prometheus_cloudflare_dns }}"
|
||||
|
@ -105,11 +105,11 @@ services:
|
||||
traefik.http.routers.prometheus.tls.certresolver: letsencrypt
|
||||
traefik.http.routers.prometheus.entrypoints: "{{ grafana_traefik_entrypoint }}"
|
||||
traefik.http.services.prometheus.loadbalancer.server.port: 9090
|
||||
{% else %}
|
||||
{% if prometheus_traefik_ipwhitelist is defined %}
|
||||
traefik.http.middlewares.prometheus-clientips.ipwhitelist.sourcerange: {{ prometheus_traefik_ipwhitelist }}
|
||||
traefik.http.routers.prometheus.middlewares: "prometheus-clientips@docker"
|
||||
{% endif %}
|
||||
{% else %}
|
||||
ports:
|
||||
- "{{ prometheus_port | default(9090) }}:9090"
|
||||
{% endif %}
|
||||
@ -160,6 +160,8 @@ services:
|
||||
- '-loggerLevel=ERROR'
|
||||
volumes:
|
||||
- /etc/prometheus:/etc/vmagent
|
||||
labels:
|
||||
com.centurylinklabs.watchtower.enable: {{ prometheus_watchtower_enable | default('true') }}
|
||||
networks:
|
||||
- grafana
|
||||
{% if prometheus_nodes_ip is defined %}
|
||||
|
@ -414,13 +414,13 @@ scrape_configs:
|
||||
replacement: '${1}'
|
||||
|
||||
{% endif %}
|
||||
{% if prometheus_pve_exporter_targets is defined %}
|
||||
{% if prometheus_proxmox_exporter_targets is defined %}
|
||||
# proxmox #
|
||||
- job_name: pve
|
||||
scrape_interval: 30s
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in prometheus_pve_exporter_targets %}
|
||||
{% for target in prometheus_proxmox_exporter_targets %}
|
||||
- {{ target }}:9221
|
||||
{% endfor %}
|
||||
metrics_path: /pve
|
||||
|
@ -408,13 +408,13 @@ scrape_configs:
|
||||
replacement: '${1}'
|
||||
|
||||
{% endif %}
|
||||
{% if prometheus_pve_exporter_targets is defined %}
|
||||
{% if prometheus_proxmox_exporter_targets is defined %}
|
||||
# proxmox #
|
||||
- job_name: pve
|
||||
scrape_interval: 30s
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in prometheus_pve_exporter_targets %}
|
||||
{% for target in prometheus_proxmox_exporter_targets %}
|
||||
- {{ target }}:9221
|
||||
{% endfor %}
|
||||
metrics_path: /pve
|
||||
@ -515,3 +515,30 @@ scrape_configs:
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% if prometheus_elasticsearch_exporter_targets is defined %}
|
||||
# Elasticsearch #
|
||||
- job_name: elasticsearch
|
||||
scrape_interval: 30s
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in prometheus_elasticsearch_exporter_targets %}
|
||||
- {{ target }}:9114
|
||||
{% endfor %}
|
||||
relabel_configs:
|
||||
- source_labels: [ __address__ ]
|
||||
target_label: instance
|
||||
regex: '(.*):9114'
|
||||
replacement: '${1}'
|
||||
|
||||
{% endif %}
|
||||
{% if prometheus_rabbitmq_exporter_targets is defined %}
|
||||
# Rabbitmq #
|
||||
- job_name: rabbitmq
|
||||
scrape_interval: 15s
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in prometheus_rabbitmq_exporter_targets %}
|
||||
- {{ target }}:15692
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Prometheus Elasticsearch Exporter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/prometheus-elasticsearch-exporter {% if prometheus_elasticsearch_user is defined %}--es.uri="http://{{ prometheus_elasticsearch_user }}:{{ prometheus_elasticsearch_password }}@localhost:9200"{% endif %}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -5,6 +5,6 @@ Wants=network.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
ExecStart=/usr/local/bin/pve_exporter --config.file /etc/default/prometheus-proxmox-exporter --web.listen-address {{ prometheus_proxmox_exporter_node }}:{{ prometheus_proxmox_exporter_port | default('9221') }}
|
||||
ExecStart="{{ prometheus_proxmox_venv_path | default('/opt/venv/prometheus-pve-exporter') }}"/bin/pve_exporter --config.file /etc/default/prometheus-proxmox-exporter --web.listen-address {{ prometheus_proxmox_exporter_node }}:{{ prometheus_proxmox_exporter_port | default('9221') }}
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Reference in New Issue
Block a user