Skip to content
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

logging: removed some noise in logs from live-tailing #1100

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
removed some noise in logs generated by live tailing by detecting cases where connection is erroring due to stopped or closed tail request

level.Error(util.Logger).Log("Error writing to tail client", fmt.Sprintf("%v", err))
// Don't log any error due to tail client closing the connection
if !util.IsConnCanceled(err) {
level.Error(cortex_util.Logger).Log("Error writing to tail client", fmt.Sprintf("%v", err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
level.Error(cortex_util.Logger).Log("Error writing to tail client", fmt.Sprintf("%v", err))
level.Error(cortex_util.Logger).Log("msg","Error writing to tail client", "err", err)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take this opportunity to rework you all your log messages as per above ? This is how gokit is supposed to be used. "k1","v1","k2","v2"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do. Thanks for the review!

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cyriltovena cyriltovena merged commit 569748f into grafana:master Oct 3, 2019
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants