Hi, I'm currently using a global trace provider to instrument my llama-index application (image). Is there a way of instead of using global instrumentation, do targeted instrumentation? example: I have 2 separate llama-index workflows, but I want only one to send spans to phoenix.
To achieve targeted instrumentation for specific workflows in your LlamaIndex application, you can use the OpenInferenceTraceCallbackHandler to instrument only the parts you want. Instead of setting a global handler, attach handlers to specific workflows. This allows you to selectively send spans to Phoenix for only the desired workflows.
Here's a basic example of how you might set this up:
```
from openinference.instrumentation.llama_index._callback import OpenInferenceTraceCallbackHandler
handler = OpenInferenceTraceCallbackHandler()
workflow_1.attach_handler(handler)
LBKSWould you like more detail on this process?
Sources:
- [Slack Discussion](https://arize-ai.slack.com/archives/C04R3GXC8HK/p1714680586.088139)
馃挕聽Hint: Mention RunLLM in the thread for followups.
I don鈥檛 think this is possible right now, but it鈥檚 something we can investigate. Would you mind opening an enhancement request to provide some details for us to track?
Leaving this here for future slack searchers. There's a way of accomplish this today. https://github.com/Arize-ai/phoenix/issues/5293#issuecomment-2467460740 Thanks Roger Y.
