clickhouse-grafana
clickhouse-grafana copied to clipboard
Problems with Cloudflare analytics engine Clickhouse after upgrading to 3.0.0
I use Cloudflare Analytics Engine and Grafana cloud. In the official documentation for Cloudflare Analytics Engine, using this plugin is the recommended option for integrating with Grafana.
I have been using Altinity plugin with Grafana for some time, but due to the Angular deprecation warnings I decided to upgrade today.
Since upgrading my plugin to 3.0.0 I have been unable to:
- Edit query settings (e.g. to select a database, table or DateTime column)
- Edit the plugin configuration in Grafana settings
Steps to reproduce:
- Follow the setup guide here: https://developers.cloudflare.com/analytics/analytics-engine/grafana/
- Create a new datasource
- You will be unable to Save and Test the datasource without a crash in Grafana
Error message:
An unexpected error happened
Details
TypeError: Cannot assign to read only property 'dataSourceUrl' of object '#<Object>'
at https://renewview.grafana.net/public/plugins/vertamedia-clickhouse-datasource/module.js?_cache=3.0.0:2:3699851
at div
at vt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:48:2348)
at o (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:1:172)
at form
at Pt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:56:1914)
at At (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:56:1464)
at f (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:239:18087)
at div
at div
at div
at div
at te (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:902:4503)
at d (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:63:30037)
at c
at div
at K (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:239:22026)
at wt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:56:4946)
at Bt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:56:5358)
at j (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:29171)
at j (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:31348)
at Gt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/Connections.a1ad302de305309a8646.js:64:2099)
at Suspense
at l (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:63:125457)
at er (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:184:11347)
at j (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:29171)
at co (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1035:4448)
at lr (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1035:11997)
at Nt (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:17387)
at j (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:31348)
at main
at div
at div
at div
at kn (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:184:2441)
at div
at kr (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:184:6891)
at co (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1035:4448)
at lr (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1035:11997)
at hs (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1035:11333)
at fr (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:17686)
at j (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1044:25387)
at v (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:111:8970)
at _ (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1377:112624)
at c (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:479:21361)
at l (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:63:125457)
at g (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:63:125966)
at et (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/330.3e128f9f2fef2b8f895b.js:1016:530)
at Ll (https://grafana-assets.grafana.net/grafana/11.1.0-70648/public/build/2540.a40dde18ed1e1774799b.js:195:127)
duplicated https://github.com/Altinity/clickhouse-grafana/issues/516 fixed in 3.1.0 which was submit on Friday let's wait when review from Grafana Labs finish
I cannot believe how long it takes
@caglarsayin 3.1.0 was released recently, please check it
Same issue on 3.2.3
@dangeredwolf which grafana-server version do you use?
@Slach I'm using Grafana Cloud, version 11.4.0-77383
When you said "same"
do you mean you see in console
TypeError: Cannot assign to read only property 'dataSourceUrl' of object '#<Object>' ?
or just "save & test" doesn't work?
I had the issue where the settings was broken with TypeError: Cannot assign to read only property 'dataSourceUrl' of object '#<Object>' (I found this GitHub issue by googling the error), and I also have the issue where I cannot set the timestamp column. Though now it's letting me access the settings without crashing this time.
I am also using Cloudflare Analytics Engine and I am unable to set the timestamp column as the timestamp. In fact, it does not list any databases, tables, or columns.
I can get the data to properly display in Grafana, but I cannot filter it by an time range because I have been unable to set the timestamp column. Per spec, it is available under the timestamp column.
Ok. let's try to figure out
could you share
curl -vvv -X POST "https://api.cloudflare.com/client/v4/accounts/<your-account-id>/analytics_engine/sql" -H "Authorization: Bearer <your-api-token>" --data "SELECT version()"
without sensitive credentials
I ran it and
< HTTP/2 422
...
* Connection #0 to host api.cloudflare.com left intact
Input was invalid: unknown function call: version
Huh... So there's that.
sorry, try Version() instead version()
ok. try
curl -vvv -X POST "https://api.cloudflare.com/client/v4/accounts/<your-account-id>/analytics_engine/sql" -H "Authorization: Bearer <your-api-token>" --data "SHOW CREATE TABLE system.columns"
unknown function call: Version
unsupported SQL statement type: SHOW CREATE TABLE system.columns
🫠
last check
same parameters but different --data
--data "SELECT name,database,table,type FROM system.columns WHERE type LIKE '%Date%' OR type LIKE '%DateTime%' OR type = 'UInt32' ORDER BY type,name FORMAT JSON"
unsupported binary operator: LIKE
Sorry if these outputs aren't more helpful, seems Cloudflare's SQL API is a bit limited :/
check
--data "SELECT name,database,table,type FROM system.columns WHERE substring(type,1,4) = 'Date' OR type = 'UInt32' ORDER BY type,name FORMAT JSON"
looks like they tested on 2.x
cannot specify a database when selecting a dataset: system
hm, looks like cloudflare workers analytics engine have too many restrictions
did you try just setup database and table and time related column, manually in UI, instead of try to select it from drop down?
did you try just setup database and table and time related column, manually in UI, instead of try to select it from drop down?
By manually in the UI do you mean typing it in and hitting enter? Cause if so, I did try that but Grafana won’t let me. If I’m missing something else though or if there’s a configuration file that I can manually edit I’d love to know about it
@dangeredwolf are you sure do you use latest version of plugin?
i just tried manual typing and just press enter in grafana cloud and everything works as expected.
@Slach 3.2.3 is the latest version, right?
yes, i created data source after that i succesfully add panel
could you save screencast to reproduce whats failed on your side?
I am able to add it but am unable to set Database or Columns in the UI even though I can write SQL queries to do so https://github.com/user-attachments/assets/8ba5332b-d056-42ab-8aef-61588a9ff55a
If I could somehow manually force timestamp as the timestamp column in the configuration somewhere it might be possible to work around this, but I'm not sure how to do that.
on shared screencast you didn't try to use keyboard
try just press left click to field and instead of trying select from drop down type database and table name in edit field and press ENTER it shall added and $timeFilter and $timeSeries shall works after that