New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prometheus server, exporter and altermanager roles #1310
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
…access to sockets Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
…ault configuratio files. Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Any news on this. I really would like to have Prom working as a role |
I was quickly trying to compare this PR with #160 which also tries to add Prometheus support to DebOps: In your code, I very like the facts-based integration of the exporters with the Prometheus server. I'm currently running a setup based on the code in #160 and use a few features that are missing here. Especially these are:
These features are imho essential (at least for my setup). What I'm still missing in both PR is the customization of startup arguments for the exporters and general customization of exporters. E.g. I'm running a systemd timer to provide data via node exporter The Ansible code looks decent. However, I personally don't like the |
So, missing features:
@ganto With this roles you can customize of startup arguments for the exporters. For example:
The recent DebOps code use |
Inventory examples. Prometheus server:
All nodes (by default it installs and configure node exporter):
Nginx and PHP-FPM:
MariaDB
Redis
MongoDB
RabbitMQ 3.8
RabbitMQ < 3.8
EDIT: [prometheus_exporter] Install repo exporter releases instead of compile go |
Neat, I missed that 👍
Hmn, do you have an example? Can't find a single |
|
…le go Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
…tication support Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
…rver, localhost dosen't work with TLS Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Prometheus rules example:
|
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Prometheus alertmanager inventory example:
|
Now the roles are completed. Next days i will write documentation. |
…ocumentation Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Refactoring: use golang role for install exporters. |
Mechanical edit done by (debops-optimize): ```Shell git ls-files -z "ansible/roles/prometheus_*" | xargs --null -I '{}' find './{}' -type f -print0 | \ xargs --null perl -i -p0e ' s~ ## Use Ansible 2.8 default shortcut: True or False ## Line: .*True \(?True\n? ## Line: if (ansible_local|d() and ansible_local.pki|d() and \s+if\s*\((?<var_ref1>ansible_local)\s*\|\s*d(?:efault)?\(\)\s+and\s+(?<var_ref2>\k<var_ref1>\.\w+)\s*\|\s*d(?:efault)?\(\)\s+and\n? ## var_ref1: ansible_local ## var_ref2: ansible_local.pki ## Line: ansible_local.pki.enabled|d()|bool) \s+(?<expression>\k<var_ref2>\.\w+\s*\|\s*d(?:efault)?\(\))\)\n? ## expression: ansible_local.pki.enabled|d()|bool ## Line: else False \s+else\s+False\)?(?:\s*\|\s*bool)? ~$+{expression}~xg; s~ ## Use Ansible 2.8 default shortcut: Thing if defined else fallback ## Line: .*ansible_local.core.domain \(?(?<var_ref3>(?<var_ref2>(?<var_ref1>ansible_local)\.\w+)\.\w+)\n? ## var_ref1: ansible_local ## var_ref2: ansible_local.core ## var_ref3: ansible_local.core.domain ## Line: if (ansible_local|d() and ansible_local.core|d() and \s+if\s+\(\k<var_ref1>\s*\|\s*d(?:efault)?\(\)\s+and\s+\k<var_ref2>\s*\|\s*d(?:efault)?\(\)\s+and\n? ## Line: ansible_local.core.domain|d()) \s+\k<var_ref3>(?:\s*\|\s*d(?:efault)?\(\))?\)\n? ## Line: else ansible_domain \s+else\s+\(?(?<else_exp>[^\n]+?)\)?\s+(?<end_marker>}}|%}) ## else_exp: ansible_domain ~$+{var_ref3}|d($+{else_exp}) $+{end_marker}~xg; s~ ## Use Ansible 2.8 default shortcut: More generic catch-all as last resort. ## Line: ansible_local|d() and ansible_local.pki|d() and (?<var_ref1>ansible_local)\s*\|\s*d(?:efault)?\(\)\s+and\s+(?<var_ref2>\k<var_ref1>\.\w+)\s*\|\s*d(?:efault)?\(\)\s+and\n? ## var_ref1: ansible_local ## var_ref2: ansible_local.pki ## Line: ansible_local.pki.enabled|d()|bool \s+(?<expression>\k<var_ref2>\.\w+\s*\|\s*d(?:efault)?\(\)) ## expression: ansible_local.pki.enabled|d() ~$+{expression}~xg; ' ```
Useful for testing.
LGTM, thanks. I made a few improvements in Neuromobile#1. Note that I only tested the prometheus_server role (currently all I need). |
A few improvements for the Prometheus roles.
…depend server Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Prometheus provides many different exporters other than the 'node' one (blackbox-exporter, etc...) |
The prometheus_exporter role allow install different exporters, and install node exporter by default. You can see a lot of examples in documentation. |
Any news on this? |
author: 'Pedro Luis López' | ||
description: 'Install and manage Prometheus alertmanager' | ||
company: 'DebOps' | ||
license: 'GPL-3.0-only' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But marked "GPL-3.0-or-later" in the header.
Signed-off-by: Pedro Luis López Sánchez <plopez@neuromobilemarketing.com>
Thanks a lot for the role.
|
@pedroluislopez |
@hungpr0 It uses golang role to install
|
Thanks for your info. I missed to import
Thanks for your info. I missed to import https://github.com/Lusitaniae/apache_exporter
|
In this case, you have to drop common args and set args by each exporter. Like this:
|
Missing:
Rules files.Prometheus alertmanager role.HTTP reverse proxy for SSL and auth. In prometheus recommend https://github.com/square/ghostunnel for production use. Maybe it's a better option than installing nginx.Write documentation.