1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-06-09 00:16:11 +02:00

Add prometheus-memcached-exporter

Extend the memcached service for the AUR to allow the memcached group to
read the socket to obtain statistics.
This commit is contained in:
Jelle van der Waa 2020-09-15 22:38:01 +02:00
parent b25f11123f
commit 68b9fbb8bb
No known key found for this signature in database
GPG Key ID: C06086337C50773E
7 changed files with 25 additions and 3 deletions

View File

@ -13,3 +13,4 @@ maintenance_remote_machine: "{{ hostvars[inventory_hostname]['ansible_env'].SSH_
# prometheus-node-exporter port
prometheus_exporter_port: '9100'
prometheus_memcached_exporter_port: '9150'

View File

@ -1,5 +1,7 @@
---
filesystem: btrfs
memcached_socket: "/var/run/aurweb.sock"
zabbix_agent_templates:
- Template OS Linux
- Template App Borg Backup

View File

@ -1,5 +1,7 @@
---
filesystem: btrfs
memcached_socket: "/var/run/aurweb.sock"
zabbix_agent_templates:
- Template OS Linux
- Template App Borg Backup

2
hosts
View File

@ -31,7 +31,6 @@ bbs.archlinux.org
homedir.archlinux.org
bugs.archlinux.org
aur.archlinux.org
aur-dev.archlinux.org
gitlab.archlinux.org
accounts.archlinux.org
gemini.archlinux.org
@ -84,7 +83,6 @@ repro3.pkgbuild.com
reproducible.archlinux.org
[memcached]
apollo.archlinux.org
aur.archlinux.org
aur-dev.archlinux.org

View File

@ -5,7 +5,7 @@ After=network.target
[Service]
User={{ aurweb_user }}
Group=memcached
ExecStart=/usr/bin/memcached -s {{ aurweb_memcached_socket }} -m {{ aurweb_memcached_memory }} -o modern
ExecStart=/usr/bin/memcached -s {{ aurweb_memcached_socket }} -m {{ aurweb_memcached_memory }} -o modern -a 770
Restart=always
NoNewPrivileges=yes
PrivateTmp=yes

View File

@ -61,6 +61,16 @@ scrape_configs:
labels:
instance: "aur.archlinux.org"
- job_name: 'memcached_exporter'
static_configs:
{% for host in groups['memcached'] %}
- targets: ['{{ host }}:{{ prometheus_memcached_exporter_port }}']
labels:
instance: "{{ host }}"
{% endfor %}
- job_name: 'blackbox'
metrics_path: /probe
scrape_interval: 15s

View File

@ -44,6 +44,10 @@
systemd: name=prometheus-mysqld-exporter enabled=yes daemon_reload=yes state=started
when: "'mysql_servers' in group_names"
- name: copy prometheus memcached exporter configuration
template: src=prometheus-memcached-exporter.j2 dest=/etc/conf.d/prometheus-memcached-exporter owner=root group=root mode=600
when: "'memcached' in group_names"
- name: install node exporter configuration
template: src=prometheus-node-exporter.env.j2 dest=/etc/conf.d/prometheus-node-exporter owner=root group=root mode=600
@ -119,3 +123,8 @@
firewalld: state=enabled permanent=true immediate=yes
rich_rule="rule family=ipv4 source address={{ hostvars['monitoring.archlinux.org']['ipv4_address'] }} port protocol=tcp port={{ prometheus_mysqld_exporter_port }} accept"
when: "'mysql_servers' in group_names"
- name: open prometheus memcached exporter ipv4 port for monitoring.archlinux.org
firewalld: state=enabled permanent=true immediate=yes
rich_rule="rule family=ipv4 source address={{ hostvars['monitoring.archlinux.org']['ipv4_address'] }} port protocol=tcp port={{ prometheus_memcached_exporter_port }} accept"
when: "'memcached' in group_names"