Table
Tables enable you to quickly represent trace data in a tabular format.
Since tables sit on top of trace data, the steps to create a table from scratch are as follows:
- Create a model.
- Create a trace with columns or props that references your model.
- Create a table that references the trace. Within the table.columns block you will need to explicitly state the trace columns and header names that you want to include.
Example
models:
- name: table-model
sql: |
select
project_name,
project_created_at,
cli_version,
stage_name,
account_name,
stage_archived
FROM visivo_project
traces:
- name: pre-table-trace
model: ref(table-model)
columns:
project_name: project_name
project_created_at: project_created_at::varchar
cli_version: cli_version
stage_name: stage_name
account_name: account_name
stage_archived: stage_archived::varchar
props:
type: scatter
x: column(project_created_at)
y: column(project_name)
tables:
- name: latest-projects-table
traces:
- ref(pre-table-trace)
column_defs:
- trace_name: pre-table-trace
columns:
- header: "Project Name"
key: columns.project_name
- header: "Project Created At"
key: columns.project_created_at
- header: "Project Json"
key: columns.project_json
- header: "CLI Version"
key: columns.cli_version
- header: "Stage Name"
key: columns.stage_name
aggregation: uniqueCount
- header: "Account Name"
key: columns.account_name
- header: "Account Name"
key: columns.stage_archived
Attributes
Field | Type | Default | Description |
---|---|---|---|
path | string | None | A unique path to this object |
name | string | None | The unique name of the object across the entire project. |
selector | Selector | None | The selector for the choosing which trace data is shown. |
traces | Array of Trace | [] | A ref() to a trace or trace defined in line. Data for the table will come from the trace. |
column_defs | Any of: TableColumnDefinition, array | None | A list of column definitions. These definitions define the columns for a given trace included in this table. |
rows_per_page | 50 | The number of rows to show per page. Default is 50 rows |