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

Added generic mechanism to provide the ability to extract span attributes #1176

Closed
codeboten opened this issue Sep 28, 2020 · 1 comment · Fixed by #1178
Closed

Added generic mechanism to provide the ability to extract span attributes #1176

codeboten opened this issue Sep 28, 2020 · 1 comment · Fixed by #1178
Labels
instrumentation Related to the instrumentation of third party libraries or frameworks

Comments

@codeboten
Copy link
Contributor

Multiple instrumentation packages are currently implementing the ability to extract additional attributes from requests via a configuration option, this should be refactored to be re-used in additional instrumentations.

#1158
#1154

@codeboten codeboten added the instrumentation Related to the instrumentation of third party libraries or frameworks label Sep 28, 2020
@falau
Copy link

falau commented Oct 2, 2020

Hello, I just came across this topic and wondering if it's possible to support multilevel lookup on extracting attributes? Likerequest.attr1.attr2.
Currently all implementations mentioned use getattr and then convert those attributes with str(), which can only look up one level of attributes. However, my use case is to access both request.user(which is str(request.user.username) in Django) and another custom attribute under it such as request.user.myattr for later use.

How about using operator.attrgetter(attr) than a getattr here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instrumentation Related to the instrumentation of third party libraries or frameworks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants