Skip to main content

Command Palette

Search for a command to run...

Grafana For Beginners

Updated
7 min read
Grafana For Beginners
Y
Co-Organizer Cloud Native Nashik | OSS Advocate 🥑| Conference Speaker | Kubernetes | Blogger Extraordinaire

Hey Everyone, welcome to the new blog. In today's blog we are going to learn about Grafana. So without wasting time let's get started.

What is Grafana ?

Grafana is a widely used open-source platform for monitoring and observability, designed to visualize metrics, logs, and other time-series data. It offers powerful tools for building interactive, customizable dashboards, helping users gain real-time insights into their systems. Grafana supports data from a variety of sources and provides a rich set of visualization options from graphs and charts to heatmaps enabling teams to create dashboards that are both informative and visually engaging.

Features of Grafana?

Grafana offers a rich set of features that make it a powerful platform for monitoring, observability, and data visualization. Some of the key features include:

  • Flexible Dashboard Editor
    Grafana provides a powerful, drag-and-drop dashboard editor that lets you create dynamic, responsive, and visually appealing dashboards tailored to your needs.

  • Support for Multiple Data Sources
    It integrates with a wide range of data sources including time series databases (like Prometheus and InfluxDB), SQL databases, and log data platforms all without requiring data migration.

  • Diverse Visualization Options
    Grafana supports various visualization types such as graphs, tables, heatmaps, gauges, and more, giving you the flexibility to represent your data in the most meaningful way.

  • Alerting and Notification System
    You can set up alert rules based on your metrics, define thresholds, and configure notifications through channels like Slack, email, or PagerDuty ensuring issues are addressed quickly.

  • User Management and Access Control
    Built-in authentication and role-based access control allow you to manage users and control who can view or edit dashboards and data sources.

  • Vibrant Community and Plugin Ecosystem
    Grafana has a large and active open-source community that contributes plugins, shares dashboards, and provides support helping you extend and improve your observability workflows.

What is Observability?

Today, we're diving into a fundamental question What is observability? If you're just starting out, the definition can feel abstract and overwhelming. I remember how tough it was to grasp at first mainly because of the complicated terms and explanations that surrounded it.

So let’s simplify things. You might have come across observability being called “o11y” or even “olly.” That nickname comes from taking the first letter (O), the last letter (Y), and counting the 11 letters in between hence, “o11y”. It’s just a clever way developers shorten a long word.

Let’s understand observability through something more familiar a car as a complex system made up of different components the engine, brakes, fuel system, etc. When everything works well, the ride is smooth. But sometimes, something feels off maybe the engine makes a weird noise or the fuel efficiency drops. That’s when you look at the dashboard. The warning lights, fuel gauge, and temperature indicator help you understand what might be wrong. If needed, you take it to a mechanic, who connects it to a diagnostic tool to get deeper insights like error codes or sensor readings. These tools help identify the root cause and suggest a fix. Observability in software works the same way it gives you signals when something’s wrong, helps you trace the issue, and prevents it from happening again.

Now let’s apply this to software systems. Just like a car, modern applications are complex and made up of many interconnected parts. When something goes wrong, we need to observe the system understand what’s happening, where it’s happening, and why so we can fix the issue and prevent it from happening again. That’s the essence of observability. To achieve observability, we collect and analyse data from systems. This data typically comes in three forms: metrics, logs, and traces each offering a different perspective and helping us understand system behaviour in its own way.

Metrics

Metrics are numerical indicators that offer insights into your system’s performance like CPU usage, response times, or error rates. Think of them like vital signs for your application. You can even set up alerts when these numbers cross certain thresholds, just like you'd monitor a heartbeat or temperature.

Logs

Logs are detailed text records of events happening inside your system. They provide context helping you understand what occurred and when.

Traces

Traces show the journey of a request as it flows through various components of your system. They help pinpoint exactly where an issue or slowdown is happening.

LGTM Stack

At each stage of troubleshooting, we often ask ourselves:

  • What tools can help us understand the system’s current state?

  • How can we make sure the right team gets alerted early?

  • How do we quickly identify the root cause and where the issue is happening?

This is where Grafana Labs comes in they develop and maintain the LGTM Stack a powerful set of open source observability tools.

  • Loki handles Logs

  • Grafana is for Visualization

  • Tempo stores Traces

  • Mimir stores Metrics

Grafana sits at the centre of it all connecting to tools like Loki, Tempo, Mimir, and many others to help you visualize your system’s health. With Grafana, you can build dashboards using graphs, charts, and heatmaps that make your data easier to understand and act on. While it’s a powerful tool for observability, Grafana is also great for creative projects.

In the context of observability and DevOps, Grafana is most commonly used during the monitor and operate stages of the software development lifecycle. It stands out because it can connect to a wide range of data sources without forcing you to move or ingest that data into a Grafana-specific database. This means you can work with your existing tools and infrastructure, giving you the flexibility to visualize and analyse data wherever it lives.

Correlating Data Across Your Stack

Even better, you can combine multiple data sources into a single Grafana dashboard. This makes it easier to correlate events and system health indicators across your entire stack. And since no one wants to sit and watch dashboards all day, Grafana lets you set up alerts to automatically notify the right teams when something goes wrong. Dashboards can also be shared, annotated, and discussed making it easier for teams to collaborate, investigate issues, and plan effective responses together.

Open Source vs. Cloud vs. Enterprise Stack

Grafana is available in two main forms self-managed or hosted in the cloud. The self-managed route puts you in control you're responsible for setup, maintenance, and scaling within your own infrastructure. This option comes in two editions Grafana Open Source, which includes core features, and the Grafana Enterprise Stack, which adds advanced capabilities for teams that need features like privacy controls, data localization, or enterprise support.

How To Download And Run Grafana

The first step is to head over to the Grafana download page. Once you’re on the page, select the latest available version currently Grafana 12.0.2 and choose the Open Source edition to get started.

Creating Your First Dashboard

Login

After installation, Grafana is configured through a simple web-based interface. We can log in through http://localhost:3000/login, default username and password were admin & admin. We can change if we want, add data sources, and start creating dashboards.

Navigate

Navigate to the “Dashboards” section in the sidebar menu.

By clicking on New, you can either create a New Dashboard, New Folder or Import Dashboard. After clicking on New Dashboard, we will see the below screen which will allow us to Add Visualization or Library Panel or Importing Dashboard.

Adding Visualization

After clicking on Add Visualization, we need to select the required data source that we had created before.

Once we select the data source, we will be redirected to the Grafana Edit Panel where we can create multiple Visualizations like Time Series, Bar Charts, Gauges, Stats etc. We can define proper data sources, data sets, tables, and columns or define our own SQL Query that is required for particular visualization.

Summary

Grafana is a flexible and powerful platform for monitoring and observability. With support for multiple data sources, real-time dashboards, and alerting, it helps teams gain clear insights into their systems. Whether you use the Open Source Edition, Enterprise Stack, or Grafana Cloud, it offers the tools you need to stay on top of system health and performance.

References

Thank you so much for reading 💙

Like | Follow | Subscribe to the newsletter.

Catch me on my socials here: https://bio.link/yashpawar