Plugins 〉Trino
Trino
Trino Grafana Data Source Plugin
The Trino datasource allows to query and visualize Trino data from within Grafana.
Getting started
Drop this into Grafana's plugins
directory. To run it locally without installing Grafana, run it in a Docker container using:
docker run -d -p 3000:3000 \
-v "$(pwd):/var/lib/grafana/plugins/trino" \
-e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=trino-datasource" \
--name=grafana \
grafana/grafana-oss
Features
- Authentication:
- HTTP Basic
- TLS client authentication
- Raw SQL editor only, no query builder yet
- Macros
Macros support
Plugin supports the following marcos:
$timeFrom($column)
- replaced with the lower boundary of the currently selected "Time Range" as a timestamp.$timeTo($column)
- replaced with the upper boundary of the currently selected "Time Range" as a timestamp.$timeGroup($column, $interval)
- replaced with an expression that rounds values of a column to the selected "Group by a time interval" value.$dateFilter($column)
- replaced with a range condition for the currently selected "Time Range" as dates, on a column passed as the $column argument. Use it in queries or query variables as...WHERE $dateFilter($column)...
or...WHERE $dateFilter(created_at)....
.$timeFilter($column)
- replaced with a range condition for the currently selected "Time Range" as timestamps, on a column passed as the $column argument.$unixEpochFilter($column)
- replaced with a range condition for the currently selected "Time Range", on a column passed as the $column argument.$parseTime
- parse a timestamp string using the default or specified format.
A description of macros is available by typing their names in Raw Editor
Templating
Using Variables in Queries
Template variable values are only quoted when the template variable is a multi-value
.
If the variable is a multi-value variable then use the IN
comparison operator
rather than =
to match against multiple values.
Example with a template variable named hostname:
SELECT
atimestamp as time,
aint as value
FROM table
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
ORDER BY atimestamp ASC
Disabling quoting for multi-value variables
Grafana automatically creates a quoted, comma-separated string for multi-value variables.
For example: if server01
and server02
are selected then it will be formatted as:
'server01', 'server02'
. To disable quoting, use the csv
formatting option for variables:
${servers:csv}
Read more about variable formatting options in the Variables documentation.
Contributing
If you have any idea for an improvement or found a bug do not hesitate to open an issue or submit a pull request. We will appreciate any help from the community.
Development
See DEVELOPMENT.md for development instructions.
License
Apache 2.0 License, please see LICENSE for details.
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing Trino on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Data Source
Use the grafana-cli tool to install Trino from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Configure the Data Source
Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.
Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.
To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.
Changelog
1.0.7
- Add support for user impersonation
1.0.6
- Revert focus change actions from last version to fix running queries
1.0.5
- Don't execute query with every focus change
- Fix connection error handling
1.0.4
- Add query variable support
- Enable alerting
1.0.3
- Use the custom CA in the custom http client
- Only check for client certs when TLS options are present
1.0.2
What's Changed
Add support for TLS client auth
1.0.1
Updated dependencies.
1.0.0
Initial release.