0

currently I'm working on monitoring on GCP project. There are some data in BigQuery and I'm checking if something from bigquery throws error. When it throws error, it have message containing where to send it and what is wrong. The first part is done, I am just throwing error message containing name of the slack channel and it is sending to correct slack message. But what I want, is to include in "documentation" of alert notification, payload of the error log. Specifically, I'm looking for the whole message, that is protoPayload.serviceData.jobCompletedEvent.job.jobStatus.error.message. I've tried ${metadata.system_labels}, I've tried like everything, but I still can't get anything out of the log in documentation... Just the default ones, like metric name, resource project name and stuff. But I need to work with the payload. Can someone help?

Better example: when inserting into bigquery, my script will recognize problem, throw exception in log with message (Send to this slack message: this is wrong). This message will be recognized by cloud monitoring and will send to specific slack (will read the message and based on value in the message). But with empty body, because the documentation is empty... And I want this message in the documentation. When I expand logs explorer, I find it under: protoPayload.serviceData.jobCompletedEvent.job.jobStatus.error.message. Is it possible to include it in notification message?

I've tried anything, that was in official documentation of monitoring, nothing really helped. I tried printing out {metadata.system_label}, and basically everything, that was in the documentation...

TemplarA
  • 23
  • 5

0 Answers0