-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implementing structured logs #10
Conversation
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
da3d05a
to
4727b11
Compare
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
4727b11
to
04e7486
Compare
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
|
||
log.WithField("err_code", err.Code). | ||
WithField("err_msg", err.Msg). | ||
WithField("uuid", uniqueID). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like the idea of uuid to tie together the logs for a request.
questions:
- will it be indexed by loki?
- if yes, how do we tell loki to not index it?
seems like loki doesn't like high cardinality labels grafana/loki#91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm assuming the logs will get shipped to Loki.
The UUID won't be indexed because of the issue you correctly pointed out.
However, I've included the UUID in all log entries related to the mail send path, so if an error occurs in any step we can correlate all logs from that request by doing something like {app="smtprelay"} | json | uuid="..."
to find all the additional details
Defaulting to stdout Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
Refactoring Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
fixes #3