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

Reduce log level of sampling error logging #309

Merged
merged 4 commits into from
Nov 12, 2021
Merged

Conversation

willarmiros
Copy link
Contributor

Issue #, if available:
aws/aws-xray-java-agent#65

Description of changes:
Given that errors retrieving sampling rules/targets are non-impacting to the fundamental functionality of tracing, we shouldn't be logging them at error level, especially since they are typically the result of transient network blips. Customers have complained about the verbose, scary looking error message in their logs.

@anuraaga would appreciate if you took a look.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@willarmiros willarmiros requested a review from a team as a code owner November 11, 2021 18:29
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #309 (2f01b03) into master (ff57897) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #309   +/-   ##
=========================================
  Coverage     58.86%   58.86%           
  Complexity     1206     1206           
=========================================
  Files           131      131           
  Lines          5066     5066           
  Branches        593      593           
=========================================
  Hits           2982     2982           
  Misses         1809     1809           
  Partials        275      275           
Impacted Files Coverage Δ
...aws/xray/strategy/sampling/pollers/RulePoller.java 45.71% <0.00%> (ø)
...s/xray/strategy/sampling/pollers/TargetPoller.java 48.57% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff57897...2f01b03. Read the comment docs.

@@ -71,7 +71,7 @@ public void start() {
try {
pollRule();
} catch (Throwable t) {
logger.error("Encountered error polling GetSamplingRules: ", t);
logger.warn("Encountered error polling GetSamplingRules: ", t);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in practice error and warn are the same, probably should switch to info.

Copy link
Contributor Author

@willarmiros willarmiros Nov 12, 2021

Choose a reason for hiding this comment

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

The key difference is that warn is not emitted at the SDK's default log level, and I feel like warn is probably more accurate still. Info to me is more like "normal lifecycle event" which this is not.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think SDKs ever have a default log level - it's in the end user app usually in a logback.xml. It is fairly standard practice to only log things above info level I think. This is because many libraries just log all failures as warning and don't use error at all. I guess switching to warn doesn't practically change the chance of being annoyed by the log mmessages for many apps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok that makes sense - I guess I'm getting my languages confused with default log levels. Went ahead and changed to info.

Choose a reason for hiding this comment

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

hi! willarmiros! When will the latest version of the log level reduction for sampling error logs be released

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yijiang-song unfortunately we cannot provide ETAs for our releases, please feel free to watch the repo for the next release.

Choose a reason for hiding this comment

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

Thank you! I will continue to pay attention to this issue.

@willarmiros willarmiros merged commit 7e93511 into master Nov 12, 2021
@willarmiros willarmiros deleted the willarmiros-patch-1 branch November 12, 2021 17:47
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.

4 participants