0

As I was trying to see the data from clickhouse as a graph in grafana...I tried a lot with query processing but I couldn't able to get points on grafana..my table looks like

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;

these are the tables I created in clickhouse....what should be my query in grafana for getting data as a graph?

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

I used tabix but wanted in grafana

  • 1
    It is not clear what the problem is. You receive an error? Can you attach a screenshot? Did you configure grafana data source (https://github.com/Vertamedia/clickhouse-grafana)? – Mikhail Feb 06 '18 at 13:21
  • @Mikhail I want a query for the data in clickhouse tables on grafana.....how can I write queries in grafana? – yashaswini jayshankar Feb 16 '18 at 11:00
  • You can find a guide and examples here https://github.com/Vertamedia/clickhouse-grafana – Mikhail Feb 17 '18 at 20:23

0 Answers0