Plugins 〉Hetzner Cloud
Hetzner Cloud
Hetzner Cloud data source for Grafana
Introduction
With this plugin you can display metrics data for your Hetzner Cloud Servers & Load Balancers in your Grafana dashboards. It works directly with the Hetzner Cloud API, and does not require Prometheus or any other additional software.
Requirements
- Grafana 10+
Getting Started
After you have installed the data source plugin, you need to add a new data source in Grafana. Create a new read
API Token for the project and set it in the data source settings.
To quickly get started, you can import the included dashboard, which displays all available metrics for servers & load balancers. This is available in a tab on the data source settings page. Alternatively you can also get the JSON from the repo.
Documentation
Query Editor
The Query Editor can be hard to grasp at first, so here is an overview of the available options.
Selecting Resources
In the query editor, you can choose which resources type, server or load balancer, you want to get metrics for.
To define which servers/load balancers you want to see in the graph, you can choose between the following options:
- IDs: A drop-down list of all available servers/load balancers in the project. You can select multiple IDs.
- Labels: You can set label selectors to filter the resources. This is useful if you have a dynamic list of resources.
- Variable: This option exists to support using Dashboard-wide variables to select the resources. Should include the
$
prefix of the variable, e.g.$servers
. See Using Variables for more details.
Legend Format
You can rename the returned series names by using the Legend Format
field in the query editor. This works similar to the Prometheus data source.
In the specified format, you can include the names of labels in {{ }}
brackets, and they will be replaced with the actual label values.
Right now, the following labels are available:
name
: The name of the resource (server or load balancer)id
: The ID of the resourceseries_name
: Name of the series from the API (e.g.disk.0.iops.read
)series_display_name
: A human-readable name for the series (e.g.Read
)
If not specified, the default format is: {{ series_display_name }} {{ name }}
.
Query Type
By default, queries return metrics. It is also possible to select the Query Type List Resources. This will return a table of the matching resources with some interesting fields, like the server type and the labels.
The returned field var
is necessary for Using Variables.
Using Variables
If you would like to have a dropdown list of servers or load balancers in your dashboard, you can use the List Resources
query type to get a list of resources.
The returned values from this will look like $resource_name : $resource_id
. Add the regex (?<text>.*) : (?<value>.*)
to get the resource name as options.
This regex is also required so you can use the variable in later queries, as it will make the ID the value when the option is selected.
Assuming you created the variable $servers
with the mentioned regex, you can now create a new panel with the Metrics
query type, click Select By Variable and set the variable name field to $servers
.
The panel should then automatically update when you select different servers in the dropdown.
You can also take a look at the included dashboard to see in practice how this should be set up.
Multiple Projects
If you want to access metrics from multiple Hetzner Cloud projects, you need to create a new data source for each project, with separate API Tokens. The default dashboard has a variable to select the current project.
Contributing
If you have any questions, feedback or ideas, feel free to open an issue or pull request.
Support Disclaimer
This is not an official Hetzner Cloud product in any way and Hetzner Cloud does not provide support for this.
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 Hetzner Cloud 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 Hetzner Cloud 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
0.3.0 (2024-04-28)
New Features
- Colors in time series visualisation are now consistent across refreshes
0.2.0 (2024-01-12)
New Features
- Sign Plugin for distribution
- improve error message when API Token is invalid or missing
Bug Fixes
- resource calls using wrong paths and not handling unknown route
0.1.1 (2024-01-10)
Bug Fixes
- remove double slash in resource calls from frontend
- remove type assertation for *prometheus.Registry by @apricote in #1
0.1.0 (2024-01-06)
- Initial release.