I try to migrate some metrics to timescale db.
Have a simple table:
CREATE TABLE history.db_audit
(
id bigint NOT NULL,
db_user character varying(255) COLLATE pg_catalog.“default”,
db_timestamp timestamp with time zone NOT NULL,
db_id bigint,
db_name character varying(255) COLLATE pg_catalog.“default”,
db_table character varying(255) COLLATE pg_catalog.“default”,
db_value_current jsonb,
db_value_changed jsonb,
db_version bigint,
db_tx_id bigint,
db_action character varying(255) COLLATE pg_catalog.“default”,
db_apm_trace_id character varying(1024) COLLATE pg_catalog.“default”,
db_apm_span_id character varying(1024) COLLATE pg_catalog.“default”
)
I want to graph all my groupings in a single graph without repating it.
For that purpose I am using the query below in grafana
SELECT
$__timeGroup(“db_timestamp”,‘1m’) as time,
count(id) AS “count”,
db_action,
db_name,
db_table
FROM history.db_audit
WHERE
$__timeFilter(db_timestamp) AND db_name in ($DBName) and db_table in ($TableName) and db_action in ($Action)
GROUP BY time,db_action,db_name,db_table
ORDER BY time
But get in grafana the error
Value column must have numeric datatype, column: db_name type: string value: container_db
If I format the query as Table then the query works but not my grouping of graph es expected.
What I am missing ?
Grafana Version 7.0.3
TimeScalDB Version: 1.7