Skip to content

API to collect custom headers from request and response object are not consistent in ASGI and WSGI frameworks #1025

@sanketmehta28

Description

@sanketmehta28

In WSGI instrumentation, api add_custom_request_headers, it is not in sync with api collect_custom_request_header_attributes.

In WSGI, it collect the headers and add them to span in a single function where in ASGI, it only collect the headers from request object and return.
It will make more sense to collect headers from request object and return them rather than adding them to span in the same function as it will make that function more independent of the span.

Same behavior is expected for response headers as well.

What is the expected behavior?

  • add_custom_request_headers/add_custom_response_headers should only collect headers and return rather than adding them to span in the same function
  • Its name should start from collect_***

What is the actual behavior?
It is collecting headers and adding them to span in a single function.

Related to #906

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions