-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve GoogleCloudConsoleFormatter
to support log based GCP error reporting
#14260
Comments
Thanks for creating the issue. I'll confirm a couple of things internally and get back to you. |
Thank you very much @amanda-tarafa |
I've looked at this some more and I have the following questions/observations/opinions. Please call out if I'm missing something.
More broadly, this a general purpose Google Cloud Logging formatter, not an Error Reporting specific formatter, and in my opinion, its implementation shouldn't be too strongly tied to the Error Reporting heuristics for identifying error entries. What would you think of an approach where we add an option |
Hi @amanda-tarafa, thank you for your feedback.
you're right about this, this would also invalidate backwards compatibility of the formatter, so this should be dropped.
This is not correct, i tested setting the service context on all logs and they are not getting picked up as errors.
I agree with you that they could already pick up on it, although the instructions don't have any conditions on the log severity, which is in line with their behavior.
I would be fine with this, but i would prefer if the client library would make it easy to configure the observability of GCP as i see logging and error reporting parts of this bigger concept. Please let me know what you're thinking. |
Thanks for your replies. We are discussing internally and with the Error Reporting team what's the best way forward. You'll hear from us next week. |
Perfect, thanks so much. |
@danielwinkler We've discussed internally and with the Error Reporting team. Adding special fields to log entries is not just about those entries being recognized and displayed as errors by Error Reporting, it is also about grouping those entries together as occurrences of the same error. Different fields are used together or not to group entries, depending on the context, and not all of the heuristics are publicly documented, and that's intentional. In a general purpose formatter such as this one, we feel more comfortable exposing an entry augmentation mechanism, for users to specify the combination of Error Reporting specific fields that suits their use case better, without our logger being tied to one or the other combination. I'm happy to review a full PR for that, including tests, etc. if you want to have a go at it, else, we'll work on it ourselves in the next couple of weeks. |
@amanda-tarafa thanks for feedback, I created an implementation of your suggestion (#14284) |
Thanks @danielwinkler , I'll take a look as soon as I can, but it might well be early next week. |
Currently the error reporting is only picking up from logs if the log has a stack trace, as described in the docs.
However, I would like to have the possibility to get also informed when logs reach a certain severity, e.g.
Error
.The idea of the PR #14257 is to be able to configure a
ErrorReportingLogLevel
, and logs higher or equal will get annotated in the structured logging such that it will trigger the error reporting.Additionally, the PR allows to add a service context, by specifying
ServiceIdentifier
andServiceVersion
.This in turn will improve the ability to filter the errors in the "Error reporting".
The text was updated successfully, but these errors were encountered: