google-cloud-platformgoogle-cloud-rungoogle-logging

What is the minimum required JSON fields for a logged ERROR to end up in Google Cloud Error Reporting


The minimum JSON for a structured error message to be parsed in by google (i.e. be marked as debug/info/error/... in the GCP logs) is {"severity":"ERROR","message":"hello world"}. But this error will never pop up in GCP Error Reporting.

What is the minimum required fields for an error to actually show up in GCP Error Reporting?


Solution

  • Take a look at Log an error event that is a text message. Of notable important is the @type field. If you aren't providing a stack_trace then Error Reporting is looking for more information in order to group the error.