I can query the log explorer to identify my errors I want to alert against:
resource.type = “cloud_function”
resource.labels.function_name = “my_function”
resource.labels.region = “us-central1”
severity>=ERROR
I’ve then configured an alert based on this trigger to send both an email and slack message. I’d like these messages to include the stack trace (found in textPayload).
I found a solution here: https://medium.com/google-cloud/embedding-google-cloud-logging-textpayload-into-email-c4aac0f6f8d1 – is this really the only way? No other way to include this right in the email?