private void SendAlert(ServiceState serviceState) { // send notification into slack channel to alert team var message = $@" [Diagnostics - {EnvironmentName}] Windows Service {serviceState.DisplayName} is down! Detected to be down at {serviceState.FirstDown:D} UTC and has failed to be restarted {serviceState.RestartCount} time{(serviceState.RestartCount == 1 ? "" : "s")}. "; SlackSender.Send(message); serviceState.NotificationRaised(); }