Using Hosted Prometheus in Grafana¶
The easiest and fastest way to see your Hosted Prometheus data is in Grafana, which we provide with every account. You will soon be able to query Hosted Prometheus data in a local Grafana installation too.
Prometheus provide some clear documentation and helpful guides on creating queries here.
Your Grafana in Metricfire¶
Your Metricfire account comes with a blank Grafana instance, with the Hosted Prometheus datasource already configured. This allows you to immediately graph the data you’ve sent us.
hostedgraphite is currently set as the default datasource which is defined in the configs we set for the Grafana container. This cannot be changed right now, but we hope to make this option available later.
Graphing Hosted Prometheus data on a local Grafana instance¶
To graph the data you have sent us in your own Grafana instance, you need to follow a few steps.
Add new Prometheus datasource:
- In Grafana’s configuration menu, click on Data Sources and select Prometheus
Apply the following settings:
- Http URL: https://www.hostedgraphite.com/datasource
Select access type: as “Server”
Select Basic Auth and provide Account ID and API key found in the quick start panel.
- User: [your-account-ID]
- Password: [your-API-Key]
Click “save” and you should have a working datasource in your Grafana.
Configuring a local Prometheus as a datasource for Grafana in Metricfire¶
It’s possible, though not necessary, to use a local Prometheus as a datasource for Grafana in your Metricfire account.
The recommended way to add your Prometheus as a datasource to your Metricfire Grafana instance would be to first make it accessible over https (required) with basic authentication enabled (suggested). Some useful links on this subject:
1. Generate your certificate using something like Let’s Encrypt
2. Add your certificate to your webserver to set up HTTPS:
Most web servers have some documentation on this. The examples in Prometheus use nginx, so we recommend having a look at the nginx documentation
3. Combine with Nginx Basic Auth:
Prometheus provides a guide for enabling this.
After this is all configured, your Prometheus should be accessible over https. When you’re happy with it, head over to Grafana in your Metricire account to add a new datasource.