Add option to enable proxysql's prometheus exporter
From version 2.1, ProxySQL has a built-in ProxySQL Prometheus exporter. This patch adds an option to easily enable this exporter [1]. [1] https://proxysql.com/documentation/prometheus-exporter Change-Id: I8776cdc0a6ec9e4e35a2424dd0984488514a711f
This commit is contained in:
parent
03122599ee
commit
de79f77ef0
@ -584,6 +584,7 @@ prometheus_cadvisor_port: "18080"
|
||||
prometheus_fluentd_integration_port: "24231"
|
||||
prometheus_libvirt_exporter_port: "9177"
|
||||
prometheus_etcd_integration_port: "{{ etcd_client_port }}"
|
||||
proxysql_prometheus_exporter_port: "6070"
|
||||
|
||||
# Prometheus alertmanager ports
|
||||
prometheus_alertmanager_internal_fqdn: "{{ kolla_internal_fqdn }}"
|
||||
@ -1237,6 +1238,7 @@ enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}"
|
||||
enable_prometheus_rabbitmq_exporter: "{{ enable_prometheus | bool and enable_rabbitmq | bool }}"
|
||||
enable_prometheus_libvirt_exporter: "{{ enable_prometheus | bool and enable_nova | bool and nova_compute_virt_type in ['kvm', 'qemu'] }}"
|
||||
enable_prometheus_etcd_integration: "{{ enable_prometheus | bool and enable_etcd | bool }}"
|
||||
enable_prometheus_proxysql_exporter: "{{ enable_prometheus | bool and enable_proxysql | bool }}"
|
||||
|
||||
prometheus_alertmanager_user: "admin"
|
||||
prometheus_ceph_exporter_interval: "{{ prometheus_scrape_interval }}"
|
||||
|
@ -162,6 +162,9 @@ proxysql_backend_max_replication_lag: "0"
|
||||
proxysql_admin_user: "kolla-admin"
|
||||
proxysql_stats_user: "kolla-stats"
|
||||
|
||||
# Proxysql prometheus exporter
|
||||
proxysql_prometheus_exporter_memory_metrics_interval: "60"
|
||||
|
||||
# Default timeout values
|
||||
haproxy_http_request_timeout: "10s"
|
||||
haproxy_http_keep_alive_timeout: "10s"
|
||||
|
@ -190,6 +190,33 @@
|
||||
- inventory_hostname in groups['loadbalancer']
|
||||
- api_interface_address != kolla_internal_vip_address
|
||||
|
||||
- name: Checking free port for ProxySQL prometheus exporter (api interface)
|
||||
wait_for:
|
||||
host: "{{ api_interface_address }}"
|
||||
port: "{{ proxysql_prometheus_exporter_port }}"
|
||||
connect_timeout: 1
|
||||
timeout: 1
|
||||
state: stopped
|
||||
when:
|
||||
- enable_proxysql | bool
|
||||
- enable_prometheus_proxysql_exporter | bool
|
||||
- container_facts['proxysql'] is not defined
|
||||
- inventory_hostname in groups['loadbalancer']
|
||||
|
||||
- name: Checking free port for ProxySQL prometheus exporter (vip interface)
|
||||
wait_for:
|
||||
host: "{{ kolla_internal_vip_address }}"
|
||||
port: "{{ proxysql_prometheus_exporter_port }}"
|
||||
connect_timeout: 1
|
||||
timeout: 1
|
||||
state: stopped
|
||||
when:
|
||||
- enable_proxysql | bool
|
||||
- enable_prometheus_proxysql_exporter | bool
|
||||
- proxysql_vip_prechecks
|
||||
- inventory_hostname in groups['loadbalancer']
|
||||
- api_interface_address != kolla_internal_vip_address
|
||||
|
||||
# FIXME(yoctozepto): this req seems arbitrary, they need not be, just routable is fine
|
||||
- name: Checking if kolla_internal_vip_address is in the same network as api_interface on all nodes
|
||||
become: true
|
||||
|
@ -12,6 +12,9 @@ admin_variables:
|
||||
admin_credentials: "{{ proxysql_admin_user }}:{{ proxysql_admin_password }}"
|
||||
mysql_ifaces: "{{ api_interface_address }}:{{ proxysql_admin_port }};{{ kolla_internal_vip_address }}:{{ proxysql_admin_port }};/var/lib/kolla/proxysql/admin.sock"
|
||||
stats_credentials: "{{ proxysql_stats_user }}:{{ proxysql_stats_password }}"
|
||||
restapi_enabled: "{{ enable_prometheus_proxysql_exporter | bool }}"
|
||||
restapi_port: "{{ proxysql_prometheus_exporter_port }}"
|
||||
prometheus_memory_metrics_interval: "{{ proxysql_prometheus_exporter_memory_metrics_interval }}"
|
||||
|
||||
mysql_variables:
|
||||
threads: {{ proxysql_workers }}
|
||||
|
@ -252,6 +252,19 @@ scrape_configs:
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if enable_prometheus_proxysql_exporter | bool %}
|
||||
- job_name: proxysql
|
||||
static_configs:
|
||||
{% for host in groups["loadbalancer"] %}
|
||||
- targets:
|
||||
- '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['proxysql_prometheus_exporter_port'] }}'
|
||||
{% if hostvars[host].prometheus_instance_label | default(false, true) %}
|
||||
labels:
|
||||
instance: "{{ hostvars[host].prometheus_instance_label }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Add ``proxysql_prometheus_exporter`` configuration parameter which
|
||||
can be used to configure Prometheus to scrape ProxySQL metrics endpoints.
|
||||
The default value of ``proxysql_prometheus_exporter`` is set to
|
||||
the combined values of ``enable_prometheus`` and ``enable_proxysql``.
|
@ -129,6 +129,7 @@ enable_masakari: "yes"
|
||||
{% if scenario == "cells" %}
|
||||
enable_cells: "yes"
|
||||
enable_proxysql: "yes"
|
||||
enable_prometheus_proxysql_exporter: "yes"
|
||||
{% endif %}
|
||||
|
||||
{% if scenario == "mariadb" %}
|
||||
|
@ -481,6 +481,19 @@ function test_internal_dns_integration {
|
||||
fi
|
||||
}
|
||||
|
||||
function test_proxysql_prometheus_exporter {
|
||||
if [[ $SCENARIO == "cells" ]]; then
|
||||
if curl -v http://127.0.0.1:6070/metrics 2>/dev/null | grep '^proxysql_'; then
|
||||
echo "[i] Proxysql prometheus exporter - PASS"
|
||||
mkdir -p /tmp/logs/prometheus-exporters/proxysql
|
||||
curl -v http://127.0.0.1:6070/metrics 2>/dev/null -o /tmp/logs/prometheus-exporters/proxysql/exporter.txt
|
||||
else
|
||||
echo "[e] Proxysql prometheus exporter - FAIL"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function test_openstack_logged {
|
||||
. /etc/kolla/admin-openrc.sh
|
||||
. ~/openstackclient-venv/bin/activate
|
||||
@ -488,6 +501,7 @@ function test_openstack_logged {
|
||||
test_neutron_modules
|
||||
test_instance_boot
|
||||
test_internal_dns_integration
|
||||
test_proxysql_prometheus_exporter
|
||||
|
||||
# Check for x86_64 architecture to run q35 tests
|
||||
if [[ $(uname -m) == "x86_64" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user