Skip to content

Commit

Permalink
PYD-1326: basic live view sql explanation in docs (#501)
Browse files Browse the repository at this point in the history
Co-authored-by: ChristopherGS <[email protected]>
  • Loading branch information
ChristopherGS and ChristopherGS authored Oct 15, 2024
1 parent 1e13211 commit d88f964
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion docs/guides/web-ui/live.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@ The live view is the main view of Logfire, where you can see traces in real-time

The live view is useful (as the name suggests) for watching what's going on within your application in real-time, but it can also be used to explore historical data.


## The Live View SQL Box
The live view has a query box at the top. Here you can enter the `WHERE` clause of a SQL query.

![Logfire Live View SQL query box](../../images/guide/live-view-sql-box.png)

Note: you can run more complex queries on the [explore screen](explore.md)


The schema for the records table is:

```sql
CREATE TABLE records AS (
start_timestamp timestamp with time zone,
created_at timestamp with time zone,
trace_id text,
span_id text,
parent_span_id text,
kind span_kind,
end_timestamp timestamp with time zone,
level smallint,
span_name text,
message text,
attributes_json_schema text,
attributes jsonb,
tags text[],
otel_links jsonb,
otel_events jsonb,
is_exception boolean,
otel_status_code status_code,
otel_status_message text,
otel_scope_name text,
otel_scope_version text,
otel_scope_attributes jsonb,
service_namespace text,
service_name text,
service_version text,
service_instance_id text,
process_pid integer
)
```

Some basic examples to get started:

- To view your warnings and errors type: `level > 'info'`
- To see just exceptions type: `is_exception`
- To filter by service name (which you can find on the detail panel of any given trace): `service_name = 'crud-api'`

## Details panel closed

![Logfire OpenAI Image Generation](../../images/logfire-screenshot-live-view.png)
Expand Down Expand Up @@ -95,4 +143,4 @@ When you click on a span in the Traces Scroll, it will open the details panel, w
![Logfire OpenAI Image Generation](../../images/logfire-screenshot-details-panel-variant.png)

1. This is what the timeline looks like in vertical orientation. You can toggle this orientation at any time.
2. This is what the details panel looks like in horizontal orientation. You can toggle this orientation whenever the details panel is open.
2. This is what the details panel looks like in horizontal orientation. You can toggle this orientation whenever the details panel is open.
Binary file added docs/images/guide/live-view-sql-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d88f964

Please sign in to comment.