v2.0
- About Uqbar
- Release Note
- Uqbar Installation
- Uqbar Management
- Data Retention Policy
- Time-Series Table Management
- Time-Series Data Write
- Data Compression
- Data Deletion
- Data Query
- Continuous Aggregation
- Time-Series Views
- Cluster Management
- Backup and Restoration
- Security
- GUC Parameters
- SQL Syntax
- Third Party Tools Support
- Glossary
Grafana Connects To Time-series Database (MD5 Mode)
-
Database password authentication method must be MD5.
-
Install Grafana.
docker run -d -p 3000: 3000 --name grafana grafana/grafana
-
Create a test table and insert data.
CREATE TIMESERIES POLICY IF NOT EXISTS tsbs_policy WITH(duration = '1 year', chunkgroupduration = '1 day'); CREATE TIMESERIES TABLE cpu( time timestamp TSTIME, hostname text TSTAG, region text TSTAG, datacenter text TSTAG, rack text TSTAG, os text TSTAG, arch text TSTAG, team text TSTAG, service text TSTAG, service_version text TSTAG, service_environment text TSTAG, usage_user float, usage_system float, usage_idle float, usage_nice float, usage_iowait float, usage_irq float, usage_softirq float, usage_steal float, usage_guest float, usage_guest_nice float ) POLICY tsbs_policy; CREATE INDEX ON cpu USING btree(hostname, time desc) LOCAL;
-
Configure Grafana.
-
Add data source.
-
Add dashboard.
Click "Add a new panel", select the data source in "Data source".
-
Ensure that the generated SQL can be run.
SELECT time_bucket('60 seconds', time) AS minute, max(usage_user) AS max_usage_user FROM cpu WHERE hostname IN ('host_313') AND time >= '2022-01-01 00:36:15.552285 +0000' AND time < '2022-07-04 01:36:15.552285 +000' GROUP BY minute ORDER BY minute ASC; SELECT time_bucket('60 seconds', time) AS minute, max(usage_user) AS max_usage_user FROM cpu WHERE hostname IN ('host_364', 'host_337', 'host_128', 'host_151', 'host_141', 'host_226', 'host_275') AND time >= '2022-07-01 05:56:35.685235 +0000' AND time <= '2022-07-05 00:23:44.331213 +0000' GROUP BY minute ORDER BY minute ASC;
-
View the execution result.
-