0

当我试图将 clickhouse 中的数据作为 grafana 中的图表查看时……我尝试了很多查询处理,但我无法在 grafana 上获得积分……我的表格看起来像

CREATE TABLE m_psutilinfo (timestamp String, namespace String, data Float, unit String, plugin_running_on String, version UInt64, last_advertised_time String) ENGINE = Kafka('10.224.54.99:9092', 'psutilout', 'group3', 'JSONEachRow');

CREATE TABLE m_psutilinfo_t (timestamp DateTime,namespace String,data Float,unit String,plugin_running_on String,version UInt64,last_advertised_time String,DAY Date)ENGINE = MergeTree PARTITION BY DAY ORDER BY (DAY, timestamp) SETTINGS index_granularity = 8192;

CREATE MATERIALIZED VIEW m_psutilinfo_view TO m_psutilinfo_t AS SELECT toDateTime(substring(timestamp, 1, 19)) AS timestamp, namespace, data, unit, plugin_running_on, version, last_advertised_time, toDate(timestamp) AS DAY FROM m_psutilinfo;

这些是我在 clickhouse 中创建的表......我在 grafana 中的查询应该是什么以获取数据作为图表?

SELECT
    $timeSeries as t,
    count()
FROM $table
WHERE $timeFilter
GROUP BY t
ORDER BY t

我使用 tabix 但想要在 grafana

4

0 回答 0