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

Create utils package for instrumentors #610

Closed
mauriciovasquezbernal opened this issue Apr 23, 2020 · 0 comments · Fixed by #741
Closed

Create utils package for instrumentors #610

mauriciovasquezbernal opened this issue Apr 23, 2020 · 0 comments · Fixed by #741
Labels
discussion Issue or PR that needs/is extended discussion.

Comments

@mauriciovasquezbernal
Copy link
Member

There are some operations that are common for different instrumentors. For instance, all the http integrations need to set the span status based on the http code, they need to extract headers and so on. Currently the code is being duplicated in the different integrations, for example:

def http_status_to_canonical_code(code: int, allow_redirect: bool = True):

https://github.com/open-telemetry/opentelemetry-python/pull/597/files#diff-4a13efb3e6ce8aec7f16f718cffaa7a3R142

It could be a good idea to create a package that includes these helpers.
One idea could be to create a generic utils package for all integrations, another idea could be to do that some more specific and create utils for http and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issue or PR that needs/is extended discussion.
Projects
None yet
1 participant