...
Find the Grafana Datasource Id.
To export the metrics from a Grafana Datasource first find the Datasource Id. To find the ID for the desired Grafana Datasource, first, log in to Grafana and next go to Menu→Configuration→Data Sources* and click on the desired Datasource, then the ID is part of the URLExample URL: https://my.grafana-url.com:port/datasources/edit/31/.
In the Example URL, the ID for the Datasource is
3
1
.
*Note: If you cannot reach the Menu→Configuration→Data Sources, it indicates that you do not have necessary access rights to the Grafana. In this case, you need to contact the admin of Grafana and get the necessary access rights.Run the exporter. A full command should look like this:
Code Block | ||
---|---|---|
| ||
java -jar hivemq-metrics-exporter.jar \
--url "https://my.grafana-url.com:port/grafana" \
-u "myusername" \
-p "mypassword" \
-ds 1 \
-f "tag1=\"mytagvalue1\",tag2=\"mytagvalue2\"" \
--from "2021-08-01T10:00:00Z" \
--to "2021-08-01T19:00:00Z" \
--step 15s |
...
Name | Description | Required | Example |
---|---|---|---|
| Grafana URL (Without trailing slash) | x |
|
| Grafana Datasource ID | x |
|
| Start timestamp in ISO Format. If it ends with | x |
|
| End timestamp in ISO Format. If it ends with | x |
|
| Grafana Username |
| |
| Grafana Password. Can be passed as param directly |
| |
| Prometheus Filter to only pull HiveMQ metrics with specific tags. Example: If you would get the HiveMQ metrics with the query |
| |
| Step size, distance between measured points, should be greater or equal to the prometheus scrape interval. Default: |
| |
| Test Mode, stops after the first metric. Good for testing if the params are correct |
| |
| Enable verbose mode, good for debugging. Very verbose ! |
|
Info |
---|
In order to To get help on all available parameters of the command, run the command with the option
This will output the full list of available options and values. |
Troubleshooting
In case the Datasource Id is unknown, but the name of the Datasource is known, follow the steps of the following article to find the Datasource id by the Datasource name:
...