Skip to content

No spans for LangChain #468

Answered by nirga
codefromthecrypt asked this question in Q&A
Discussion options

You must be logged in to vote

@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.

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nirga
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #466 on October 17, 2024 07:21.