Superset BI with Victoria Metrics

# Show al 
trino> SHOW SCHEMAS from Prometheus;
Schema
--------------------
default
information_schema
(2 rows)
Query 20210920_125344_00004_xqx8m, FINISHED, 3 nodes
Splits: 36 total, 36 done (100.00%)
0.28 [2 rows, 35B] [7 rows/s, 123B/s]
# Show all tables in default schema
trino> SHOW TABLES FROM prometheus.default;
Table
-------------------------------------------------------------------------------------
:kube_pod_info_node_count:
:node_memory_memavailable_bytes:sum
aggregator_openapi_v2_regeneration_count
aggregator_openapi_v2_regeneration_duration
aggregator_unavailable_apiservice
alertmanager_alerts
alertmanager_alerts_invalid_total
alertmanager_alerts_received_total
node_load15
# Prepare SQL for explanation
trino> PREPARE my_select1 FROM SELECT * FROM prometheus.default.node_load15;
# All tables
trino> DESCRIBE OUTPUT my_select1;
Column Name | Catalog | Schema | Table | Type | Type Size | Aliased
-------------+------------+---------+-------------+-----------------------------+-----------+---------
labels | prometheus | default | node_load15 | map(varchar, varchar) | 0 | false
timestamp | prometheus | default | node_load15 | timestamp(3) with time zone | 8 | false
value | prometheus | default | node_load15 | double | 8 | false
(3 rows)
Query 20210920_125727_00011_xqx8m, FINISHED, 1 node
Splits: 1 total, 1 done (100.00%)
0.78 [0 rows, 0B] [0 rows/s, 0B/s]
# Select all entries from table
trino> SELECT timestamp, value, map_keys(labels) as insance FROM prometheus.default.node_load15 where element_at(labels, 'pod') = 'node-exporter-nnd4s';
timestamp | value | insance
-----------------------------+-------+-------------------------------------------------------------------------------------------------------
2021-09-18 13:13:48.412 UTC | 22.74 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
2021-09-18 13:14:03.393 UTC | 22.75 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
2021-09-18 13:14:18.395 UTC | 23.03 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
2021-09-18 13:14:33.394 UTC | 23.23 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
2021-09-18 13:14:48.395 UTC | 23.24 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
2021-09-18 13:15:03.390 UTC | 23.37 | [__name__, namespace, service, job, instance, pod, container, endpoint, prometheus, prometheus_replica
# run aggregation functions
trino> SELECT sum(value) FROM prometheus.default.node_load15 where element_at(labels, 'pod') = 'node-exporter-nnd4s';
_col0
-------------------
433328.5800000004
(1 row)
Connection string to Trino
Data explore
Generated graph from VM dataset

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store