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

Add Response Status Number in Http Trace Logs. #16978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rishikesh1159
Copy link
Member

Description

This PR adds response status number like 200 for OK response in the Http Trace Logs.

Related Issues

Current Http Response Logs when Trace is enabled:

[runTask-0] [2][null][OK][application/json; charset=UTF-8][442] sent response to [Netty4HttpChannel{localAddress=/local:9200, remoteAddress=/remote:1}] success [true]

PR changes Http Response Logs when Trace is enabled to:

[runTask-0] [2][null][OK][200][application/json; charset=UTF-8][442] sent response to [Netty4HttpChannel{localAddress=/local:9200, remoteAddress=/remote:1}] success [true]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

github-actions bot commented Jan 8, 2025

❌ Gradle check result for 2f87a9b: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Jan 8, 2025

✅ Gradle check result for 2f87a9b: SUCCESS

@Rishikesh1159
Copy link
Member Author

Rishikesh1159 commented Jan 8, 2025

❌ Gradle check result for 2f87a9b: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

known flaky test #14324

requestId,
opaqueHeader,
restResponse.status(),
restResponse.status().getStatus(),
Copy link
Member

Choose a reason for hiding this comment

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

This seems redundant? I think every RestStatus can be mapped to a unique integer code. Why do we need to also write that integer into this log?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah on high level it looks redundant, but there can be use cases where if user wants to configure and trigger an alarm if they see very high 5xx requests in logs. Without having the Response's integer code in log it would be very hard to add filter for RestStatus from 500 -599 as each will have different names. Using filter on Integer codes will be easier as to filter all 500 -599 responses we can just use 5xx.

@Rishikesh1159 Rishikesh1159 added the backport 2.x Backport to 2.x branch label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants