Skip to content

Commit

Permalink
update the example of using Timeplus Proton with Grafana plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jovezhong committed Nov 25, 2024
1 parent a903428 commit fb001f0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 41 deletions.
4 changes: 2 additions & 2 deletions examples/grafana/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Demo for Grafana plugin with carsharing data

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

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

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

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.
2. timeplus/cardemo:latest, as the data generator
3. grafana/grafana:latest, with pre-configured Proton dashboard and a live dashboard
3. grafana/grafana:latest, with pre-configured Timeplus data source and a live dashboard

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

Expand Down
2 changes: 1 addition & 1 deletion examples/grafana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
environment:
GF_AUTH_ANONYMOUS_ENABLED: 1
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_INSTALL_PLUGINS: timeplus-proton-datasource
GF_INSTALL_PLUGINS: https://d.timeplus.com/grafana/timeplus-proton-datasource-2.0.0.zip;timeplus-proton-datasource
volumes:
- ./grafana_provisioning:/etc/grafana/provisioning
depends_on:
Expand Down
24 changes: 9 additions & 15 deletions examples/grafana/grafana_provisioning/dashboards/carsharing.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"reducer": ["sum"],
"show": false
},
"showHeader": true
Expand All @@ -80,7 +78,7 @@
"type": "timeplus-proton-datasource",
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
},
"queryText": "select now()",
"sql": "select now()",
"refId": "A"
}
],
Expand Down Expand Up @@ -123,9 +121,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
Expand All @@ -140,7 +136,7 @@
"type": "timeplus-proton-datasource",
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
},
"queryText": "select count() from car_live_data",
"sql": "select count() from car_live_data",
"refId": "A"
}
],
Expand Down Expand Up @@ -183,9 +179,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
Expand All @@ -200,7 +194,7 @@
"type": "timeplus-proton-datasource",
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
},
"queryText": "select count() from car_live_data where _tp_time>earliest_ts()",
"sql": "select count() from car_live_data where _tp_time>earliest_ts()",
"refId": "A"
}
],
Expand Down Expand Up @@ -321,11 +315,11 @@
"type": "timeplus-proton-datasource",
"uid": "c24e0faf-1490-4321-a373-7b2b07ca2e38"
},
"queryText": "select longitude, latitude,speed_kmh,cid from car_live_data where cid like '%1'",
"sql": "select longitude, latitude,speed_kmh,cid from car_live_data where cid like '%1'",
"refId": "A"
}
],
"title": "Panel Title",
"title": "Car Locations",
"type": "geomap"
}
],
Expand All @@ -345,4 +339,4 @@
"uid": "dd9e271d-7225-47d4-9e57-62133db0df62",
"version": 4,
"weekStart": ""
}
}
49 changes: 26 additions & 23 deletions examples/grafana/grafana_provisioning/datasources/automatic.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
apiVersion: 1

datasources:
- name: Proton
type: timeplus-proton-datasource
uid: c24e0faf-1490-4321-a373-7b2b07ca2e38
typeName: Proton
access: proxy
url:
password:
user:
database:
isDefault: true
basicAuth: false
basicAuthUser:
basicAuthPassword:
withCredentials:
jsonData:
host: proton
readOnly: false
secureJsonData:
tlsCACert: ""
tlsClientCert: ""
tlsClientKey: ""
version: 1
editable: true
- name: Proton
type: timeplus-proton-datasource
uid: c24e0faf-1490-4321-a373-7b2b07ca2e38
typeName: Proton
access: proxy
url:
password:
user:
database:
isDefault: true
basicAuth: false
basicAuthUser:
basicAuthPassword:
withCredentials:
jsonData:
host: proton
tcpPort: 8463
httpPort: 3218
username: default
readOnly: false
secureJsonData:
tlsCACert: ""
tlsClientCert: ""
tlsClientKey: ""
version: 1
editable: true

0 comments on commit fb001f0

Please sign in to comment.