Skip to content

Commit fb001f0

Browse files
committed
update the example of using Timeplus Proton with Grafana plugin
1 parent a903428 commit fb001f0

File tree

4 files changed

+38
-41
lines changed

4 files changed

+38
-41
lines changed

examples/grafana/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demo for Grafana plugin with carsharing data
22

3-
This docker compose file demonstrates how to use Grafana to connect to Proton and visualize the data.
3+
This docker compose file demonstrates how to use Grafana to connect to Timeplus Proton and visualize the data.
44

55
A YouTube video tutorial is available for visual learners: https://www.youtube.com/watch?v=cBRl1k9qWZc
66

@@ -10,7 +10,7 @@ Simply run `docker compose up` in this folder. Three docker containers in the st
1010

1111
1. d.timeplus.com/timeplus-io/proton:latest, as the streaming SQL engine. Port 8463 and 3218 are exposed so that Grafana can connect to it.
1212
2. timeplus/cardemo:latest, as the data generator
13-
3. grafana/grafana:latest, with pre-configured Proton dashboard and a live dashboard
13+
3. grafana/grafana:latest, with pre-configured Timeplus data source and a live dashboard
1414

1515
When all containers are up running, access http://localhost:3000 and open the `Carsharing Demo Dashboard` dashboard.
1616

examples/grafana/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
environment:
2929
GF_AUTH_ANONYMOUS_ENABLED: 1
3030
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
31-
GF_INSTALL_PLUGINS: timeplus-proton-datasource
31+
GF_INSTALL_PLUGINS: https://d.timeplus.com/grafana/timeplus-proton-datasource-2.0.0.zip;timeplus-proton-datasource
3232
volumes:
3333
- ./grafana_provisioning:/etc/grafana/provisioning
3434
depends_on:

examples/grafana/grafana_provisioning/dashboards/carsharing.json

+9-15
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
"footer": {
6666
"countRows": false,
6767
"fields": "",
68-
"reducer": [
69-
"sum"
70-
],
68+
"reducer": ["sum"],
7169
"show": false
7270
},
7371
"showHeader": true
@@ -80,7 +78,7 @@
8078
"type": "timeplus-proton-datasource",
8179
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
8280
},
83-
"queryText": "select now()",
81+
"sql": "select now()",
8482
"refId": "A"
8583
}
8684
],
@@ -123,9 +121,7 @@
123121
"justifyMode": "auto",
124122
"orientation": "auto",
125123
"reduceOptions": {
126-
"calcs": [
127-
"lastNotNull"
128-
],
124+
"calcs": ["lastNotNull"],
129125
"fields": "",
130126
"values": false
131127
},
@@ -140,7 +136,7 @@
140136
"type": "timeplus-proton-datasource",
141137
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
142138
},
143-
"queryText": "select count() from car_live_data",
139+
"sql": "select count() from car_live_data",
144140
"refId": "A"
145141
}
146142
],
@@ -183,9 +179,7 @@
183179
"justifyMode": "auto",
184180
"orientation": "auto",
185181
"reduceOptions": {
186-
"calcs": [
187-
"lastNotNull"
188-
],
182+
"calcs": ["lastNotNull"],
189183
"fields": "",
190184
"values": false
191185
},
@@ -200,7 +194,7 @@
200194
"type": "timeplus-proton-datasource",
201195
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
202196
},
203-
"queryText": "select count() from car_live_data where _tp_time>earliest_ts()",
197+
"sql": "select count() from car_live_data where _tp_time>earliest_ts()",
204198
"refId": "A"
205199
}
206200
],
@@ -321,11 +315,11 @@
321315
"type": "timeplus-proton-datasource",
322316
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
323317
},
324-
"queryText": "select longitude, latitude,speed_kmh,cid from car_live_data where cid like '%1'",
318+
"sql": "select longitude, latitude,speed_kmh,cid from car_live_data where cid like '%1'",
325319
"refId": "A"
326320
}
327321
],
328-
"title": "Panel Title",
322+
"title": "Car Locations",
329323
"type": "geomap"
330324
}
331325
],
@@ -345,4 +339,4 @@
345339
"uid": "dd9e271d-7225-47d4-9e57-62133db0df62",
346340
"version": 4,
347341
"weekStart": ""
348-
}
342+
}
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
apiVersion: 1
22

33
datasources:
4-
- name: Proton
5-
type: timeplus-proton-datasource
6-
uid: c24e0faf-1490-4321-a373-7b2b07ca2e38
7-
typeName: Proton
8-
access: proxy
9-
url:
10-
password:
11-
user:
12-
database:
13-
isDefault: true
14-
basicAuth: false
15-
basicAuthUser:
16-
basicAuthPassword:
17-
withCredentials:
18-
jsonData:
19-
host: proton
20-
readOnly: false
21-
secureJsonData:
22-
tlsCACert: ""
23-
tlsClientCert: ""
24-
tlsClientKey: ""
25-
version: 1
26-
editable: true
4+
- name: Proton
5+
type: timeplus-proton-datasource
6+
uid: c24e0faf-1490-4321-a373-7b2b07ca2e38
7+
typeName: Proton
8+
access: proxy
9+
url:
10+
password:
11+
user:
12+
database:
13+
isDefault: true
14+
basicAuth: false
15+
basicAuthUser:
16+
basicAuthPassword:
17+
withCredentials:
18+
jsonData:
19+
host: proton
20+
tcpPort: 8463
21+
httpPort: 3218
22+
username: default
23+
readOnly: false
24+
secureJsonData:
25+
tlsCACert: ""
26+
tlsClientCert: ""
27+
tlsClientKey: ""
28+
version: 1
29+
editable: true

0 commit comments

Comments
 (0)