'can allow debugging daemons that encounter problems '
'at runtime.',
},
+ {
+ 'name': 'prometheus_alerts_path',
+ 'type': 'str',
+ 'default': '/etc/prometheus/ceph/ceph_default_alerts.yml',
+ 'desc': 'location of alerts to include in prometheus deployments',
+ },
]
def __init__(self, *args, **kwargs):
self.warn_on_stray_daemons = True
self.warn_on_failed_host_check = True
self.allow_ptrace = False
+ self.prometheus_alerts_path = ''
self._cons = {} # type: Dict[str, Tuple[remoto.backends.BaseConnection,remoto.backends.LegacyModuleExecute]]
""".format(", ".join(alertmgr_targets))
# generate the prometheus configuration
- return {
+ r = {
'files': {
'prometheus.yml': """# generated by cephadm
global:
alertmgr_configs=str(alertmgr_configs)
),
},
- }, sorted(deps)
+ }
+
+ # include alerts, if present in the container
+ if os.path.exists(self.prometheus_alerts_path):
+ with open(self.prometheus_alerts_path, "r") as f:
+ alerts = f.read()
+ r['files']['/etc/prometheus/alerting/ceph_alerts.yml'] = alerts
+
+ return r, sorted(deps)
def _generate_grafana_config(self):
# type: () -> Tuple[Dict[str, Any], List[str]]