Skip to content

Commit

Permalink
cephadm: change shared_folder directory for prometheus and grafana
Browse files Browse the repository at this point in the history
After ceph#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 <nia@redhat.com>
(cherry picked from commit 27592b7)
  • Loading branch information
nizamial09 authored and MrFreezeex committed Mar 23, 2022
1 parent be374d6 commit b2f0d5d
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ceph.spec.in
Expand Up @@ -1418,7 +1418,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
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -61,7 +61,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:
Expand Down
6 changes: 3 additions & 3 deletions doc/mgr/dashboard.rst
Expand Up @@ -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/<Dashboard-name>.json
wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/ceph-mixin/dashboards_out/<Dashboard-name>.json

You can find various dashboard JSON files `here <https://github.com/ceph/ceph/tree/
master/monitoring/grafana/dashboards>`_ .
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.

Expand Down
4 changes: 2 additions & 2 deletions monitoring/ceph-mixin/README.md
Expand Up @@ -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
Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion monitoring/ceph-mixin/alerts.libsonnet
@@ -1,3 +1,3 @@
{
prometheusAlerts+:: std.parseYaml(importstr 'prometheus_alerts.yaml'),
prometheusAlerts+:: std.parseYaml(importstr 'prometheus_alerts.yml'),
}
File renamed without changes.
2 changes: 1 addition & 1 deletion 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'

Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion monitoring/ceph-mixin/tox.ini
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/cephadm/cephadm
Expand Up @@ -2577,8 +2577,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.',
Expand Down
2 changes: 1 addition & 1 deletion src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py
Expand Up @@ -10,7 +10,7 @@
e.g.
cd /ceph/src/pybind/mgr/dashboard
python ci/<script> frontend/src/app /ceph/monitoring/grafana/dashboards
python ci/<script> frontend/src/app /ceph/monitoring/ceph-mixin/dashboards_out
"""
import argparse
import codecs
Expand Down

0 comments on commit b2f0d5d

Please sign in to comment.