Day 73 : Grafana on AWS EC2 Setup Tutorial.

Day 73 : Grafana on AWS EC2 Setup Tutorial.

ยท

5 min read

๐Ÿ“Š What is Grafana, and why is it used for monitoring?

  • Grafana is an ๐Ÿ“ˆ open-source analytics and monitoring platform that allows users to visualize, query, and analyze data from various data sources. It's commonly used for monitoring because it provides a user-friendly interface for creating interactive dashboards and alerts, making it easier to track the performance of systems and applications.

๐Ÿ“Š What are the features of Grafana?

  • ๐Ÿš€ Data Visualization: Grafana empowers users to design visually engaging and interactive dashboards, enabling the representation of data through charts, graphs, and other visual elements.

  • ๐Ÿ”Œ Data Source Integration: The flexibility of Grafana allows it to connect seamlessly with a wide array of data sources, including databases, cloud services, monitoring systems, and more. This capability enables the consolidation of data from multiple sources into a single dashboard.

  • ๐Ÿ“ˆ Time Series Data: Grafana excels at handling time series data, making it an ideal choice for monitoring and analyzing data that evolves over time, such as system metrics, performance data, and IoT-related information.

  • ๐Ÿšจ Alerting: Within Grafana, users can establish alerting rules, ensuring that they receive notifications when specific conditions are met. This feature is pivotal for proactive monitoring and the timely resolution of issues.

  • ๐Ÿงฉ Plugin Architecture: Grafana's extensible plugin system offers numerous options for enhancing functionality, with a wide selection of plugins available for data sources, visualization types, and custom integrations.

  • ๐Ÿ“† Data Exploration: Grafana simplifies the exploration of historical data, permitting users to focus on specific time ranges and conduct thorough data analysis, facilitating the identification of trends, anomalies, and historical context.

  • ๐Ÿ“ง Notification Channels: Grafana supports multiple notification channels, such as email and Slack, enabling users to configure channels for receiving alerts and updates from their dashboards.

  • ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Collaboration: The platform accommodates multiple users who can collaborate on dashboards and share them with team members. Access permissions can be set to control viewing and editing rights.

  • ๐Ÿงน Data Transformation: Grafana offers the capability to manipulate and transform data before presentation on dashboards, aiding in data cleaning and ensuring meaningful data display.

  • ๐ŸŒ Integration: Grafana seamlessly integrates with various other monitoring tools and services, including Prometheus, InfluxDB, Elasticsearch, and more, positioning itself as a central component within a comprehensive monitoring and observability stack.

  • ๐Ÿ“š Documentation and Community: Grafana boasts an extensive repository of documentation and an active community, providing access to support, plugins, and resources for maximizing the potential of the platform.

  • ๐Ÿ“Š Customization: Grafana is highly customizable, allowing users to craft dashboards tailored to their specific requirements and branding.

๐Ÿ“Š Why Grafana?

  • Grafana is the top choice for monitoring and data visualization, and here's why: it's open-source and packed with powerful features.

  • It seamlessly connects to different data sources and provides user-friendly dashboards for making data easy to understand.

  • Grafana is particularly great with data that changes over time, making it ideal for tracking evolving metrics.

  • It also has strong alerting capabilities to catch issues early and a robust plugin system that lets you customize and integrate with various tools.

  • With Grafana, exploring historical data is a breeze, allowing for deep analysis. It's a versatile tool that encourages teamwork and can be tailored to your specific needs, making it perfect for teams and organizations looking for effective monitoring and observability solutions.

Task-01

Setup Grafana on AWS EC2.

  • Step-01: Launch an EC2 instance with Ubuntu 22.04 AMI, t2.micro instance type and 8GB storage.

Screenshot from 2023-10-27 16-16-45

  • Step-02: Now connect to the instance using SSH.

Screenshot from 2023-10-27 16-17-29

  • Step-03: Now update the instance.
sudo apt update
  • Step-04: Install the Pre-requisites Packages of Grafana.
sudo apt-get install -y apt-transport-https software-properties-common wget

Screenshot from 2023-10-27 16-18-28

  • Step-05: Add the GPG key for the official Grafana repository to your system.
sudo mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

Screenshot from 2023-10-27 16-18-48

  • Step-06: Add the Grafana repository to the sources list for stable releases.
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

Screenshot from 2023-10-27 16-19-07

  • Step-07: Update the apt package list and install the latest version of Grafana.
sudo apt-get update
sudo apt-get install grafana

Screenshot from 2023-10-27 16-20-21

  • Step-08: Start the Grafana service and enable it to start at boot time.
sudo systemctl start grafana-server
sudo systemctl status grafana-server

Screenshot from 2023-10-27 16-21-32

  • Step-09: Now let's configure the port 3000 in the security group of the instance first select the instance and then click on the security group.

imageedit_4_2199517771

  • Step-10: Now click on the inbound rules and then click on the edit inbound rules.

imageedit_8_9899671076

  • Step-11: Now click on the add rule and then select the custom TCP and then enter the port number 3000 and then click on the save rules.

imageedit_13_5968381780

  • Step-12: Now open the browser and then enter the public IP of the instance with the port number 3000 and then click on the enter.

imageedit_18_7898423376

  • Step-13: Now you see the Grafana Dashboard.

imageedit_21_7021632194


Task-02

Grafana Dashboard Overview.

  • Here we have a Home and general settings with Kiosk Mode (To hide home panel) and use ESC to get an original view.

Screenshot from 2023-10-13 14-04-38

  • This option is used when you have 100s of dashboards and you query the important filter you want to use.

Screenshot from 2023-10-13 14-11-38

  • This is the place where we can create Dashboards and folders.

Screenshot from 2023-10-13 14-12-34

Screenshot from 2023-10-13 14-14-28

  • From here we can create Dashboards where we can add different types of visualizations by adding new panels. (I will be covering this in the Future this is just an Overview)

Screenshot from 2023-10-13 14-20-14

  • We can also add multiple panels in it.

Screenshot from 2023-10-13 14-25-33

  • Alerting is the option where we can define all the alerting rules. For example, we have server utilization under server utilization we have:

    1. CPU Utilization.
    1. Memory Utilization.
    1. File system utilization.

Screenshot from 2023-10-13 14-29-18

  • Administration refers to the configuration where we have most of the settings. For example, we have two data sources so we need to create a Grafana Dashboard by connecting to MySQL and configure the Data Sources.

Screenshot from 2023-10-13 14-37-01


Did you find this article valuable?

Support Rohit Rajput by becoming a sponsor. Any amount is appreciated!

ย