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

Adding environment variables for Http headers #1

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ashu658
Copy link
Owner

@ashu658 ashu658 commented Mar 29, 2022

Changes

Add environment variables to be configured for capturing http headers.
This spec describes how to capture the http request/response header and add them in the span. It does not specify the environment variables need to be configured to capture the headers. This change specifies these environment variables.

Env vars proposed in the PR are already supported in Java and Python sdks.

Related PR: open-telemetry#1898

Additional info:
One thing that I have seen in python is that headers provided by some frameworks/libraries (e.g. wsgi based frameworks like flask) are lowercase and - is replaced with _ which would mean user who configures
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST="CusTOM_HEAder-1"
will be able to capture custom-header-1 from request headers for some frameworks/libraries whereas for some other frameworks he won't be able to capture this header as it does not change - to _.
(All python frameworks/libraries I saw provides case-insensitive headers but only some of them replace - with _)
Mentioning this info here as I am not sure if it might affect this spec or not.

Copy link

@sanketmehta28 sanketmehta28 left a comment

Choose a reason for hiding this comment

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

Add a note in markdown that actual header will be normalized once transformed to span attributes. i.e. "Custom-Header-1" will be transformed to http.request.header.custom_header_1.

@ashu658 ashu658 marked this pull request as draft March 31, 2022 09:10
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