fix linter errors
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
hosts: all
|
||||
|
||||
roles:
|
||||
- role: genlab.prometheus
|
||||
config_source_dir: prometheus
|
||||
- role: genlab.common.prometheus
|
||||
prometheus_config_source_dir: prometheus
|
||||
alertrules_source_dir: prometheus/rules
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
rule_files:
|
||||
@@ -11,4 +11,4 @@ rule_files:
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
groups:
|
||||
- name: example
|
||||
labels:
|
||||
team: myteam
|
||||
rules:
|
||||
- alert: HighRequestLatency
|
||||
expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
|
||||
for: 10m
|
||||
keep_firing_for: 5m
|
||||
- name: example
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: High request latency
|
||||
team: myteam
|
||||
rules:
|
||||
- alert: HighRequestLatency
|
||||
expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
|
||||
for: 10m
|
||||
keep_firing_for: 5m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: High request latency
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
- name: "Include default vars"
|
||||
ansible.builtin.include_vars:
|
||||
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults/"
|
||||
extensions: [ 'yml' ]
|
||||
extensions: ['yml']
|
||||
|
||||
- name: "Check if Prometheus is installed"
|
||||
changed_when: false
|
||||
ansible.builtin.command: "prometheus --version"
|
||||
register: prom_installed_version
|
||||
register: prometheus_installed_version
|
||||
|
||||
- name: "Check Prometheus version"
|
||||
ansible.builtin.assert:
|
||||
that: "prom_installed_version.stdout is regex('{{ prometheus_version }}')"
|
||||
that: "prometheus_installed_version.stdout is regex('{{ prometheus_version }}')"
|
||||
success_msg: "Prometheus version {{ prometheus_version }} is installed and working"
|
||||
fail_msg: "Prometheus version {{ prometheus_version }} is not installed or not working correctly"
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
status_code: 200
|
||||
method: GET
|
||||
body_format: json
|
||||
register: prom_health
|
||||
register: prometheus_health
|
||||
|
||||
- name: "Debug Prometheus health status"
|
||||
ansible.builtin.assert:
|
||||
that: "prom_health.content | trim == 'Prometheus Server is Healthy.'"
|
||||
that: "prometheus_health.content | trim == 'Prometheus Server is Healthy.'"
|
||||
success_msg: "Prometheus is healthy"
|
||||
fail_msg: "Prometheus is not healthy"
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
status_code: 200
|
||||
method: GET
|
||||
body_format: json
|
||||
register: prom_ready
|
||||
register: prometheus_ready
|
||||
|
||||
- name: "Debug Prometheus readiness status"
|
||||
ansible.builtin.assert:
|
||||
that: "prom_ready.content | trim == 'Prometheus Server is Ready.'"
|
||||
that: "prometheus_ready.content | trim == 'Prometheus Server is Ready.'"
|
||||
success_msg: "Prometheus is ready"
|
||||
fail_msg: "Prometheus is not ready"
|
||||
|
||||
Reference in New Issue
Block a user