DEV Community

Cover image for Installing Grafana for Monitoring 😎
tj_27
tj_27

Posted on

Installing Grafana for Monitoring 😎

Grafana is a powerful open-source platform for monitoring and observability that allows you to visualize and analyze data from various sources in real time. Here are a few key reasons why you should consider installing Grafana:

1. Centralized Data Visualization

Grafana supports a wide range of data sources, including databases (like MySQL, PostgreSQL), time-series databases (such as Prometheus, InfluxDB), and cloud-based sources. By integrating these sources, you can create unified dashboards to visualize data from multiple systems in one place.

2. Real-Time Monitoring and Alerts

Grafana provides real-time monitoring capabilities with customizable dashboards. You can set up alerts based on certain thresholds or conditions, and Grafana can notify you via email, Slack, or other channels, allowing you to respond to incidents quickly.

3. Customizable and Flexible Dashboards

Grafana offers highly customizable dashboards, allowing you to create and modify graphs, heatmaps, and other visualization tools to suit your specific needs. You can design tailored dashboards to track the metrics that are most important to your organization.

4. Ease of Use

With its intuitive interface and rich set of features, Grafana is relatively easy to set up and use, even for those who are not deeply familiar with data visualization or monitoring tools. It also has a large community and comprehensive documentation to support new users.

5. Performance and Scalability

Grafana is built to handle large-scale data and is optimized for performance. It can be used in environments ranging from small personal projects to large enterprise-level applications, scaling effectively as your needs grow.

6. Open Source and Extensible

Being an open-source tool, Grafana allows you to benefit from community-contributed plugins and integrations. You can also create custom plugins to meet unique visualization needs.

7. Enhance Observability and Decision Making

Grafana helps you gain deep insights into your system’s performance, detect anomalies, and understand trends, which enhances observability and enables better decision-making for IT operations and business strategies.

Installing Grafana is a great step if you aim to improve monitoring capabilities, consolidate data visualization, or simply gain a clearer understanding of your system's performance.

Image description

Steps

  1. Configure the proxy settings to enable access, then proceed to download the Grafana latest release from the official source.
sudo yum install -y https:dl.grafana.com/oss/releases/grafana-10.0.0-1.x86_64.rpm
Enter fullscreen mode Exit fullscreen mode
  1. Start and verify the service.
systemctl start grafana-server.service
systemctl status grafana-server.service
Enter fullscreen mode Exit fullscreen mode
  1. Install Prometheus that will serve as the data source.
  2. download the package
wget https://github.com/prometheus/prometheus/releases/download/v2.49.1/prometheus-2.49.1.linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode
  • extract the file
tar -xzvf prometheus-2.49.1.linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode
  • make it a soft link
ln -s prometheus-2.49.1.linux-amd64 prometheus
Enter fullscreen mode Exit fullscreen mode
  • create a prometheus sercive file
vim /usr/lib/systemd/system/prometheus.service
Enter fullscreen mode Exit fullscreen mode

prometheus.service

[Unit]
Description=prometheus
After=network.target

[Service]
Type=simple
PIDFile=/var/run/prometheus.pid
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus --web.listen=09090 --storage.tsdb.path=/data/prometheus --web.enable-admin-api --storage.tsdb.retention=7d
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
Restart=on-failure
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
Enter fullscreen mode Exit fullscreen mode
  • start the service and verify
systemctl start prometheus.service; systemctl status prometheus.service
Enter fullscreen mode Exit fullscreen mode

To log in to your grafana on web, follow the instruction from the official documentation.

To connect the data source, follow the steps on the official documentation as well.


References:

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay