Sending email for backend service failures

How to send a email if backend target is down/any failures(4xx/5xx) from proxy?

Could any one provide some steps/working sample that works.

Thankyou.

-Vinay

2 3 1,035
3 REPLIES 3

I would review the documentation on fault handling: http://apigee.com/docs/api-services/content/fault-handling

You could create a fault rule with the appropriate conditions and include steps to send the email using java or python extension policy, for example.

But, I don't think I would do this. This would generate an email for every API request that results in a fault. That could be a LOT of emails. What I think I would do instead is to log the errors -- either with a service callout or the message logging policy -- into a system where I could set rules on when to send emails. Then I wouldn't need to worry about the flood.

I have an idea! How about if you use a tool that is designed to help you solve this problem?

Apigee's API Health product (still in beta) allows you to configure probes that send out healthcheck API calls regularly and periodically. You can set up thresholds for the number of failures that should result in an alert, and you can set up an address which will get an email if the threshold is exceeded.

Try it out, it's really handy!

remeeshnair
Participant IV

You can write a simple shell script with mail command and Management API call to query analytics data and send mail on matching conditions. Configure it on crontab and you can decide the frequency to avoid flooding as mentioned by @Carlos above. Also good to have a property file to configure variables like proxy name error code To list etc. It could be an evolving approach.

Regards,

Remeesh