Skip to content

Disbale Tracing for some Langchain Components #4680

Closed Answered by dosubot bot
DRXD1000 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can disable tracing for specific components of a Langchain chain/graph using the suppress_tracing context manager. Here is an example:

from phoenix.trace import suppress_tracing

with suppress_tracing():
    # Code running inside this block doesn't generate traces.
    # For example, running LLM evals here won't generate additional traces.
    ...
# Tracing will resume outside the block.
...

Additionally, to disable tracing permanently for the LangChain instrumentor, you can call the .uninstrument() method:

LangChainInstrumentor().uninstrument()

This will stop tracing indefinitely for the LangChain components [1][2].

To continue talking to Dosu, mention @dosu.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Answer selected by DRXD1000
Comment options

You must be logged in to vote
3 replies
@DRXD1000
Comment options

@mikeldking
Comment options

@DRXD1000
Comment options

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