Here is how I setup Stackdriver Error Reporting for my application running Play Framework 1.4:
My goal was to capture any Java exception in my production application and report it to Stackdriver Error Reporting for automatic exception monitoring and alerting.
I use the very simple Stackdriver Error Reporting report API: just send error stack traces using an HTTP POST request and an API key.
After creating a project and getting an API key in the Google Cloud Console, I instrumented my Play Framework application to catch all exceptions, format them in the expected structure and POST them to Stackdriver. (make sure you are using at least JDK v1.7)
Here is the code I added to my main application controller:
A short amount of time after deploying this code, I started receiving alerts that new errors were occurring in my production application:
I was not aware of these application errors, now I have better visibility into their impact and will be able to prioritize what to fix.
My website (Cadeaux entre nous, to organize Secret Santas), has been running on Heroku for years and has huge usage spikes around christmas. This will help me make it more stable.
Disclaimer: I am a Product Manager at Google, working on Stackdriver