Skip to content

Commit

Permalink
Added tree visualisation of spans
Browse files Browse the repository at this point in the history
Adapted from cwang9208's suggestion in #44
  • Loading branch information
bonnefoa committed Oct 16, 2024
1 parent d3a39fc commit 08a492a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pg_tracing--0.1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ CREATE VIEW pg_tracing_peek_spans_with_level AS
WHERE s.parent_id = st.span_id
) SELECT * FROM list_trace_spans;

CREATE VIEW pg_tracing_peek_spans_tree AS
SELECT trace_id, lpad(span_operation, length(span_operation) + lvl * 2, '_'), span_id, parent_id, span_start, span_end, lvl
FROM pg_tracing_peek_spans_with_level s
ORDER BY trace_id, span_start;

CREATE VIEW pg_tracing_consume_spans AS
SELECT * FROM pg_tracing_spans(true);

Expand Down

0 comments on commit 08a492a

Please sign in to comment.