Collect `filestat_exporter` metrics.

This commit is contained in:
Kazuhiro MUSASHI 2020-09-27 14:03:13 +09:00
parent 4e47ebfa6f
commit 7dea0e4f4e
3 changed files with 22 additions and 1 deletions

View File

@ -17,7 +17,7 @@ remote_file '/etc/prometheus.d/alertmanager.yml' do
end
# Deploy alert setting file:
%w(node_exporter prometheus).each do |conf|
%w(node_exporter prometheus filestat).each do |conf|
remote_file "/etc/prometheus.d/alerts/#{conf}.yml" do
owner 'root'
group 'root'

View File

@ -0,0 +1,12 @@
groups:
- name: filestat
rules:
- alert: RebootRequired
expr: file_glob_match_number{pattern="/var/run/reboot-required"} > 0
for: 24h
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} requires rebooting."
description: "{{ $labels.instance }} requires rebooting."

View File

@ -14,6 +14,7 @@ rule_files:
# - "first.rules"
# - "second.rules"
- '/etc/prometheus.d/alerts/node_exporter.yml'
- '/etc/prometheus.d/alerts/filestat.yml'
- '/etc/prometheus.d/alerts/prometheus.yml'
# A scrape configuration containing exactly one endpoint to scrape:
@ -51,6 +52,14 @@ scrape_configs:
services:
- 'node_exporter'
- job_name: 'filestat'
metrics_path: /filestat_exporter/metrics
consul_sd_configs:
- server: 'localhost:8500'
services:
- 'filestat_exporter'
- job_name: 'grafana'
consul_sd_configs:
- server: 'localhost:8500'