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 logging of HTTP status codes #7993

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Reduce logging of HTTP status codes #7993

merged 1 commit into from
Oct 16, 2024

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Oct 14, 2024

Description

This change reduces the amount of logging we do for an HTTP response in non-error cases by moving those logs to debug instead of info.

In particular we generate a TON of logs for for asynchronous operations where the API is being polled at 1 second intervals by the CLI. Since it's hitting the operation status endpoint, the status code is always 200 and not especially meaningful.

This change simplifies the logging by applying the following rules:

  • Non-2XX status codes continue to be logged at info level.
  • 2XX status code are now logged at debug level (off by default).

My motivation for this change is to make the logs more readable by making the more significant events visible. Right now it's hard to find significant events in our logs because there is a flood of "responded with 200" type events due to the nature of async operations. When an async operation is taking a long time to process, the relevant information might be 100s of lines back in the history.

I've been testing this out locally for a few days of work and I feel like it's really improved my ability to diagnose issues.

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
  • If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.

This change reduces the amount of logging we do in non-error cases by moving those logs to debug instead of info.

In particular we generate a TON of logs for for asynchronous operations where the API is being polled at 1 second intervals by the CLI. Since it's hitting the operation status endpoint, the status code is always 200 and not especially meaningful.

This change simplifies the logging by applying the following rules:

- Non-2XX status codes continue to be logged at info level.
- 2XX status code are now logged at debug level (off by default). 

Signed-off-by: Ryan Nowak <[email protected]>
@rynowak rynowak requested review from a team as code owners October 14, 2024 21:28
@rynowak rynowak temporarily deployed to functional-tests October 14, 2024 21:28 — with GitHub Actions Inactive
@rynowak
Copy link
Contributor Author

rynowak commented Oct 14, 2024

@kachawla - interested in your thoughts in particular 👍 See PR summary for motivation and details.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 14, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 13a0c11
Unique ID func2c06224029
Image tag pr-func2c06224029
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func2c06224029
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func2c06224029
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func2c06224029
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func2c06224029
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link

Unit Tests

3 478 tests  ±0   3 470 ✅ ±0   5m 22s ⏱️ -1s
  270 suites ±0       8 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 13a0c11. ± Comparison against base commit 38fcc3e.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 60.36%. Comparing base (38fcc3e) to head (13a0c11).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/armrpc/rest/results.go 20.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7993   +/-   ##
=======================================
  Coverage   60.35%   60.36%           
=======================================
  Files         560      560           
  Lines       29417    29417           
=======================================
+ Hits        17755    17757    +2     
+ Misses      10114    10113    -1     
+ Partials     1548     1547    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kachawla kachawla left a comment

Choose a reason for hiding this comment

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

I'm in full support of this! 🚀

@rynowak rynowak merged commit 7918871 into main Oct 16, 2024
31 checks passed
@rynowak rynowak deleted the rynowak/reduce-logging branch October 16, 2024 15:04
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