-
-
Notifications
You must be signed in to change notification settings - Fork 880
Implement OpenTelemetry Instrumentation #2422
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
Conversation
yihui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just let me know when you think it's ready and I'll merge it. Thanks!
cderv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed really clean integration. Thank you!
|
I've updated this PR, with the notable changes being:
You can see a very small interactive example here (unfortunately it doesn't let me share multiple spans): I've added a news item, but wasn't sure if you'd want more documentation, or what form that would take. Happy to add something down the line if you let me know what you prefer.
|
|
How nice! I didn't know there is otel in R. |
yihui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this PR in a second. If you come up with anything else, please feel free to open subsequent PRs. Thanks!
Closes #2421.
This PR implements basic OpenTelemetry instrumentation for knitr.
Abides by general otel semantic conventions in terms of what span names / attributes should look like. As knitr does not fit into any of the existing categories, there are no compulsory attributes to include.
For now, I've included 'engine', 'echo' and 'eval' options as attributes (metadata). Feel free to suggest others to add.
The following is an example screenshot of the spans created (from knitting purrr vignettes). You can see the mirai spans nested within the knitr chunk span.
As per our video call, I've verified that this works fine for python chunks running reticulate.
We cache the otel tracer on package load - if it's not enabled then there is minimal overhead as
otel_local_active_span()has an early return if the cachedotel_is_tracingvariable isFALSE.Todo:
Feel free to ask any questions / point to other alternatives for implementation that I may not have thought of.
Thanks!