Welcome to Grafana

Welcome to your first lesson in Grafana! If you've ever wondered how tech companies monitor their servers, track website performance, or keep an eye on system health in real time, the answer often involves tools like Grafana. Grafana is a powerful visualization platform that turns raw data into beautiful, easy-to-understand dashboards. Think of it as the bridge between your data and your eyes — it takes numbers stored in databases and transforms them into charts, graphs, and alerts that make sense at a glance.

More About Grafana

In this lesson, you're going to take your first steps with Grafana by learning how to access it and connect it to a data source. Without a data source, Grafana is like a car without fuel — it needs data to visualize. We'll be using PostgreSQL, a popular database system, which contains real infrastructure metrics like CPU usage, memory consumption, disk space, and network activity. These are the same types of metrics that engineers monitor in production systems every day.

By the end of this lesson, you'll understand how to sign in to Grafana and connect it to a PostgreSQL data source. This foundation is crucial because everything you do in Grafana afterward — creating dashboards, building charts, setting up alerts — all starts with having access to the system and connecting to your data.

Installing Grafana

Before you can use Grafana, it needs to be installed and running on a system. On CodeSignal, Grafana is already installed and running for you — you can access it directly through your browser without any setup. However, if you're interested in installing Grafana on your own machine in the future, you can find comprehensive installation guides for various operating systems (Windows, macOS, Linux) in the official Grafana documentation. The documentation covers different installation methods including standalone binaries, Docker containers, and package managers.

For this course, you don't need to worry about installation — just focus on learning how to use Grafana effectively!

Opening Grafana (Home Page)

When you first open Grafana, you'll see an interface that looks like this:

The Grafana home page - your starting point for data visualization

Signing In to Grafana

Before you can access the full functionality of Grafana and add or view data sources, you'll need to sign in. Look for the Sign in button in the upper right corner of the screen. When prompted for credentials, use the default username and password:

  • Username: admin
  • Password: admin

After entering these credentials, Grafana will suggest that you change the password. For learning purposes, it's perfectly fine to skip this step — just click Skip to continue.

Grafana Navigation (After Login)

Once you're signed in, you'll see the full Grafana interface with all menu options available on the left sidebar.

This is your navigation hub in Grafana — it's where you'll access everything from dashboards and data sources to alerting configurations. Don't worry if it seems overwhelming at first; we'll explore each section as we need it throughout this course.

Understanding Data Sources

Before Grafana can show you anything useful, it needs to know where to find your data. This is where data sources come in. A data source is simply a connection between Grafana and the place where your data lives. That place could be a database, a cloud service, or even a file — but in our case, it's a PostgreSQL database.

PostgreSQL is a robust database system that's widely used in the industry. For this course, we've set up a PostgreSQL database that contains simulated infrastructure metrics — the kind of data you'd see in a real monitoring setup. This includes tables tracking CPU usage across different servers, memory consumption over time, disk space metrics, and network traffic. Each of these metrics is stored in its own table, waiting to be queried and visualized.

Finding Data Sources in the Grafana Menu

To access your data sources in Grafana, you'll use the left sidebar menu. Look for the Connections option:

Accessing data sources from the Grafana menu

Once you click on Connections, navigate to Data sources. This is where you manage all of Grafana's connections to external data systems.

Note: In this first unit, you'll be adding the PostgreSQL connection yourself to gain hands-on experience. In later units, data sources will be pre-configured for you so you can focus on more advanced topics.

The Connection Process (Overview)

Now that you know where to find data sources, let’s walk through the steps you’ll take to connect Grafana to PostgreSQL. Understanding these steps now will prepare you for the practice exercises ahead.

Step 1: Add a New PostgreSQL Connection

Navigate to the PostgreSQL data source section and click Add new data source. This will open a fresh configuration form where you can set up your connection:

Adding a new PostgreSQL data source connection

Step 2: Configure Connection Settings

Once you click to add a new data source, Grafana opens a configuration form where you specify how to connect to your database. This is where the magic happens! You'll see several fields that need to be filled in:

The PostgreSQL configuration screen

Here's what each setting means and the values you'll use in this course:

  • Host: This is the address where your PostgreSQL database is running, along with the port number. For our setup, enter 127.0.0.1:5433 (127.0.0.1 means "this computer" and 5433 is the port PostgreSQL is listening on)
  • Database: The specific database name you want to connect to. Enter grafana_db
  • User: The username that has permission to access the database. Enter grafana_user
  • Password: The password for the user account. Enter grafana_pass
  • TLS/SSL Mode: Security settings for the connection. Select disable from the dropdown menu for our setup

These values are configured for the CodeSignal learning environment. In real-world scenarios, you'd receive these connection details from your database administrator or from your own database setup. The important thing is understanding what each field represents and why it's needed.

Step 3: Test and Save

After filling in all the connection details, scroll to the bottom of the page and click the Save & test button. Grafana will attempt to connect to PostgreSQL and verify that everything is configured correctly. If successful, you'll see a green success message like this:

A successful connection confirmation

That green message is your confirmation that Grafana can now communicate with PostgreSQL and retrieve data. Once you see this, your data source is ready to use!

Summary

In this lesson, you learned how to get started with Grafana by signing in with the default admin credentials, navigating the main interface, and accessing the Connections menu. You explored what data sources are and why they are essential for visualizing data in Grafana. The lesson guided you through the process of adding a PostgreSQL data source by entering the correct connection details and using the Save & test feature to confirm a successful connection. In the practice section, you will go through these steps yourself to reinforce what you've learned. In the next lessons, you will build on this foundation by exploring the database structure, identifying available metrics, and creating your first visualizations in Grafana.

Let's move on to practice!

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal