Hi! I have a fast-api app that makes calls to the Openrouter API. I have various methods that I want to track under one request to an endpoint. I've decorated the @app.post('/endpoint') with @tracer.chain and all other subsequent method calls with the same but it only tracks the first one. Is there a fundamental thing I'm doing incorrectly or is that the desired behaviour?
馃挕聽Hint: Mention RunLLM in the thread for followups.
What happens if my methods are not in the same file? RunLLM
RunLLM also doesn't Phoenix support auto-instrumentation for Openrouter?
馃挕聽Hint: Mention RunLLM in the thread for followups.
Hi Samanvya T. can you elaborate what you mean by it only tracking the first one? In general the decorators start and end a span when a function is called. It might be that you've added the decorator too high? It sounds like you are only getting a span when the route is mounted. Not sure. You might want to just open / close a span inside the route handler itself to see if that works.
Thanks for your reply Mikyo. I was able to sort out the issue by using the with tracer.start_as_current_span, and manually set attributes. Thank you! For me, the issue was even though I had set @tracer.chain for the methods (not in the same file as my main app), Phoenix wasn't able to track the spans. Let me know if I am missing something very obvious as I'm new to OTEL/Telemetry in general.
