xoxys.prometheus/index.md

479 lines
9.3 KiB
Markdown
Raw Normal View History

---
title: prometheus
type: docs
---
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.prometheus) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.prometheus?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.prometheus) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.prometheus/src/branch/master/LICENSE)
Deploy [Prometheus](https://prometheus.io/) monitoring system.
- [Default Variables](#default-variables)
- [prometheus_alert_relabel_configs](#prometheus_alert_relabel_configs)
- [prometheus_alert_rules](#prometheus_alert_rules)
- [prometheus_alert_rules_extra](#prometheus_alert_rules_extra)
- [prometheus_alert_rules_files](#prometheus_alert_rules_files)
- [prometheus_alertmanager_config](#prometheus_alertmanager_config)
- [prometheus_base_dir](#prometheus_base_dir)
- [prometheus_config_dir](#prometheus_config_dir)
- [prometheus_config_flags_extra](#prometheus_config_flags_extra)
- [prometheus_data_dir](#prometheus_data_dir)
- [prometheus_external_labels](#prometheus_external_labels)
- [prometheus_extra_groups](#prometheus_extra_groups)
- [prometheus_file_sd_dir](#prometheus_file_sd_dir)
- [prometheus_global](#prometheus_global)
- [prometheus_group](#prometheus_group)
- [prometheus_log_level](#prometheus_log_level)
- [prometheus_packages](#prometheus_packages)
- [prometheus_read_only_dirs](#prometheus_read_only_dirs)
- [prometheus_remote_read](#prometheus_remote_read)
- [prometheus_remote_write](#prometheus_remote_write)
- [prometheus_rules_dir](#prometheus_rules_dir)
- [prometheus_scrape_configs](#prometheus_scrape_configs)
- [prometheus_static_targets_files](#prometheus_static_targets_files)
- [prometheus_storage_retention](#prometheus_storage_retention)
- [prometheus_storage_retention_size](#prometheus_storage_retention_size)
- [prometheus_targets](#prometheus_targets)
- [prometheus_user](#prometheus_user)
- [prometheus_user_comment](#prometheus_user_comment)
- [prometheus_user_home](#prometheus_user_home)
- [prometheus_version](#prometheus_version)
- [prometheus_web_basic_auth_users](#prometheus_web_basic_auth_users)
- [prometheus_web_bind_ip](#prometheus_web_bind_ip)
- [prometheus_web_bind_port](#prometheus_web_bind_port)
- [prometheus_web_external_url](#prometheus_web_external_url)
- [prometheus_web_http_server](#prometheus_web_http_server)
- [prometheus_web_tls_cert_path](#prometheus_web_tls_cert_path)
- [prometheus_web_tls_cert_source](#prometheus_web_tls_cert_source)
- [prometheus_web_tls_enabled](#prometheus_web_tls_enabled)
- [prometheus_web_tls_key_path](#prometheus_web_tls_key_path)
- [prometheus_web_tls_key_source](#prometheus_web_tls_key_source)
- [Discovered Tags](#discovered-tags)
- [Dependencies](#dependencies)
---
## Default Variables
### prometheus_alert_relabel_configs
#### Default value
```YAML
prometheus_alert_relabel_configs: []
```
#### Example usage
```YAML
prometheus_alert_relabel_configs:
- action: labeldrop
regex: replica
```
### prometheus_alert_rules
#### Default value
```YAML
prometheus_alert_rules:
- alert: Watchdog
expr: vector(1)
for: 10m
labels:
severity: warning
annotations:
description: >-
This is an alert meant to ensure that the entire alerting pipeline is functional.
This alert is always firing. There are integrations with various notification
mechanisms that send a notification when this alert is not firing anymore.
summary: Ensure entire alerting pipeline is functional
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: critical
annotations:
description: '{% raw %}{{ $labels.instance }} of job {{ $labels.job }} has been
down for more than 5 minutes.{% endraw %}'
summary: '{% raw %}Instance {{ $labels.instance }} down{% endraw %}'
```
### prometheus_alert_rules_extra
#### Default value
```YAML
prometheus_alert_rules_extra: []
```
### prometheus_alert_rules_files
#### Default value
```YAML
prometheus_alert_rules_files:
- prometheus/rules/*.rules
```
### prometheus_alertmanager_config
#### Default value
```YAML
prometheus_alertmanager_config: []
```
#### Example usage
```YAML
prometheus_alertmanager_config:
- scheme: https
path_prefix: alertmanager/
basic_auth:
username: user
password: pass
static_configs:
- targets: ["127.0.0.1:9093"]
proxy_url: "127.0.0.2"
```
### prometheus_base_dir
#### Default value
```YAML
prometheus_base_dir: /opt/prometheus
```
### prometheus_config_dir
#### Default value
```YAML
prometheus_config_dir: '{{ prometheus_base_dir }}/conf'
```
### prometheus_config_flags_extra
#### Default value
```YAML
prometheus_config_flags_extra: []
```
#### Example usage
```YAML
prometheus_config_flags_extra:
- name: alertmanager.timeout
value: 10s
```
### prometheus_data_dir
#### Default value
```YAML
prometheus_data_dir: '{{ prometheus_base_dir }}/data'
```
### prometheus_external_labels
#### Default value
```YAML
prometheus_external_labels:
environment: '{{ ansible_fqdn | default(ansible_host) | default(inventory_hostname)
}}'
```
### prometheus_extra_groups
#### Default value
```YAML
prometheus_extra_groups: []
```
### prometheus_file_sd_dir
#### Default value
```YAML
prometheus_file_sd_dir: '{{ prometheus_config_dir }}/file_sd'
```
### prometheus_global
#### Default value
```YAML
prometheus_global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
```
### prometheus_group
#### Default value
```YAML
prometheus_group: '{{ prometheus_user }}'
```
### prometheus_log_level
#### Default value
```YAML
prometheus_log_level: error
```
### prometheus_packages
#### Default value
```YAML
prometheus_packages:
- tar
```
### prometheus_read_only_dirs
#### Default value
```YAML
prometheus_read_only_dirs: []
```
### prometheus_remote_read
#### Default value
```YAML
prometheus_remote_read: []
```
#### Example usage
```YAML
prometheus_remote_read:
- url: https://demo.cloudalchemy.org:9201/read
basic_auth:
password: FOO
```
### prometheus_remote_write
#### Default value
```YAML
prometheus_remote_write: []
```
#### Example usage
```YAML
prometheus_remote_write:
- url: https://dev.kausal.co/prom/push
basic_auth:
password: FOO
```
### prometheus_rules_dir
#### Default value
```YAML
prometheus_rules_dir: '{{ prometheus_config_dir }}/rules'
```
### prometheus_scrape_configs
#### Default value
```YAML
prometheus_scrape_configs:
- job_name: prometheus
metrics_path: "{{ prometheus_web_external_url | urlsplit('path') if (prometheus_web_external_url\
\ | urlsplit('path')) | length > 1 else '' }}/metrics"
static_configs:
- targets:
- "{{ ansible_fqdn | default(ansible_host) | default('localhost') }}:61000"
```
### prometheus_static_targets_files
#### Default value
```YAML
prometheus_static_targets_files:
- prometheus/targets/*.yml
- prometheus/targets/*.json
```
### prometheus_storage_retention
#### Default value
```YAML
prometheus_storage_retention: 30d
```
### prometheus_storage_retention_size
__[EXPERIMENTAL]__ Maximum number of bytes that can be stored for blocks.
#### Default value
```YAML
prometheus_storage_retention_size: '0'
```
### prometheus_targets
#### Default value
```YAML
prometheus_targets: []
```
#### Example usage
```YAML
prometheus_targets:
- name: node
config:
- targets:
- localhost:9100
labels:
env: test
```
### prometheus_user
#### Default value
```YAML
prometheus_user: prometheus_adm
```
### prometheus_user_comment
#### Default value
```YAML
prometheus_user_comment: Prometheus
```
### prometheus_user_home
#### Default value
```YAML
prometheus_user_home: /home/{{ prometheus_user }}
```
### prometheus_version
#### Default value
```YAML
prometheus_version: 2.27.0
```
### prometheus_web_basic_auth_users
See official [documentation](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).
#### Default value
```YAML
prometheus_web_basic_auth_users: _unset_
```
### prometheus_web_bind_ip
#### Default value
```YAML
prometheus_web_bind_ip: 127.0.0.1
```
### prometheus_web_bind_port
#### Default value
```YAML
prometheus_web_bind_port: 61000
```
### prometheus_web_external_url
#### Default value
```YAML
prometheus_web_external_url: http://localhost:61000/
```
### prometheus_web_http_server
See official [documentation](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).
#### Default value
```YAML
prometheus_web_http_server: _unset_
```
### prometheus_web_tls_cert_path
#### Default value
```YAML
prometheus_web_tls_cert_path: '{{ prometheus_base_dir }}/tls/certs/mycert.pem'
```
### prometheus_web_tls_cert_source
#### Default value
```YAML
prometheus_web_tls_cert_source: mycert.pem
```
### prometheus_web_tls_enabled
#### Default value
```YAML
prometheus_web_tls_enabled: false
```
### prometheus_web_tls_key_path
#### Default value
```YAML
prometheus_web_tls_key_path: '{{ prometheus_base_dir }}/tls/private/mykey.pem'
```
### prometheus_web_tls_key_source
#### Default value
```YAML
prometheus_web_tls_key_source: mykey.pem
```
## Discovered Tags
tls_renewal
:  
## Dependencies
None.