We have a lot of instrumentations that use both Auto-Instrumentor for LangChain / Llama and OpenAI. I would like the OpenAI Auto Instrumentor to detect if its running in LangChain / LlamaIndex files. If so disable.
Possibly you could do this by using "inspect" library / looking if we called from LangChain file in frame.filename
Check if the function is called from a specific file
for frame in inspect.stack():
filename = frame.filename
Thanks Jason for the feedback. We have some ideas about making instrumentation composable but langchain itself is currently very difficult. Going to leave this parked here for now.
We have a lot of instrumentations that use both Auto-Instrumentor for LangChain / Llama and OpenAI. I would like the OpenAI Auto Instrumentor to detect if its running in LangChain / LlamaIndex files. If so disable.
Possibly you could do this by using "inspect" library / looking if we called from LangChain file in frame.filename
Check if the function is called from a specific file