Published
Edited
Nov 28, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
client.describe("logging_table")
Insert cell
Insert cell
client.query('select * from logging_table limit 5')
Insert cell
Insert cell
import {table} from "@tmcw/tables@513"
Insert cell
my_data = client.query("select ts as event_date, evt->'logger_name' as name, evt->'message' as message from logging_table limit 5")
Insert cell
table(my_data)
Insert cell
Insert cell
results = client.query("select tse_ms::numeric, evt, evt->'name' as NAME, evt->'message' as MESSAGE, evt->'duration_ms' as DURATION_MS from logging_table where evt->'duration_ms' IS NOT NULL ORDER BY ts DESC LIMIT 5")
Insert cell
Insert cell
vegalite = require('@observablehq/vega-lite')
Insert cell
firsttrace = client.query("select id, ts as end_date, tse_ms as epoch_end, start_ms as epoch_start, evt->'trace.span_id' as span_id, evt->'name' as name, evt->'message' as message, evt->'trace.parent_id' as parent, evt->'duration_ms' as duration_ms from logging_table where evt->'trace.trace_id' IS NOT NULL order by ts desc limit 5")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
"title": "94ffac44-77a8-4fd0-8d21-90e43c473128",
data: { values: firsttrace },
transform: [
{ timeUnit: "yearmonthdatehoursminutesseconds", field: "epoch_start", as: "start_date" }
],
autosize: "fit",
width: width,
height: 500,
layer: [
{
mark: "bar",
encoding: {
"y": {
"field": "duration_ms",
"type": "quantitative",
"sort": "ascending"
},
"x": {
"field": "name",
"type": "ordinal",
},
tooltip: [
{"field": "span_id"},
{"field": "message"},
{"field": "start_date"},
{"field": "end_date"},
{"field": "epoch_start"},
{"field": "epoch_end"},
{"field": "duration_ms"}
]
}
}
],
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more