Skip to content

Commit 1818bda

Browse files
authored
Merge pull request #181 from stackhpc/wallaby_cadvisor
Wallaby: Monitoring backports
2 parents 7548cc8 + c2125a6 commit 1818bda

File tree

6 files changed

+33
-22
lines changed

6 files changed

+33
-22
lines changed

ansible/roles/grafana/tasks/config.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,34 +139,18 @@
139139
- inventory_hostname in groups[service.group]
140140
- service.enabled | bool
141141

142-
- name: Create custom Grafana dashboards folder
143-
become: true
144-
vars:
145-
service: "{{ grafana_services['grafana'] }}"
146-
file:
147-
dest: "{{ node_config_directory }}/grafana/dashboards/"
148-
state: "directory"
149-
mode: "0770"
150-
when:
151-
- grafana_custom_dashboards_folder.stat.exists
152-
- grafana_custom_dashboards_folder.stat.isdir
153-
- inventory_hostname in groups[service.group]
154-
- service.enabled | bool
155-
156142
- name: Copying over custom dashboards
157143
vars:
158144
service: "{{ grafana_services['grafana'] }}"
159145
copy:
160-
src: "{{ item }}"
161-
dest: "{{ node_config_directory }}/grafana/dashboards/"
146+
src: "{{ node_custom_config }}/grafana/dashboards"
147+
dest: "{{ node_config_directory }}/grafana/"
162148
mode: "0660"
163149
become: true
164150
when:
165151
- grafana_custom_dashboards_folder.stat.exists
166152
- grafana_custom_dashboards_folder.stat.isdir
167153
- inventory_hostname in groups[service.group]
168154
- service.enabled | bool
169-
with_fileglob:
170-
- "{{ node_custom_config }}/grafana/dashboards/*.json"
171155
notify:
172156
- Restart grafana container

ansible/roles/prometheus/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,5 @@ prometheus_openstack_exporter_disabled_dns: "{{ '--disable-service.dns' if not e
257257
prometheus_openstack_exporter_disabled_object: "{{ '--disable-service.object-store' if not enable_swift | bool else '' }}"
258258
prometheus_openstack_exporter_disabled_lb: "{{ '--disable-service.load-balancer --disable-metric=neutron-loadbalancers --disable-metric=neutron-loadbalancers_not_active' if not enable_octavia | bool else '' }}"
259259
prometheus_openstack_exporter_disabled_items: "{{ [prometheus_openstack_exporter_disabled_volume, prometheus_openstack_exporter_disabled_dns, prometheus_openstack_exporter_disabled_object, prometheus_openstack_exporter_disabled_lb|trim]|join(' ')|trim }}"
260+
261+
prometheus_cadvisor_cmdline_extras: "--docker_only --store_container_labels=false --disable_metrics=percpu,referenced_memory,cpu_topology,resctrl,udp,advtcp,sched,hugetlb,memory_numa,tcp,process"

ansible/roles/prometheus/templates/prometheus-cadvisor.json.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"command": "/opt/cadvisor --port={{ prometheus_cadvisor_port }} --log_dir=/var/log/kolla/prometheus",
2+
"command": "/opt/cadvisor --port={{ prometheus_cadvisor_port }} --log_dir=/var/log/kolla/prometheus {{ prometheus_cadvisor_cmdline_extras }}",
33
"config_files": [],
44
"permissions": [
55
{

doc/source/reference/logging-and-monitoring/grafana-guide.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ Custom dashboards provisioning
3535

3636
Kolla Ansible sets custom dashboards provisioning using `Dashboard provider <https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards>`_.
3737

38-
Dashboard's JSON files should be placed into
39-
``{{ node_custom_config }}/grafana/dashboards/`` folder.
40-
Dashboards will be imported to Grafana dashboards General Folder.
38+
Dashboard JSON files should be placed into the
39+
``{{ node_custom_config }}/grafana/dashboards/`` folder. The use of
40+
sub-folders is also supported when using a custom ``provisioning.yaml``
41+
file. Dashboards will be imported into the Grafana dashboards 'General'
42+
folder by default.
4143

4244
Grafana provisioner config can be altered by placing ``provisioning.yaml`` to
4345
``{{ node_custom_config }}/grafana/`` folder.

etc/kolla/globals.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@
716716
# List of extra parameters passed to prometheus. You can add as many to the list.
717717
#prometheus_cmdline_extras:
718718

719+
# List of extra parameters passed to cAdvisor. By default system cgroups
720+
# and container labels are not exposed to reduce time series cardinality.
721+
#prometheus_cadvisor_cmdline_extras: "--docker_only --store_container_labels=false --disable_metrics=percpu,referenced_memory,cpu_topology,resctrl,udp,advtcp,sched,hugetlb,memory_numa,tcp,process"
722+
719723
# Example of setting endpoints for prometheus ceph mgr exporter.
720724
# You should add all ceph mgr's in your external ceph deployment.
721725
#prometheus_ceph_mgr_exporter_endpoints:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
features:
3+
- |
4+
Adds support for passing extra runtime options to cAdvisor via
5+
``prometheus_cadvisor_cmdline_extras`` new variable. By default
6+
system cgroups' metrics are disabled, plus container labels
7+
don't get exposed to Prometheus. Expensive metrics that usually
8+
should not be exported are also enforced to be disabled - consult
9+
`<https://github.com/google/cadvisor/blob/master/docs/runtime_options.md#metrics>`_
10+
for a list. These defaults create savings in resources usage by both
11+
cAdvisor and Prometheus.
12+
upgrade:
13+
- |
14+
cAdvisor has now reduced number of Prometheus metrics and labels
15+
exported by default. This means that corresponding timeseries will
16+
no longer be created. If existing setup relies on these, eg. for
17+
visualisation or alerting, they could be explicitly enabled prior to
18+
upgrading with the ``prometheus_cadvisor_cmdline_extras`` new variable.
19+
Reference for the possible options: `<https://github.com/google/cadvisor/blob/master/docs/runtime_options.md#metrics>`_.

0 commit comments

Comments
 (0)