-
Notifications
You must be signed in to change notification settings - Fork 39
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
[bug] spans are not properly nested when using multiple auto instrumentors #1103
Comments
Hello - I'm working with @codefromthecrypt on using langchain telemetry. I filed this discussion in langchain about allowing context propagation within callback handlers which I think is required for a proper approach to fix this, feel free to chime in if appropriate. In the meantime, it would be possible to autoinstrument entry points such as |
Hey @anuraaga yeah I started taking a look at this yesterday, was trivial to get nesting correct in openai so look for that soon re issue #1061. But langchain, as you mentioned is not. We currently don't instrument any of the entry points or methods, because there are so many and they are changing all the time. But instead hook into the callback handlers like you mentioned. This make context propagation non trivial. Thanks for starting the discussion with them, will follow along in the thread and see if we can get a fix in when they support it. |
Note this is partially resolved in #1121 will keep this open for tracking any changes on the langchain front. For future context, using a proxy I was able to get properly get context and wrap original function calls with context.with however, since |
Describe the bug
When using multiple auto instrumentors, spans from distinct auto-instrumentors show up in different traces
To Reproduce
Expected behavior
Additional context
See details below specifically on difficulties with this surrounding langchain
See comments here #1062 (comment)
The text was updated successfully, but these errors were encountered: