clickhouse-grafana icon indicating copy to clipboard operation
clickhouse-grafana copied to clipboard

[Enhancement]Support UInt64 unix timestamp with millisecond as datetime

Open ever4Kenny opened this issue 2 years ago • 7 comments

image 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?

ever4Kenny avatar Oct 09 '21 08:10 ever4Kenny

I could provide a pull request for this enhancement but what name should be used for this type? TimeStamp with ms?

ever4Kenny avatar Oct 09 '21 09:10 ever4Kenny

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

Slach avatar Oct 09 '21 15:10 Slach

feel free to use grafana 7.x for testing and GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=vertamedia-clickhouse-datasource for testing

Slach avatar Oct 09 '21 15:10 Slach

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?

ever4Kenny avatar Oct 11 '21 08:10 ever4Kenny

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?

Slach avatar Oct 11 '21 12:10 Slach

@ever4Kenny any news about this enhancement?

Slach avatar Nov 11 '21 12:11 Slach

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 .

mixayloff-dimaaylov avatar Oct 28 '22 11:10 mixayloff-dimaaylov