This article is part of the Prometheus Monitoring Series. Other articles in this series:
As an alternative to running Grafana locally, you can also use Grafana Cloud (free tier is available) where no installation is necessary, only setup. However, this comes with it’s own challenges and pitfalls, so let’s take a look at the pros and cons.
Why Grafana Cloud Isn’t Ideal for Home Networks
To use Grafana Cloud with Prometheus, your Prometheus instance needs to be accessible over the internet. This requires a public IP address, which most home networks don’t have due to NAT (Network Address Translation). Without a public IP, Grafana Cloud cannot connect to your Prometheus instance.
Additionally, exposing Prometheus to the internet introduces security risks. You would need to implement stringent measures, such as setting up authentication and encrypting traffic with HTTPS, which can be complex for non-technical users.
Setting Up Prometheus with Grafana Cloud
If you have access to a public-facing Prometheus instance (e.g., hosted on a cloud provider), you can follow these steps:
1. Create a Grafana Cloud Account
- Visit the Grafana Cloud website and sign up for a free or paid plan.
2. Install Prometheus
- Install Prometheus on a server with a public IP address. Follow the Prometheus installation guide.
3. Configure Prometheus for Remote Write
- Edit the
prometheus.yml
file to include theremote_write
section:remote_write:
- url: "https://prometheus-blocks-prod.grafana.net/api/prom/push"
basic_auth:
username: "your-grafana-cloud-username"
password: "your-grafana-cloud-api-key"
- Replace the URL, username, and password with the details provided by Grafana Cloud.
4. Set Up Grafana Dashboards
- Log into your Grafana Cloud account.
- Create a new dashboard or import a pre-built Prometheus dashboard.
- Verify that metrics are streaming from Prometheus.
Useful Probes for Prometheus
Prometheus can be extended with probes to monitor various aspects of your infrastructure. Here are some useful ones:
CPU Usage per core: rate(node_cpu_seconds_total{mode=~"system|user"}[1m])*100
Network Traffic Received: rate(node_network_receive_bytes_total[1m])
Network Traffic Sent: rate(node_network_transmit_bytes_total[1m])
Hard Drive Usage: 100 - ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} * 100) / node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"})
Pros and Cons of Using Grafana Cloud
Pros
- Managed Service: Simplifies setup and reduces maintenance.
- Scalability: Handles large volumes of data effortlessly.
- Rich Visualizations: Offers customizable dashboards.
- Integration: Works with various data sources beyond Prometheus.
Cons
- Public IP Requirement: Needs Prometheus to be internet-accessible, which is not feasible for most home users.
- Cost: The free tier may not cover extensive use cases.
- Security Concerns: Exposing Prometheus online can create vulnerabilities.
Considerations
- Security: If you decide to use Grafana Cloud for home monitoring, ensure you implement proper security measures, like VPNs or reverse proxies with authentication.
- Alternative Tools: For home networks, consider alternatives like Zabbix, Nagios, or even self-hosted Grafana with local Prometheus.
- Data Privacy: Evaluate if sharing metrics with a cloud service aligns with your privacy preferences.
Summary
Grafana Cloud is a powerful tool for monitoring and visualization but is less suitable for home networks due to its dependency on a public IP address for Prometheus. For users who can overcome this hurdle, setting up Prometheus with Grafana Cloud involves configuring remote writes and leveraging useful probes like Blackbox Exporter and Node Exporter. However, the cost, complexity, and security concerns may make it less appealing compared to localized or alternative solutions.
If you need robust and scalable monitoring for professional use, Grafana Cloud is an excellent choice. For home networks, exploring other tools or self-hosted options might be a better path.