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

Log request headers #1839

Merged
merged 9 commits into from
Feb 25, 2023
Merged

Log request headers #1839

merged 9 commits into from
Feb 25, 2023

Conversation

kaylareopelle
Copy link
Contributor

@kaylareopelle kaylareopelle commented Feb 24, 2023

Overview

  • Adds a #headers method to all NewRelic::Agent::HTTPClients::AbstractRequest subclasses that returns a hash of the headers for the request
  • Updates NewRelic::Agent::Transaction::DistributedTracer#log_request_headers to check the headers argument's class. If it is an instance of NewRelic::Agent::HTTPClients::AbstractRequest, the #headers method will be called and logged. If not, the argument as-passed will be printed

Resolves #1657

@kaylareopelle kaylareopelle marked this pull request as ready for review February 24, 2023 20:30
Previously, AbstractRequest subclass objects were being printed where a
hash of headers was expected.

Now, if the headers argument is an instance of the AbstractRequest class
its headers method will be called and used in the log message.
tannalynn
tannalynn previously approved these changes Feb 24, 2023
Copy link
Contributor

@tannalynn tannalynn left a comment

Choose a reason for hiding this comment

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

🎉

fallwith
fallwith previously approved these changes Feb 25, 2023
@github-actions
Copy link

SimpleCov Report

Coverage Threshold
Line 93.96% 93%
Branch 85.4% 84%

@kaylareopelle kaylareopelle merged commit 6845f7a into dev Feb 25, 2023
@kaylareopelle kaylareopelle deleted the log-request-headers branch February 25, 2023 00:50
@fallwith fallwith mentioned this pull request Mar 29, 2023
@fallwith
Copy link
Contributor

Released in v9.1.0 of the newrelic_rpm gem.

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.

Show request headers instead of object
3 participants