From 27592b75618706194e668c40056d9bfc58c5a3c6 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Mon, 7 Feb 2022 16:23:29 +0530 Subject: [PATCH] cephadm: change shared_folder directory for prometheus and grafana After https://github.com/ceph/ceph/pull/44059 the monitoring/prometheus and monitoring/grafana/dashboards directories are changed to monitoring/ceph-mixins. That broke the shared_folders in the cephadm bootstrap script. Changed all the instances of monitoring/prometheus and monitoring/grafana/dashboards to monitoring/ceph-mixins Also, renaming all the instances of prometheus_alerts.yaml to prometheus_alerts.yml. Fixes: https://tracker.ceph.com/issues/54176 Signed-off-by: Nizamudeen A --- ceph.spec.in | 2 +- debian/rules | 2 +- doc/mgr/dashboard.rst | 6 +++--- monitoring/ceph-mixin/README.md | 4 ++-- monitoring/ceph-mixin/alerts.libsonnet | 2 +- .../{prometheus_alerts.yaml => prometheus_alerts.yml} | 0 monitoring/ceph-mixin/tests_alerts/settings.py | 2 +- monitoring/ceph-mixin/tests_alerts/test_alerts.yml | 2 +- monitoring/ceph-mixin/tox.ini | 2 +- src/cephadm/cephadm | 4 ++-- src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) rename monitoring/ceph-mixin/{prometheus_alerts.yaml => prometheus_alerts.yml} (100%) diff --git a/ceph.spec.in b/ceph.spec.in index e18c881783b..bb3c0553af5 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1432,7 +1432,7 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd-mirror # prometheus alerts -install -m 644 -D monitoring/ceph-mixin/prometheus_alerts.yaml %{buildroot}/etc/prometheus/ceph/ceph_default_alerts.yml +install -m 644 -D monitoring/ceph-mixin/prometheus_alerts.yml %{buildroot}/etc/prometheus/ceph/ceph_default_alerts.yml %if 0%{?suse_version} # create __pycache__ directories and their contents diff --git a/debian/rules b/debian/rules index 0c3939745be..fe54877e6db 100755 --- a/debian/rules +++ b/debian/rules @@ -73,7 +73,7 @@ override_dh_auto_install: install -m 755 src/cephadm/cephadm $(DESTDIR)/usr/sbin/cephadm - install -m 644 -D monitoring/ceph-mixin/prometheus_alerts.yaml $(DESTDIR)/etc/prometheus/ceph/ceph_default_alerts.yml + install -m 644 -D monitoring/ceph-mixin/prometheus_alerts.yml $(DESTDIR)/etc/prometheus/ceph/ceph_default_alerts.yml # doc/changelog is a directory, which confuses dh_installchangelogs override_dh_installchangelogs: diff --git a/doc/mgr/dashboard.rst b/doc/mgr/dashboard.rst index 44faefaea12..60fca266e3e 100644 --- a/doc/mgr/dashboard.rst +++ b/doc/mgr/dashboard.rst @@ -534,14 +534,14 @@ on appropriate hosts, proceed with the following steps. Dashboards can be added to Grafana by importing dashboard JSON files. Use the following command to download the JSON files:: - wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/grafana/dashboards/.json + wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/ceph-mixin/dashboards_out/.json You can find various dashboard JSON files `here `_ . + master/monitoring/ceph-mixin/dashboards_out>`_ . For Example, for ceph-cluster overview you can use:: - wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/grafana/dashboards/ceph-cluster.json + wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/ceph-mixin/dashboards_out/ceph-cluster.json You may also author your own dashboards. diff --git a/monitoring/ceph-mixin/README.md b/monitoring/ceph-mixin/README.md index 7c0cd064c67..fd0fe95ed90 100644 --- a/monitoring/ceph-mixin/README.md +++ b/monitoring/ceph-mixin/README.md @@ -2,7 +2,7 @@ A set of Grafana dashboards and Prometheus alerts for Ceph. All the Grafana dashboards are already generated in the `dashboards_out` -directory and alerts in the `prometheus_alerts.yaml` file. +directory and alerts in the `prometheus_alerts.yml` file. You can use the Grafana dashboards and alerts with Jsonnet like any other prometheus mixin. You can find more ressources about mixins in general on @@ -26,7 +26,7 @@ plugin](http://docs.ceph.com/en/latest/mgr/prometheus/) and the ### Prometheus alerts -In `prometheus_alerts.yaml` you'll find a set of Prometheus +In `prometheus_alerts.yml` you'll find a set of Prometheus alert rules that should provide a decent set of default alerts for a Ceph cluster. Just put this file in a place according to your Prometheus configuration (wherever the `rules` configuration stanza points). diff --git a/monitoring/ceph-mixin/alerts.libsonnet b/monitoring/ceph-mixin/alerts.libsonnet index 8671637de5d..9c759938a05 100644 --- a/monitoring/ceph-mixin/alerts.libsonnet +++ b/monitoring/ceph-mixin/alerts.libsonnet @@ -1,3 +1,3 @@ { - prometheusAlerts+:: std.parseYaml(importstr 'prometheus_alerts.yaml'), + prometheusAlerts+:: std.parseYaml(importstr 'prometheus_alerts.yml'), } diff --git a/monitoring/ceph-mixin/prometheus_alerts.yaml b/monitoring/ceph-mixin/prometheus_alerts.yml similarity index 100% rename from monitoring/ceph-mixin/prometheus_alerts.yaml rename to monitoring/ceph-mixin/prometheus_alerts.yml diff --git a/monitoring/ceph-mixin/tests_alerts/settings.py b/monitoring/ceph-mixin/tests_alerts/settings.py index 9dc639fd30c..d99dfdca6fb 100644 --- a/monitoring/ceph-mixin/tests_alerts/settings.py +++ b/monitoring/ceph-mixin/tests_alerts/settings.py @@ -1,6 +1,6 @@ import os -ALERTS_FILE = '../prometheus_alerts.yaml' +ALERTS_FILE = '../prometheus_alerts.yml' UNIT_TESTS_FILE = 'test_alerts.yml' MIB_FILE = '../../snmp/CEPH-MIB.txt' diff --git a/monitoring/ceph-mixin/tests_alerts/test_alerts.yml b/monitoring/ceph-mixin/tests_alerts/test_alerts.yml index 14dfb942b62..d7fe0132d2d 100644 --- a/monitoring/ceph-mixin/tests_alerts/test_alerts.yml +++ b/monitoring/ceph-mixin/tests_alerts/test_alerts.yml @@ -1,5 +1,5 @@ rule_files: - - ../prometheus_alerts.yaml + - ../prometheus_alerts.yml evaluation_interval: 5m tests: # health error diff --git a/monitoring/ceph-mixin/tox.ini b/monitoring/ceph-mixin/tox.ini index e15e17084f7..e6cae299d68 100644 --- a/monitoring/ceph-mixin/tox.ini +++ b/monitoring/ceph-mixin/tox.ini @@ -64,6 +64,6 @@ depends = grafonnet-check whitelist_externals = promtool commands = - lint: promtool check rules prometheus_alerts.yaml + lint: promtool check rules prometheus_alerts.yml test: pytest -rA tests_alerts/test_syntax.py tests_alerts/test_unittests.py python3 ./tests_alerts/validate_rules.py diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 10b608fe139..8eaae926196 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2592,8 +2592,8 @@ def get_container_mounts(ctx, fsid, daemon_type, daemon_id, mounts[ceph_folder + '/src/cephadm/cephadm'] = '/usr/sbin/cephadm' mounts[ceph_folder + '/src/pybind/mgr'] = '/usr/share/ceph/mgr' mounts[ceph_folder + '/src/python-common/ceph'] = '/usr/lib/python3.6/site-packages/ceph' - mounts[ceph_folder + '/monitoring/grafana/dashboards'] = '/etc/grafana/dashboards/ceph-dashboard' - mounts[ceph_folder + '/monitoring/prometheus/alerts'] = '/etc/prometheus/ceph' + mounts[ceph_folder + '/monitoring/ceph-mixin/dashboards_out'] = '/etc/grafana/dashboards/ceph-dashboard' + mounts[ceph_folder + '/monitoring/ceph-mixin/prometheus_alerts.yml'] = '/etc/prometheus/ceph/ceph_default_alerts.yml' else: logger.error('{}{}{}'.format(termcolor.red, 'Ceph shared source folder does not exist.', diff --git a/src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py b/src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py index 03b31a45e17..d37337b404e 100644 --- a/src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py +++ b/src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py @@ -10,7 +10,7 @@ Usage: e.g. cd /ceph/src/pybind/mgr/dashboard - python ci/