Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to show an error title in Error Reporting slack messages?

Hi all,

We've setup Error reporting with a slack integration using the Google Cloud Monitoring app.

Because we're using Go most of our messages are sent to Google Cloud logging as text errors using the @type=

type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent (as described here ). Panics and stack traces are not that common in Go; we heavily rely on error wrapping.

This method works fine for both cloud logging and error reporting.

The only problem I'm having is that slack notifications show the message from a parsed stack trace; which we don't have because we log text messages using `@type=...
` without a stack trace.

In addition; even if we log with `debug.Runtime()` using Go it wouldn't contain the error message either; unlike for example JavaScript or Java which do have the error message within the stack trace.
 
Error reporting does show the correct text error message as it's title. 

Is there a way to show the error reporting title in a slack notification, rather than the parsed exception message? Until now all our slack messages look like this

```
New error in someproject-prod dd477a376788eec97baa6dde71538c270ff579be
...
Resolved error has reoccurred in someproject-prod dd477a37672345235dde7153456345679be
```

Which aren't descriptive at all. I can click "View error details" which does bring me to the correct error reporting page with a big title showing what's going on... but ideally I'd have the error log message in the slack notification as well to speed up triage.

I'm hoping someone here can help me out.

Thanks!
Solved Solved
0 2 1,178
1 ACCEPTED SOLUTION

Hi @flaky,

Welcome to the Google Cloud Community!

As a temporary workaround, could you please attempt to route error messages from Error Reporting to a Pub/Sub topic, and then set up a Cloud Function that triggers from this topic to forward the messages to your Slack channel?

Additionally, if you find that this issue is greatly impacting your business, you may want to fill out a feature request form. You can find the form here.

I hope this helps. Thank you.

View solution in original post

2 REPLIES 2

Hi @flaky,

Welcome to the Google Cloud Community!

As a temporary workaround, could you please attempt to route error messages from Error Reporting to a Pub/Sub topic, and then set up a Cloud Function that triggers from this topic to forward the messages to your Slack channel?

Additionally, if you find that this issue is greatly impacting your business, you may want to fill out a feature request form. You can find the form here.

I hope this helps. Thank you.

Hi @lawrencenelson,

I thought I was missing something obvious, but knowing it's not supported out-of-the-box, I feel more confident about setting up our own notifier. The workaround you mentioned should do nicely.

Thank you for the response!

Top Solution Authors