Repository navigation
[FEATURE] Trino: add trace, JSON and SQL variable plugins - #956
Open
dougkirkley wants to merge 3 commits into
Open
dougkirkley wants to merge 3 commits into
dougkirkley wants to merge 3 commits into
Conversation
Add TrinoTraceQuery, TrinoJsonQuery and TrinoSQLVariable, each with an editor, CUE schema and tests, Go SDK builder and docs with examples. The trace query reads spans by column name, returns search results for several traces and only the full trace for a single one, and asks Trino for nanosecond timestamps. The client gains an optional maxRows, used by the variable to stop at 10,000 rows, and flags a result cut on its last page as truncated. Closes perses#955 Signed-off-by: Douglass Kirkley <doug.kirkley@gmail.com>
dougkirkley
requested review from
a team,
AntoineThebaud and
Nexucis
as code owners
November 22, 2026 17:54
dougkirkley
requested review from
adrianSepiol
and removed request for
a team
November 22, 2026 17:54
jgbernalp
reviewed
Nov 23, 2026
jgbernalp
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this, the new plugins are consistent across the runtime, CUE schemas, Go SDK and docs, and well tested. I left a few inline comments: one important (bigint precision in SQL variable values), the rest minor or nits.
- Document that bigint values lose precision above 2^53 and cast the variable examples to varchar. - Rename the JSON query Go package to jsonquery. - Stop flagging a result of exactly maxRows rows as truncated. - Document the CORS header needed for trace queries with a direct URL. - Move the span type aliases below the imports. Signed-off-by: Douglass Kirkley <doug.kirkley@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #955.
Adds three plugin kinds to the Trino plugin, each with an editor, CUE schema and tests, Go SDK builder, and docs with examples:
TrinoTraceQuery(TraceQuery) reads spans from a SQL result by column name (trace_id,span_id,start_time, plus optional parent, service, span name, end or duration, status, kind and attributes; the GreptimeDB column names are accepted too). Several trace ids become search results for TraceTable and ScatterChart. A single trace id returns the full trace for TracingGanttChart, which refuses results that also carry search results, so a search matching exactly one trace is shown as that trace.varbinaryids become hex. Only this query sendsX-Trino-Client-Capabilities: PARAMETRIC_DATETIME, sotimestamp(9)keeps its nanoseconds; the header is added to the editor's proxyallowHeadersdefault, and a proxy that doesn't allow it still works with millisecond precision.TrinoJsonQuery(JsonQuery) returns rows as objects for the Table panel, with notimecolumn needed. Perses gives a JSON query no time range, so{start}and{end}aren't replaced. Rows are JS objects, so integer-like column names come first and a repeated name keeps its last value; the docs say so.TrinoSQLVariablefills a list variable from the first column, with an optional second column as the label. It reads at most 10,000 rows: the client now takes an optionalmaxRowsand cancels the query there.Client changes shared by all kinds:
maxRows(clamped to 1..100,000), andtruncatedis now also set when the last page goes past the limit.Every SQL example in the docs was run against Trino 484. The examples use
:sqlstringfor variables. The new editors reject variable datasources like the existing ones (#937), and, like them, have no editor tests.Screenshots
Perses
mainwith this branch's plugin and Trino in Docker. The dashboard runs the README examples as written, on synthetic OpenTelemetry spans (catalogicebergbacked by the memory connector).Trace table and scatter (search), Gantt chart (single trace), and Table (JSON query):
TrinoSQLVariablewith a value and label column:Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes