Skip to content

Commit d590687

Browse files
carl-dbcarlverge
andauthored
add format option for trace (#81)
Co-authored-by: Carl Verge <carlverge@gmail.com>
1 parent 6cccadd commit d590687

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

query.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const (
2323
FormatOptionTable
2424
// FormatOptionLogs sets the preferred visualization to logs
2525
FormatOptionLogs
26+
// FormatOptionsTrace sets the preferred visualization to trace
27+
FormatOptionTrace
2628
)
2729

2830
// Query is the model that represents the query that users submit from the panel / queryeditor.
@@ -158,6 +160,11 @@ func getFrames(rows *sql.Rows, limit int64, converters []sqlutil.Converter, fill
158160
return data.Frames{frame}, nil
159161
}
160162

163+
if query.Format == FormatOptionTrace {
164+
frame.Meta.PreferredVisualization = data.VisTypeTrace
165+
return data.Frames{frame}, nil
166+
}
167+
161168
count, err := frame.RowLen()
162169

163170
if err != nil {

0 commit comments

Comments
 (0)