Skip to content

Allow configuring header extraction via runtime parameters #2009

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

Closed
adriangb opened this issue Oct 18, 2023 · 4 comments · Fixed by #2026
Closed

Allow configuring header extraction via runtime parameters #2009

adriangb opened this issue Oct 18, 2023 · 4 comments · Fixed by #2026

Comments

@adriangb
Copy link
Contributor

Currently, web framework instrumentations only allow configuring header extraction via environment variables. I want to add the option to configure them via constructor parameters. I think the code should be quite straightforward but I want to check if this would be an acceptable change before making a PR. Some background on why it wasn't implemented in the first place might also be helpful if it's something other than 'no one asked for it yet'.

@adriangb
Copy link
Contributor Author

@lzchen @srikanthccv any thoughts? I don't see any reason why it couldn't be added as a runtime parameter as well.

@srikanthccv
Copy link
Member

I think we followed what Java did at the time and used the same environment variables for consistency. We already support configuring some capabilities such as excluding URLs with construction params. This change is fine. Please send a pull request.

@adriangb
Copy link
Contributor Author

Thank you @ocelotl for merging the PR! Do you have any preferenece on how we pass these parameters to the Starlette and FastAPI middleware?

@srikanthccv
Copy link
Member

Usually, we pass down the parameters as we do for the *_hook today. Do you have some other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants