I can't seem to get Google Cloud Error Reporting to properly group errors and have a stack trace. If I include the stack trace, then all errors seem to get grouped together as a Traceback error, regardless of the message or exception. The only way I have found to have error name properly reported (the Exception would be my preferred name) is to exclude the stack trace. Ie. The first error in the picture occurred only when I commented out the "stack_trace" line in the below snippet.
logger.log(
message={
# "@type": "type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent",
# "exception": exception_name,
"message": exception_name,
"stack_trace": traceback.format_exc(),
},)
How do you format logs to properly identify an error, provide a reasonable name, and include a stack trace?
I've tried using the google_cloud_error_reporting library as well as the logging client and including the stack trace and not including the stack trace.