https://github.com/smartlogic/ansible-role-prometheus
https://github.com/smartlogic/ansible-role-prometheus
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smartlogic/ansible-role-prometheus
- Owner: smartlogic
- Created: 2018-01-05T19:40:43.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T22:24:25.000Z (over 1 year ago)
- Last Synced: 2026-01-19T16:46:27.650Z (5 months ago)
- Language: Jinja
- Size: 2.82 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prometheus
Set up common prometheus configurations
## Install to requirements.yml
```
- src: git+git@github.com:smartlogic/ansible-role-prometheus
name: prometheus
version: 0.6.1
```
## Requirements
### For prometheus-postgresql-adapter
* PostgreSQL 10
* A PostgreSQL user that has full permissions on the database prometheus will be using
* This assumes a local connection
If enabled, this will set up two PostgreSQL extensions: [pg_prometheus][pg_prometheus] and [timescaledb][timescaledb]. [prometheus-postgresql-adapter][prometheus-postgresql-adapter] will also be set up as a service.
## Role Variables
- `prometheus_version` - Which version of prometheus to download
- `prometheus_checksum` - The checksum for the version of prometheus
- `prometheus_extra_flags` - Variable to place on the command line, after the config file load
- `alertmanager_version` - Which version of alertmanager to download
- `alertmanager_checksum` - The checksum for the version of alertmanager
- `alertmanager_extra_flags` - Variable to place on the command line, after the config file load
- `grafana_ini_file` - The file to use for `grafana.ini`
- Default: `grafana.ini`
- `grafana_state` - The state of the apt package for grafana (present|latest)
- Default: `present`
- `prometheus_config_file` - The file to use for `prometheus.yml`
- Default: `prometheus.yml.j2`
- `prometheus_alert_file` - The file to use for `alertmanager.yml`
- Default: `alertmanager.yml`
- `alertmanager_enabled` - boolean - True for enabling the alertmanager, via systemctl
- Default: `true`
- `prometheus` - Configure scrape files, alert rules, and alert templates
- `prometheus_postgresql_archive` - boolean - If true the postgresql adapter will be installed
- Default: `false`
- `prometheus_postgresql_adapter_host` - The host that the adapter will be running on, how Prometheus will find it
- Default: `localhost`
- `prometheus_postgresql_database` - Database that the adapter will use
- Default: `metrics`
- `prometheus_postgresql_username` - User that the adapter will connect as
- Default: `prometheus`
- `prometheus_postgresql_password` - Password that the adapter will connect with
- Default: `prometheus`
## Dependencies
None
## Example Configuration
```yaml
grafana_ini_file: "{{ playbook_dir }}/files/grafana.ini"
prometheus_config_file: "{{ playbook_dir }}/files/prometheus.yml"
prometheus_alert_file: "{{ playbook_dir }}/files/alertmanager.yml"
prometheus_postgresql_archive: true
prometheus_postgresql_database: metrics
prometheus_postgresql_username: prometheus
prometheus:
jobs:
- "{{ playbook_dir }}/file_config/project.json"
alert:
rules:
- "{{ playbook_dir }}/alert_rules/rules.yml"
templates:
- "{{ playbook_dir }}/alert_templates/templte.tmpl"
```
## Example Playbook
Full setup:
```yaml
- hosts: servers
roles:
- { role: prometheus, action: "full" }
```
## License
MIT
## Author Information
SmartLogic. https://smartlogic.io
[prometheus-postgresql-adapter]: https://github.com/timescale/prometheus-postgresql-adapter
[pg_prometheus]: https://github.com/timescale/pg_prometheus
[timescaledb]: https://github.com/timescale/timescaledb