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

Show request headers instead of object #1657

Closed
kaylareopelle opened this issue Nov 29, 2022 · 5 comments · Fixed by #1839
Closed

Show request headers instead of object #1657

kaylareopelle opened this issue Nov 29, 2022 · 5 comments · Fixed by #1839
Assignees
Labels
bug P4-Bug Priority 4 Bug

Comments

@kaylareopelle
Copy link
Contributor

kaylareopelle commented Nov 29, 2022

When a customer uses the HTTPClient library for their external requests, they do not see the headers for the requests in the logs, but instead the human-readable representation of the object.

Example:
OUTGOING REQUEST HEADERS: #<NewRelic::Agent::HTTPClients::HTTPClientRequest:0x00007fd0dda983e0>

The content following the colon should be a list of headers.

The DistributedTracer#log_request_headers method is responsible for logging this line of code. It expects the first argument, headers will always be an interpolatable value that includes the header values.

This method is invoked by ExternalRequestSegment#add_request_headers, which calls DistributedTracer#insert_headers with the request object as an argument, followed by DistributedTracer#log_request_headers.

DistributedTracer#insert_headers uses the argument it receives from ExternalRequestSegment#add_request_headers for multiple method calls:

  • insert_trace_context_headers
  • insert_distributed_trace_header
  • insert_cross_app_header
  • log_request_headers

It's unclear if these method calls are silently failing when the external request is an HTTPClientRequest.

Acceptance Criteria

  • Logged headers for HTTPClientRequest objects are the headers and not the human-readable representation of the HTTPClientRequest object
  • All HTTP client libraries have their headers correctly logged
  • Methods called in DistributedTracer#insert_headers are able to do what they need to with the header argument for each external request library (make sure there aren't silent failures happening when other DT headers are getting added)
@kaylareopelle kaylareopelle added bug P4-Bug Priority 4 Bug labels Nov 29, 2022
@workato-integration
Copy link

@kaylareopelle
Copy link
Contributor Author

Sidekick please, @tannalynn!

@fallwith
Copy link
Contributor

Hey team! Please add your planning poker estimate with Zenhub @hannahramadan @kaylareopelle @tannalynn

@angelatan2
Copy link
Contributor

From grooming: we may need to add a test to cover headers on the HTTP clients.

@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
bug P4-Bug Priority 4 Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants