8

I have a program that makes hundreds of daily CURL requests, SMTP request, and other requests. Less than 1 percent of the time, a CURL or SMTP request will fail. Best I can tell, the cause of the problem is external and can not be fixed to be 100% reliable. My program is always able to recover from it and no human interaction is ever needed from it. I have a system in place to send an email alert when something fails. The vast majority of what I receive are these harmless CURL and SMTP failures.

Should I not send an email alert for common failures that the program recovers from?

  • 1
    Since you seem to be the author and the sole user, yours is the only opinion that matters. – Caleb Nov 1 '16 at 13:06
  • @Caleb I am not the sole user on the front or back end of this application, but I am the sole developer. – Goose Nov 1 '16 at 13:10
  • 13
    Then you're definitely asking the wrong group of people. Why ask us, a bunch of people who will never use your program, when you could instead ask the actual users what they would prefer? – Caleb Nov 1 '16 at 13:21
  • 4
    @Caleb Because I believe this is a question that applies to many people and many projects and I want to understand the decision better. "only send an email, if the error-rate exceeds a preset limit which indicates that human intervention is needed." was very helpful to me. – Goose Nov 1 '16 at 13:26
  • Instead of emailing you could write on a log what happened and maybe just set a cron job to send one email a day if these errors occurred, so that the user knows that he might be interested in checking what happened... – Bakuriu Nov 1 '16 at 17:08
13

Depends on your application.

The E-Mails might be useful for a statistic but if not, I would avoid this spam.
What I do in similar cases: Send a summary once a day to be informed how well your program performs (and that it is still running).

I would only send an email, if the error-rate exceeds a preset limit which indicates that human intervention is needed.

  • 3
    Even a once-a-day report may be too many. Once-a-week might be fine for many people. (Bonus: give the recipient the option to choose how frequently to send them the report.) – curiousdannii Nov 1 '16 at 15:28
  • Bigger Bonus: Give the user the option to not be informed via email of errors from which the program automatically recovers with no loss that is perceptible to the user. Note: it is still a good idea for the program to track the rate at which these intermittent errors occur and inform the user if the rate is above a user set threshold. – Makyen Nov 1 '16 at 17:17
10

In this situation I would immediately stop sending the emails.

The error-emails should act as a signal that something is wrong and action needs to be taken. Because you get so much of them, they act as static noise and you will easily miss a really important error-email that came in for another reason.

However, if you get like 5 of these emails each hour and getting an email like every minute would be something abnormal, you need to build a mechanism that sends out something when the errors/hour passes a certain threshold. Because the single email may not mean much anymore, the amount of them in a certain period (minute/hour/day) may mean something bigger.

2

Email is not a good tool for keeping track of errors. Look into products such as New Relic or App Insights to record all your errors (and other information) so you can then report on it or send email alerts when certain conditions are met (e.g. when it changes from 1% failing to >10% failing).

With separate emails for each error you just end up ignoring the emails, and may not even notice the jump from 1% to 10%. Worse, your email provider may see the large volume of near-identical emails from one address and mark them all as spam.

0

In this type of situations try to make a algorithm to make a log of error events and send once in a day. As pieter said, also put a alert for exceeding number of errors. That's will be a systematic way of app management and trouble shooting.

Not the answer you're looking for? Browse other questions tagged or ask your own question.