Esempio n. 1
0
        private async Task <List <string> > GenerateAlarms(PopulatedServiceConfiguration <TAlarmConfig, T> serviceConfig, RunMode mode)
        {
            var failures = new List <string>();

            foreach (var alertingGroup in serviceConfig.AlertingGroups)
            {
                try
                {
                    var alarmsForGroup = await _resourceAlarmGenerator.GenerateAlarmsFor(
                        alertingGroup.Service,
                        alertingGroup.GroupParameters);

                    _creator.AddAlarms(alertingGroup.GroupParameters, alarmsForGroup);
                }
                catch (Exception ex)
                {
                    _logger.Error(ex, $"Failed to generate alarms for group {alertingGroup.GroupParameters.Name}");
                    failures.Add(alertingGroup.GroupParameters.Name);
                }
            }

            return(failures);
        }
Esempio n. 2
0
 private Task ReportOrphans(PopulatedServiceConfiguration <TAlarmConfig, T> serviceConfig)
 {
     return(_orphansReporter.FindAndReport(serviceConfig.ServiceName, serviceConfig.AlertingGroups));
 }