clickhouse-grafana
clickhouse-grafana copied to clipboard
[Enhancement]Support UInt64 unix timestamp with millisecond as datetime
Currently we only support Datetime\DateTime\Timestmap(Unix timestamp with second) as datetime. However in some case, there are data using unix timestamp with millisecond as datetime(such as logs etc.). Should we support this?
I could provide a pull request for this enhancement but what name should be used for this type? TimeStamp with ms?
I think the right names are:
-
TimeStamp uint32
-
TimeStamp with ms uint64
please, also look to backend golang part if you add new type you need also add support for this on backend part
feel free to use grafana 7.x for testing and GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=vertamedia-clickhouse-datasource
for testing
I've edited the frontend part(without backend change) and tested it with grafana 8.1.1. It looks good to me and the data could be correctly filtered and displayed . Could you please shed some light on which golang part should be looked into?
I mean the following golang part https://github.com/Vertamedia/clickhouse-grafana/blob/master/pkg/parser.go#L83-L97 and https://github.com/Vertamedia/clickhouse-grafana/blob/master/pkg/parser.go#L265-L279
maybe current code will enough but please create separate dashboard in https://github.com/Vertamedia/clickhouse-grafana/tree/master/docker/grafana/dashboards
where create sample of graph, and example for alert to allow test it manually
Also, could you create JEST test case to cover new behavior?
@ever4Kenny any news about this enhancement?
Any updates on this? For me $columns
with time column set to column:TimeStamp
returns incorrect query. $timeFilterMs
also returns incorrect query. I forced to correct it
by multiplying the time column by 1000.
This can be done as in PR #46, which ads TimeStampMs
column datatype for UInt64
columns.
You can look at the port of this for the new version, but I'm not sure of the absolute correctness. And I'm having problems with alerts like in #447 .