OVN DB Tables Rows Count Metrics

This patch introduces the following changes.
1. Collectd exec plugins have been created to capture OVN DB
tables rows count numbers from the controller host.
2. A Grafana panel has been created for OVN DB Tables Rows
Count metrics.

Change-Id: I274cc71d87ef79aefd381e690a13de6cb2c9b45e
This commit is contained in:
Sanjay Chari 2021-09-23 14:19:19 +05:30
parent aaa9db0ec6
commit 42a7cf1b6d
9 changed files with 199 additions and 0 deletions

View File

@ -311,6 +311,14 @@ ovsagent_controller_monitor: false
ovsagent_networker_monitor: false
ovs_flows_monitoring: false
######################################
# OVN DB Tables Rows Count Monitoring
######################################
# Monitors OVN DB Tables rows count on controller.
# You have to add wheel to sudo list with no password prompt on the controller host,
# before enabling this plugin.
ovn_monitoring: false
controller_monitored_ints:
- "tap"

View File

@ -256,6 +256,8 @@
with_items:
- src: ovs_flows.sh
dest: /usr/local/bin/ovs_flows.sh
- src: ovn_monitoring.sh
dest: /usr/local/bin/ovn_monitoring.sh
when: "('Controller' in group_names ) or ('Compute' in group_names)"
# Rabbitmq monitoring

View File

@ -133,6 +133,73 @@ PreCacheChain "PreCache"
</Plugin>
{% endif %}
{% if ovn_monitoring %}
<Plugin exec>
Instance "ovn_sbdb_Address_Set"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Address_Set"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Port_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Port_Group"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Logical_Flow"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Logical_Flow"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Multicast_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Multicast_Group"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Datapath_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Datapath_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Port_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Port_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_MAC_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "MAC_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Switch"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Switch"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Switch_Port"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Switch_Port"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Address_Set"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Address_Set"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Port_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Port_Group"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Load_Balancer"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Load_Balancer"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_ACL"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "ACL"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router_Port"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router_Port"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router_Static_Route"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router_Static_Route"
</Plugin>
{% endif %}
<Plugin ceph>
LongRunAvgLatency false
ConvertSpecialMetricTypes true

View File

@ -83,6 +83,13 @@
dest: "{{ browbeat_containers_path }}/collectd-openstack/config/collectd.conf"
when: "config_type == 'compute' and ovn_compute_collectd_plugin"
- name: Add stack user to wheel
shell: |
podman exec -it -u root collectd-controller usermod -G wheel stack
become: yes
become_user: root
when: "config_type == 'controller' and ovn_monitoring"
- name: Build and Run container
block:
- name: Build collectd-openstack container
@ -104,6 +111,10 @@
{% if ovs_flows_monitoring %}
-v /etc/openvswitch/:/etc/openvswitch/ -v /var/run/openvswitch/:/var/run/openvswitch/ \
{% endif %}
{% if ovn_monitoring %}
-v /var/lib/openvswitch/ovn/ovnnb_db.sock:/var/lib/openvswitch/ovn/ovnnb_db.sock \
-v /var/lib/openvswitch/ovn/ovnsb_db.sock:/var/lib/openvswitch/ovn/ovnsb_db.sock \
{% endif %}
{% endif %}
collectd-openstack
become: yes

View File

@ -454,6 +454,73 @@ PreCacheChain "PreCache"
</Plugin>
{% endif %}
{% if ovn_monitoring %}
<Plugin exec>
Instance "ovn_sbdb_Address_Set"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Address_Set"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Port_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Port_Group"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Logical_Flow"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Logical_Flow"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Multicast_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Multicast_Group"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Datapath_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Datapath_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_Port_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "Port_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_sbdb_MAC_Binding"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "sb" "MAC_Binding"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Switch"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Switch"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Switch_Port"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Switch_Port"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Address_Set"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Address_Set"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Port_Group"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Port_Group"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Load_Balancer"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Load_Balancer"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_ACL"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "ACL"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router_Port"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router_Port"
</Plugin>
<Plugin exec>
Instance "ovn_nbdb_Logical_Router_Static_Route"
Exec stack "/usr/local/bin/ovn_monitoring.sh" "nb" "Logical_Router_Static_Route"
</Plugin>
{% endif %}
{%if iostat_controller_collectd_plugin %}
<Plugin python>
ModulePath "/usr/local/bin/"

View File

@ -164,6 +164,8 @@ dashboard:
{% include 'partials/osp_resources.yaml' %}
{% include 'partials/osp_response_times.yaml' %}
{% include 'partials/ovn_db_tables.yaml' %}
{% endif %}
{% include 'partials/ovn_metrics.yaml' %}

View File

@ -0,0 +1,33 @@
- title: OVN DB Tables Rows Count
collapse: true
height: 200px
showTitle: true
panels:
- title: $Cloud - $Node - OVN DB Tables Rows Count
type: graph
legend:
alignAsTable: true
avg: false
current: true
max: true
min: true
rightSide: true
show: true
total: false
values: true
nullPointMode: 'null'
targets:
- target: alias($Cloud.$Node.ovn-ACL.gauge-ovn_ACL, 'ovn_ACL')
- target: alias($Cloud.$Node.ovn-Address_Set.gauge-ovn_Address_Set, 'ovn_Address_Set')
- target: alias($Cloud.$Node.ovn-Datapath_Binding.gauge-ovn_Datapath_Binding, 'ovn_Datapath_Binding')
- target: alias($Cloud.$Node.ovn-Load_Balancer.gauge-ovn_Load_Balancer, 'ovn_Load_Balancer')
- target: alias($Cloud.$Node.ovn-Logical_Flow.gauge-ovn_Logical_Flow, 'ovn_Logical_Flow')
- target: alias($Cloud.$Node.ovn-Logical_Router.gauge-ovn_Logical_Router, 'ovn_Logical_Router')
- target: alias($Cloud.$Node.ovn-Logical_Router_Port.gauge-ovn_Logical_Router_Port, 'ovn_Logical_Router_Port')
- target: alias($Cloud.$Node.ovn-Logical_Router_Static_Route.gauge-ovn_Logical_Router_Static_Route, 'ovn_Logical_Router_Static_Route')
- target: alias($Cloud.$Node.ovn-Logical_Switch.gauge-ovn_Logical_Switch, 'ovn_Logical_Switch')
- target: alias($Cloud.$Node.ovn-Logical_Switch_Port.gauge-ovn_Logical_Switch_Port, 'ovn_Logical_Switch_Port')
- target: alias($Cloud.$Node.ovn-MAC_Binding.gauge-ovn_MAC_Binding, 'ovn_MAC_Binding')
- target: alias($Cloud.$Node.ovn-Multicast_Group.gauge-ovn_Multicast_Group, 'ovn_Multicast_Group')
- target: alias($Cloud.$Node.ovn-Port_Binding.gauge-ovn_Port_Binding, 'ovn_Port_Binding')
- target: alias($Cloud.$Node.ovn-Port_Group.gauge-ovn_Port_Group, 'ovn_Port_Group')

View File

@ -27,6 +27,7 @@ ADD files/collectd_gnocchi_status.py /usr/local/bin/collectd_gnocchi_status.py
ADD files/collectd_rabbitmq_monitoring.py /usr/local/bin/collectd_rabbitmq_monitoring.py
ADD files/collectd_swift_stat.py /usr/local/bin/collectd_swift_stat.py
ADD files/ovs_flows.sh /usr/local/bin/ovs_flows.sh
ADD files/ovn_monitoring.sh /usr/local/bin/ovn_monitoring.sh
ADD config/collectd.conf /etc/collectd.conf

View File

@ -0,0 +1,8 @@
#!/bin/sh
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}"
INTERVAL="${COLLECTD_INTERVAL:-15}"
while sleep "$INTERVAL"; do
VALUE=$(sudo ovsdb-client dump unix:/var/lib/openvswitch/ovn/ovn$1_db.sock $2 | wc -l)
echo "PUTVAL \"$HOSTNAME/ovn-$2/gauge-ovn_$2\" interval=$INTERVAL N:$VALUE"
done