The GreptimeDB Grafana plugin now supports SQL queries. With this enhancement, users can query data in GreptimeDB using SQL, in addition to leveraging existing PromQL query capabilities.
Querying with SQL
1. Graphical query editor
The graphical query editor provides the following features:
- Intuitive interface: Allows users to construct SQL queries visually without writing complex statements manually.
- Autocomplete for tables and fields: Facilitates quick query construction with automatic suggestions for table and column names.
2. Standard SQL query syntax support
The addition of SQL query syntax support brings several benefits:
- Full standard SQL support: Users can perform flexible and robust data queries.
- Time-range queries: Users can query data for specified time ranges without explicitly including them in the SQL statements. The plugin automatically uses the time range set in Grafana.
In future releases, the plugin will further enhance support for Grafana’s built-in macros, such as __timeFilter
.
3. Unified connection configuration
PromQL and SQL queries share the same connection configuration. There’s no need to configure separate connections for SQL. For setup details, refer to the configuration guide.
Mixing PromQL and SQL in a Single Datasource
Advantages of PromQL
PromQL, designed specifically for time-series data, offers the following benefits:
- Simple syntax: Enables rapid querying of time-series trends.
- Efficient aggregations: Functions like rate(), avg(), and sum() provide powerful aggregation capabilities.
- Tag-Based filtering and grouping: Simplifies operations involving labeled data.
Advantages of SQL
SQL, as a versatile query language, excels at handling structured data and complex join operations:
- Structured queries in time-series databases: Executes structured queries seamlessly within GreptimeDB.
- Business logic handling: Manages non-time-series data queries effectively.
- Advanced querying: Supports complex aggregations, sorting, and filtering.
Hybrid Query Scenarios
With the GreptimeDB Grafana plugin, users can combine PromQL and SQL queries within a single Grafana dashboard. For example:
- Query CPU usage trends using PromQL.
- Analyze business logs and event data using SQL.
The enhanced query capabilities of the plugin enable more efficient data analysis across various use cases.
Enhanced Efficiency with the GreptimeDB Grafana Plugin
The addition of SQL support to the GreptimeDB Grafana plugin makes querying both time-series and structured data more efficient. Users can now effortlessly build hybrid dashboards containing both PromQL and SQL queries via Grafana.
To simplify the installation process, we’ve introduced prebuilt Grafana images bundled with the plugin. These images are released with every plugin update.
Users can install and start using the plugin with the following commands:
docker pull greptime/grafana-greptimedb:latest
docker run -p 3000:3000 greptime/grafana-greptimedb:latest
Get Started Now 👉 Installation Guide
About Greptime
Greptime offers industry-leading time series database products and solutions to empower IoT and Observability scenarios, enabling enterprises to uncover valuable insights from their data with less time, complexity, and cost.
GreptimeDB is an open-source, high-performance time-series database offering unified storage and analysis for metrics, logs, and events. Try it out instantly with GreptimeCloud, a fully-managed DBaaS solution—no deployment needed!
The Edge-Cloud Integrated Solution combines multimodal edge databases with cloud-based GreptimeDB to optimize IoT edge scenarios, cutting costs while boosting data performance.
Star us on GitHub or join GreptimeDB Community on Slack to get connected.