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

Add hook to set custom span name in requests instrumentation #149

Closed
lzchen opened this issue Nov 3, 2020 · 7 comments · Fixed by #158
Closed

Add hook to set custom span name in requests instrumentation #149

lzchen opened this issue Nov 3, 2020 · 7 comments · Fixed by #158
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed instrumentation

Comments

@lzchen
Copy link
Contributor

lzchen commented Nov 3, 2020

Similar to wsgi, accept a callback function in RequestsInstrumentor().instrument to be able to pass custom span name.

The specs say "MAY" for this feature, but we should be consistent across our instrumentations.

Part of open-telemetry/opentelemetry-python#1297

@srikanthccv
Copy link
Member

Hi @lzchen, I would like to work on this. I have one question here. Should this span name call back function for requests accept any arguments such as http method or url etc...

@lzchen
Copy link
Contributor Author

lzchen commented Nov 5, 2020

@lonewolf3739
Apologies, I've already started work on this. May I suggest working on this instead?

To address your question, yes, I think we can pass in anything that is relevant to the http call.

@lzchen lzchen self-assigned this Nov 5, 2020
@srikanthccv
Copy link
Member

Ok.

@lzchen lzchen transferred this issue from open-telemetry/opentelemetry-python Nov 5, 2020
@lzchen lzchen added help wanted Extra attention is needed instrumentation good first issue Good for newcomers labels Nov 5, 2020
@danielbraun89
Copy link

danielbraun89 commented Dec 15, 2020

The currently implemented requests name_callback does not accept neither method nor url as inputs. The user dont have any info to generate the name from.

@lzchen
Copy link
Contributor Author

lzchen commented Dec 15, 2020

@danielbraun89
Shouldn't the user always have access to method and url? They can simply use those within the callback itself, they don't need to be passed in.

@srikanthccv
Copy link
Member

@lzchen I don't think user would know the method and url with requests instrumentation. We had discussion on whether to pass environ with flask name_callback. With Flask flask.request is accessible to user always.

@lzchen
Copy link
Contributor Author

lzchen commented Dec 15, 2020

Oh that is true, I misunderstood the question. I will create a fix for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed instrumentation
Projects
None yet
3 participants