pydantic / logfire

Uncomplicated Observability for Python and beyond! 🪵🔥
https://logfire.pydantic.dev/docs/
MIT License
2.05k stars 61 forks source link

Filter by Ongoing Requests in Live View #445

Open tamir-alltrue-ai opened 2 weeks ago

tamir-alltrue-ai commented 2 weeks ago

Description

It would be very useful to filter to ongoing requests only in the live view. I often times want to see the logs corresponding with actions that I'm taking in my client - especially long-lived operations - and being able to filter to live requests would help me identify the spans corresponding with the actions I'm taking in real time.

alexmojaki commented 2 weeks ago

Try kind = 'pending_span'.

cc @petyosi who I think would be interested in the existence of this use case.

tamir-alltrue-ai commented 2 weeks ago

Excellent, thanks!

The next thing that would be great would be to filter to "top level" spans - when I run that query I see all sub-spans unfolded by default, but what I would love to do is

kind = 'pending_span' and span_level = 0 or something

alexmojaki commented 2 weeks ago

Right-click on your profile pic and turn off "Expand to display query-matching spans", then refresh the page.

The way to identify those spans in SQL is parent_span_id is null, but for technical reasons your experience will probably be smoother if you don't also include that in your filter in the live view.