Compare commits

...

30 Commits

Author SHA1 Message Date
57e6341eac rabbitmq - update dashboard 2025-05-20 15:13:03 +02:00
2c0f69c7d4 rabbitmq - remove errors on jobs 2025-05-20 15:06:48 +02:00
cc60702464 rabbitmq - job name 2025-05-20 14:48:29 +02:00
00808cdd68 add support for rabbitmq 2025-05-20 14:40:05 +02:00
603575ef4f update readme 2025-05-19 16:14:32 +02:00
d292f6dca1 add grafana dashboard for elasticsearch and provisionning 2025-05-19 16:03:14 +02:00
3276795293 chg port elasticsearch 2025-05-19 12:13:04 +02:00
09347dfb4b add handler for elasticsearch 2025-05-19 12:08:13 +02:00
4903dc467d add elasticsearch configuration and systemd 2025-05-19 12:00:07 +02:00
0799a41a01 add nfs version selector 2025-04-22 18:35:00 +02:00
07f55dae29 add meta info 2024-12-20 16:36:39 +01:00
999ebbffed update license to MIT 2024-12-20 16:18:02 +01:00
e966b8abc2 Add default dns to cloudflare container 2024-05-24 11:05:59 +02:00
ff4e3b5e68 Add users processes panel on mysqld dashboard 2024-05-24 11:00:22 +02:00
e5d1adeded pve to proxmox 2024-04-25 09:22:30 +02:00
b0e49711cb proxmox - virtualenv instead of venv 2024-04-24 18:14:08 +02:00
e46839c397 invisible char remove 2024-04-24 18:11:16 +02:00
52b7b73a25 proxmox - install into venv 2024-04-24 17:37:33 +02:00
834b1a6d5e vmagent - add watchtower label 2024-04-24 11:00:43 +02:00
ad01295f6c resize overview-cf table 2024-03-27 10:55:13 +01:00
2a0b7d44ca Revert "resize overview-cf table"
This reverts commit 8e5f14cf5f.
2024-03-27 10:54:54 +01:00
8e5f14cf5f resize overview-cf table 2024-03-27 10:52:40 +01:00
35d29a4015 minor fixes 2024-03-19 17:38:32 +01:00
33c19ea94b update node-exporter dashboard 2024-03-18 15:37:07 +01:00
1874526af4 add watchtower enable label 2024-03-18 11:10:38 +01:00
61e5bc823e Merge pull request 'Update overview dashboards' (#6) from overview-update into master
Reviewed-on: #6
2024-03-18 10:53:14 +01:00
42435a5c99 alpha sort 2024-03-12 16:25:21 +01:00
84f57d8981 remove default vars 2024-03-12 15:48:08 +01:00
b51ced33ed update overview table from table-old 2024-03-12 15:41:06 +01:00
400e3ff58d remove nfs exclusion 2024-03-12 15:40:52 +01:00
24 changed files with 33571 additions and 9891 deletions

9
LICENSE Normal file
View 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.

View File

@ -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
------------------

View File

@ -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"

View File

@ -26,6 +26,7 @@
| prometheus_server_scrape_interval | The scrape interval for Prometheus server | Integer | 5 |
| prometheus_server_scrape_timeout | The scrape timeout for Prometheus server | Integer | 5 |
| prometheus_server_version | The version of Prometheus server to install | String | "latest" |
| prometheus_watchtower_enable | Whether to enable watchtower on this container | Boolean | true |
## Prometheus Exporters
@ -61,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 | "" |
@ -79,3 +83,4 @@
| grafana_router_logging | Whether to enable router logging in Grafana | Boolean | false |
| grafana_disable_sanitize_html | Whether to disable HTML sanitization in Grafana | Boolean | true |
| grafana_traefik_entrypoint | The Traefik entrypoint for Grafana | String | 'websecure' |
| grafana_watchtower_enable | Whether to enable watchtower on this container | Boolean | true |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1971,7 +1971,7 @@
"type": "prometheus",
"uid": "yPhvsDP7k"
},
"definition": "label_values(node_filesystem_avail_bytes{instance=~\"$host\",fstype!=\"nfs\"}, mountpoint)",
"definition": "label_values(node_filesystem_avail_bytes{instance=~\"$host\"}, mountpoint)",
"hide": 0,
"includeAll": false,
"label": "Mountpoints",
@ -1979,7 +1979,7 @@
"name": "mountpoints",
"options": [],
"query": {
"query": "label_values(node_filesystem_avail_bytes{instance=~\"$host\",fstype!=\"nfs\"}, mountpoint)",
"query": "label_values(node_filesystem_avail_bytes{instance=~\"$host\"}, mountpoint)",
"refId": "StandardVariableQuery"
},
"refresh": 1,

View File

@ -1908,12 +1908,12 @@
"current": {
"selected": true,
"text": [
"cprprdcache1",
"cprprdcache2"
"sv1",
"sv2"
],
"value": [
"cprprdcache1",
"cprprdcache2"
"sv1",
"sv2"
]
},
"datasource": {
@ -1953,7 +1953,7 @@
"type": "prometheus",
"uid": "yPhvsDP7k"
},
"definition": "label_values(node_filesystem_avail_bytes{instance=~\"$host\",fstype!=\"nfs\"}, mountpoint)",
"definition": "label_values(node_filesystem_avail_bytes{instance=~\"$host\"}, mountpoint)",
"hide": 0,
"includeAll": false,
"label": "Mountpoints",
@ -1961,7 +1961,7 @@
"name": "mountpoints",
"options": [],
"query": {
"query": "label_values(node_filesystem_avail_bytes{instance=~\"$host\",fstype!=\"nfs\"}, mountpoint)",
"query": "label_values(node_filesystem_avail_bytes{instance=~\"$host\"}, mountpoint)",
"refId": "StandardVariableQuery"
},
"refresh": 1,

File diff suppressed because it is too large Load Diff

View File

@ -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']

View File

@ -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

View File

@ -0,0 +1,3 @@
---
- include_tasks: ../common.yml
tags: ['prometheus_elasticsearch_exporter']

View File

@ -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'

View File

@ -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"

View File

@ -12,7 +12,11 @@ services:
environment:
- CF_API_TOKEN={{ cloudflare_api_key }}
- CF_API_EMAIL={{ cloudflare_api_email }}
labels:
com.centurylinklabs.watchtower.enable: {{ cloudflare_exporter_watchtower_enable | default('true') }}
ports:
- 8082:8080
networks:
- {{ prometheus_docker_network }}
dns:
- "{{ prometheus_cloudflare_dns }}"

View File

@ -58,7 +58,10 @@ services:
- grafana
{% if grafana_traefik_enable is defined %}
- traefik
{% endif %}
labels:
com.centurylinklabs.watchtower.enable: {{ grafana_watchtower_enable | default('true') }}
{% if grafana_traefik_enable is defined %}
traefik.enable: true
traefik.docker.network: traefik
traefik.http.routers.grafana.rule: Host(`{{ grafana_domain|default(omit) }}`)
@ -66,11 +69,11 @@ services:
traefik.http.routers.grafana.tls.certresolver: letsencrypt
traefik.http.routers.grafana.entrypoints: "{{ grafana_traefik_entrypoint }}"
traefik.http.services.grafana.loadbalancer.server.port: 3000
{% else %}
{% if grafana_traefik_ipwhitelist is defined %}
traefik.http.middlewares.grafana-clientips.ipwhitelist.sourcerange: {{ grafana_traefik_ipwhitelist }}
traefik.http.routers.grafana.middlewares: "grafana-clientips@docker"
{% endif %}
{% else %}
ports:
- "{{ grafana_port | default(3000) }}:3000"
{% endif %}
@ -91,7 +94,10 @@ services:
- grafana
{% if prometheus_traefik_enable is defined %}
- traefik
{% endif %}
labels:
com.centurylinklabs.watchtower.enable: {{ prometheus_watchtower_enable | default('true') }}
{% if prometheus_traefik_enable is defined %}
traefik.enable: true
traefik.docker.network: traefik
traefik.http.routers.prometheus.rule: Host(`{{ prometheus_domain|default(omit) }}`)
@ -99,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 %}
@ -126,7 +132,10 @@ services:
- victoria-metrics-data:/victoria-metrics-data
{% if prometheus_traefik_enable is defined %}
- traefik
{% endif %}
labels:
com.centurylinklabs.watchtower.enable: {{ prometheus_watchtower_enable | default('true') }}
{% if prometheus_traefik_enable is defined %}
traefik.enable: true
traefik.docker.network: traefik
traefik.http.routers.prometheus.rule: Host(`{{ prometheus_domain|default(omit) }}`)
@ -151,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 %}

View File

@ -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

View File

@ -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 %}

View File

@ -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

View File

@ -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