Closed codefromthecrypt closed 1 month ago
Thanks @codefromthecrypt looking into this!
@codefromthecrypt so the reason is an issue we have with OpenTelemetry auto-instrumentation. The only way we're able to solve it as of now is by manually instrumenting the module, like this:
import * as RunnableModule from "@langchain/core/runnables";
traceloop.initialize({
disableBatch: true,
instrumentModules: {
langchain: { runnablesModule: RunnableModule },
},
});
For some reason, import-in-the-middle
(which is used by OpenTelemetry for auto-instrumentation) doesn't catch some of langchain packages. I'll continue investigating this.
no worries, thanks for the tip. I'll try it!
fwiw, after trying this, I still have only one span (for the openai chat), so not multiple traces, just one with one span.
@codefromthecrypt weird, just ran you code and it works! Want to ping me on slack we can try and debug it!
thanks, I'll do another check on own first, then ping you or close it out!
you are correct it works! I think I messed up converting to commonjs. this works indeed:
const RunnableModule = require("@langchain/core/runnables");
traceloop.initialize({
baseUrl, appName, disableBatch: true,
instrumentModules: {
langchain: { runnablesModule: RunnableModule },
},
});
Hi, I'm trying this app, but I only get the openai spans, not anything from langchain abstraction. Am I missing something?