-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add severity
and message
to logging payload to improve stackdriver log viewing
#6761
Comments
Note: ideally, all this would be part of some new spec, maybe mozLog 3.0, and handled in https://github.com/mozilla-services/python-dockerflow/blob/master/src/dockerflow/logging.py. In the meantime though I'd like to get nice logs in stackdriver so we'll probably have to implement it ourselves. |
I think the downside of doing this is probably increased payload, networking traffic and cost. Cost wise, we currently emit about 5 GB application logs per day. Doubling that should not be a huge deal. Also maybe this can be made so that it can be switched on/off by an environment variable, so that if/when we stop using stackdriver, we can turned it off. The scenario is less likely to happen near-term, but given that we have changed our logging platform a few times, it's not entirely impossible. :P |
severy
and message
to logging payload to improve stackdriver log viewingseverity
and message
to logging payload to improve stackdriver log viewing
Once a new release of python-dockerflow includes the changes I made in mozilla-services/python-dockerflow#37 we'll be able to customize the payload more easily. |
we merged mozilla/addons-server#12439 which means we're now using a python-dockerflow version including those changes. |
@bqbn I have a patch locally that works. Do you have an opinion regarding duplicating the message vs removing |
FWIW, I personally use custom fields in stackdriver: https://cloud.google.com/logging/docs/view/overview#custom-fields I have this one configured all the time:
|
Would it be a problem to switch to |
If this is true, then I prefer the former for the reason that it doesn't break the spec. The logging platform and tools built around it are shared across all services cloudops has to manage, and it's assumed that the spec is adhered to. If we have something that breaks the spec, I fear that it'll cause problems in the future, say, when new feature or tools are introduced to the logging platform. |
I do too but the problem with custom fields is that you can't remove the big json blob column when you use them, so the view is still a little crowded, with lots of extra garbage being displayed. Worse, if the message is a bit too long, it gets truncated in favor of the json blob column. |
@bqbn I might just set severity for now and ignore message, cause the duplication of the text bothers me. Do you know if anything in cloudops logging pipeline/services would have issues if I add a A typical record would then contain: {
//...
"Severity": 7,
"severity": 100
} (Note the different values, since MozLog's |
Quote from Slack,
|
Stackdriver currently displays the whole json payload for each line of log because we don't set a
message
property. Similarly, because we don't setseverity
all messages are considered to be of the same severity, preventing us to filter by log level.If we were to add those fields it would increase payload size (since they'd be duplicated) but we'd get better logging viewing experience.
The text was updated successfully, but these errors were encountered: