Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Grafana
Bestseller
Highest Rated
Rating: 4.6 out of 5(7,666 ratings)
56,936 students

Grafana

Learn Grafana, the leading open source tool for visualizing metrics, time series data and application analytics.
Created bySean Bradley
Last updated 11/2025
English

What you'll learn

  • Explore the Graph, Stat, Gauge, Bar Gauge, Table, Text, Heatmap and Logs Panels
  • Install and configure a MySQL Datasource, Dashboard and Collector
  • Install and configure a Zabbix Server Datasource, Dashboards
  • Install and configure InfluxDB with Telegraf
  • Use Dashboard Variables to create Dynamic Dashboards with Automatic Visualisation Placement
  • Install an SNMP Agent and Configure Telegraf SNMP Input
  • Install Loki Data Source that queries a Loki Service that is ingesting data from a Alloy Service.
  • Graph Time Series aswell as Non Time Series SQL Data
  • Create custom MySQL Time Series Queries
  • Install Grafana from Packages
  • Add a Nginx Reverse Proxy for Grafana
  • Create a domain name and install an SSL certificate for the Grafana Server
  • Explore the Dashboards Panels Options
  • Install a SMTP server and setup an Email Notification Channel
  • Setup Alerts for when SNMP devices go offline or return no data
  • Setup a Telegram Contact Point
  • Use Annotation Queries to Link Logs Panels and Graph Panels
  • Install Prometheus with Several Node Exporters and A Dashboard
  • Setup an Elasticsearch server with Filebeat and Metricbeat services.

Course content

1 section63 lectures7h 34m total length
  • Provisioning a Server to install Grafana9:33

    The official documentation for this course is hosted for FREE at https://sbcode.net/grafana. I have written it specifically to be used by the students of this course. Please check the documentation links in the resources for each lesson, as there may be some extra notes added to each lesson.


    In this course all my examples are executed on an unrestricted Ubuntu 24.04 LTS. You can get minimal Ubuntu 24.04 LTS server from cloud providers. In this course I used Digital Ocean, with this link https://m.do.co/c/23d277be9014, you will normally get $200 credit for 60 days, occasionally the offer changes, but can create and delete as many VMs as you wish during the initial offer period.


    Also, you can use the Grafana Cloud option if you want to outsource the managemt of hosting your own Grafana server. Use this link : https://grafana.com/auth/sign-up?refCode=gr83y6yqNccjKnX

  • Install Grafana11:23

    Grafana is excellent for monitoring time series data.

    In this video, I will install Grafana


    After the successful install, you can start the Grafana service

    $ sudo service grafana-server start


    Your Grafana server will be hosted at

    http://[your Grafana server url]:3000


    The default login,

    Username : admin

    Password : admin

  • Upgrade/Downgrade Grafana4:59

    Grafana is updated very regularly.

    When using the open source version of Grafana, you need to manage updates yourself and at your own risk.

    The open source version comes with no promise of backwards compatibility, so upgrading may affect how any dashboards, visualizations, data sources, etc work.

    Remember that upgrading is done at your own risk. If you consider that the upgrade was detrimental, you can downgrade back to your previous version by using the same method.

    To minimize potential backwards compatibility issues when upgrading, it is better to upgrade 1 patch at a time until you get to the version that you desire. That way you can look at the change log documentation at https://grafana.com/docs/grafana/latest/release-notes/ to get a clue about how to fix any errors that you may suddenly have.

  • Point Domain Name5:44

    Using my Domain name provider, I create an A name record pointing to my Grafana server IP address.

  • Reverse Proxy Grafana with Nginx6:28

    Now to add a proxy. I will use Nginx. The Nginx proxy will also allow us to more easily configure our Grafana servers public url and bind an SSL certificate to it. It is possible to change the grafana.ini settings to use a specific port number, SSL certificates and http protocol instead but you will also need to manage file permissions that the Grafana server process will need. It is more versatile to use a dedicated proxy and especially if your server will be hosting multiple other web applications.

  • Add SSL6:56

    I add SSL to the Grafana web server to ensure all traffic is encrypted between the server and web browser.

    I use LetsEncrypt by following the Certbot instructions.

    For Web Server software, I choose Nginx

    For Operating system, I choose Ubuntu 24.04 LTS

    I then SSH onto my new Grafana server,

    I ensure snap is installed.

    # sudo snap list


    Make sure I have the latest version of snap

    # sudo snap install core; sudo snap refresh core


    I install the classic certbot

    # sudo snap install --classic certbot


    Prepare the command so that it can be executed from the command line

    # sudo ln -s /snap/bin/certbot /usr/bin/certbot


    Start the process of installing the SSL certificate for my domain name.

    # sudo certbot --nginx


    Follow the prompts, and enter the domain name that you want to secure.

    After completion, you should then be able to now visit your Grafana server using the url

    https://YOUR-DOMAIN-NAME

    Note that after running Certbot, it has changed the settings of your Nginx configuration file you created earlier.

    You can see those changes by using the cat command.

    # cat /etc/nginx/sites-enabled/YOUR-DOMAIN-NAME

  • Create First Data Source4:05

    I use the 'TestData' data source. This is perfect for beginning to learn about Grafana visualisations.

  • Panel Rows3:00

    We add a panel to the existing TestData dashboard, and more specifically, we first look at managing rows and the various presentation options we have.

  • Panel Presentation Options4:21

    We look at some of the presentation options for panels, such as positioning, size, keyboard shortcuts, duplication, deleting and more.

  • Dashboard Versioning2:59

    When creating and editing Dashboards, it is advisable to make regular saves in case you need to go back to a previous version or not.

  • Graph Panel : Visualisation Options14:29

    I demonstrate many of the visualisation settings found in the panel tab and using different TestDataDB data source scenarios.

  • Graph Panel : Overrides3:29

    I demonstrate the settings found in the Overrides tabs.

  • Graph Panel : Transformations3:31

    I demonstrate using the Reduce and Add field from calculation transformations on the data from the TestData we have so far. These two transformations are likely to be the most common use case for using transforms within Grafana and are a good base to understand the remaining transforms.

  • Stat Panel4:08

    Show a single value in a series.

  • Gauge Panel0:54

    We explore the Gauge panel.

  • Bar Gauge Panel0:44

    We explore the Bar Gauge panel.

  • Table Panel4:53

    We explore the Table panel.

  • Overview So Far4:26
  • Create MySQL Data Source, Collector and Dashboard22:45

    In this video, I demonstrate how to set up the MySQL Data Source with a collector and it's related dashboard.

    I also demonstrate how to install a MySQL database server.

    I install the MySQL database onto a new sever to also demonstrate the types of issues that you may have when connecting Grafana to another server.

    Add the MySQL Data source in Grafana. If you try to save it, it will have some issues. We will next setup a MySQL server ready for the Data Source configuration.

    After sourcing your new server (you can always use your existing Grafana server if you prefer) we next can install MySQL onto the new server. SSH onto your new MySQL server.

  • Connecting Grafana Cloud to MySQL using PDC11:31

    If you are using a Grafana Cloud instance, and you want to connect to your external MySQL server, then communication will travel across the public network.

    There is a lot to consider to make this communication secure, and even just to get it to work.

    An easy option we have to implement this, is to setup a Private Data Source Connect (PDC) agent on our MySQL server that can manage communications between our Grafana Cloud instance, and our externally hosted MySQL server.

  • Create a Custom MySQL Time Series Query9:30

    We create a custom MySQL time series query that reads data from a our table in our MySQL database and formats the result set in a way that Grafana can use as a time series result set, and present that data in a graph along with the ability to filter that data using the Grafana user interface time filter drop down.

  • Graphing Non Time Series SQL Data in Grafana6:54

    Grafana graphs Time Series data from many types of data sources extremely well.

    But sometimes you just want to graph, simple non time series data. i.e., Data without timestamps, flat tables that show simple statistics or values.

  • Intermission : Promtail Deprecation to Alloy0:36

    Promtail has been deprecated. This course now teaches Alloy.

  • Install Loki Binary and Start as a Service7:35

    To keep this as simple as possible, we will install the Loki binary as a service on our existing Grafana server.

  • Install Alloy Binary and Start as a Service6:57

    Now we will create the Alloy agent service that will act as the collector for Loki.

  • Connect Alloy to Grafana Cloud8:11

    If you are doing this course using Grafana Cloud, and not creating your own self hosted Grafana infrastructure, then you will need a server to install Alloy onto in order to participate in the next many lessons.

  • LogQL Stream Selectors7:47

    Now that we have a loki data source we can query it with the LogQL query language.

    In this video, we will try out many LogQL queries in the 'systemd-journal' stream selector that we just set up.

    There are two types of LogQL queries:

    1. Log queries returning the contents of log lines as streams.

    2. Metric queries that convert logs into value matrixes.

    A LogQL query consists of,

    1. The log stream selector

    2. Filter expression

    We can use operations on both the log stream selectors and filter expressions to refine them.

    Topics discussed in the video are,

    • Log Stream Selectors

    • Filter Expressions

    • Expression Operators

    • Range and Instance Vectors

    • Aggregate Functions

    • Aggregate Group

    • Comparison Operators

    • Logical Operators

    • Arithmetic Operators

    • Operator order


  • LogQL Filter Expressions12:34
  • Install a Second Alloy Agent12:30

    We can install an Alloy agent on other servers, and point them to an existing Loki service already running on a different server. If you have multiple Alloy agents distributed around your network, and all pushing data to one main Loki service, then there are a few more considerations.

    If using an Alloy agent, or Loki service across the network, then it is important that you consider who can access it, or whether it needs to be encrypted since the transmitted data is likely to contain sensitive information about your server and other services.

  • Annotation Queries Linking the Log and Graph Panels6:01

    In this video, I demonstrate setting up annotation queries to help me visualize invalid user login attempts on my servers.

  • Read Nginx Logs with Alloy11:03

    We will add to our Alloy config, the ability to read the Nginx access logs.

    Restart the Alloy service and check its status.

    If I go back into Grafana, I will see the new nginx job inside the Explore panel.

    This is pretty good now, but we can make it better.

    I want to be able to filter by the status code and other http properties.

    We can use the loki pattern parser to dynamically create labels for query refinement.

    Now I can create a dashboard for Nginx status codes.

  • Install Prometheus Service and Data Source5:03

    Prometheus is already available on the default Ubuntu 20.04 repositories. So we can just install it and it will be set up as a service already.

    $ sudo apt install prometheus

    $ sudo service prometheus status


    Test it by visiting http://[your domain or ip]:9090/graph

    Restrict internet access by

    $ iptables -A INPUT -p tcp -s localhost --dport 9090 -j ACCEPT

    $ iptables -A INPUT -p tcp --dport 9090 -j DROP

    $ iptables -L

  • Connect to Prometheus In Grafana Cloud7:38

    Our Grafana Cloud instance has a Prometheus endpoint enabled, so we can push Prometheus system metrics to it from our servers where we have an alloy agent running.

    Alloy can push the same metrics as a traditional Prometheus node exporter.

  • Install Prometheus Dashboard2:48

    We will install two dashboards being one for the Prometheus service and the other for the Node Exporter.

    The Prometheus dashboard can be found in the dashboards tab for the Prometheus data source configuration in the Grafana UI.

    We will get the Node Exporter dashboard from the official Grafana Dashboards link.

    https://grafana.com/grafana/dashboards

    The dashboard Id is 11074 for the English version or Id 8919 for the Chinese version.

    English Version: https://grafana.com/grafana/dashboards/11074

    Chinese Version: https://grafana.com/grafana/dashboards/8919

  • Setup Grafana Metrics Prometheus Dashboard5:10

    Depending on your Grafana and Prometheus versions, the pre built Grafana Metrics dashboard may partly work or not at all.

    In this video, I will show the steps that I used to get it to work.

    Install the Grafana Metrics dashboard from the Prometheus Datasource --> Dashboards tab.

    The Prometheus service, since it is local will, retrieve Grafana stats from the url http://127.0.0.0.1:3000/metrics

    Grafana will return metrics data by default.

    You can verify or change the settings in the grafana.ini file.

    Go back into Grafana, and there is likely to be some issues with the visualizations.

    In the video, I fix each problem in turn and demonstrate my problem solving process.

  • Install Second Prometheus Node Exporter8:36

    I will install a Prometheus Node Exporter on a different server and connect to it using the main Prometheus service.

    It is now exposing the metrics endpoint on http://[your domain or ip]:9100

    We can create a scrape config on the Prometheus server that retrieves metrics from that URL.

    But since my new node exporter is accessible from the internet, I will block port 9100.

    Next, Go back onto the main Prometheus server and edit the existing scrape config for node and add the new metrics endpoint for the other server.

  • Create and Configure a Zabbix Data Source6:25

    You can connect directly to Zabbix via the API method. If you want faster performance than it is advised to also setup a MySQL data source for your Zabbix connection. The MySQL data source will instead connect directly to the Zabbix database and bypass the API layer for certain queries.

  • Import Zabbix Dashboards7:47

    We import the 3 supplied Zabbix Dashboards

    1. Zabbix System Status

    2. Zabbix Template Linux Server

    3. Zabbix Server Dashboard

  • Dashboard Variables13:32

    In the next few lectures, we will look at how the create and use dashboard variables.

    We will manually recreate fully a dynamic dashboard to query our SNMP devices that we've set up in the previous lectures.



  • A Dashboard Variable Example10:53

    We create Dynamic Tables from a Prometheus query using a dashboard variable.

  • Repeating Timeseries using Dashboard Variables5:30

    We create repeating dynamic timeseries graphs from queries using our dashboard variables.

  • MikroTik 260GS SNMP Dashboard15:08

    I have an SNMP enabled MikroTik 260GS switch configured as a host in my Zabbix system. I demonstrate creating a Grafana dashboard for it.

  • Alerting Rule for High CPU10:11

    We will create an alerting rule for high CPU usage reported by any of our node exporters.

  • Alerting Rules for Node Exporter and Prometheus Down9:11

    We will create alerting rules from when Prometheus detects a Node exporter is not up.

    And we will create an alerting rule for when Prometheus is down.

    When a node exporter is down, then Prometheus will return a 0 for the up metric. This is easy to write an alerting rule for.

    But when Prometheus is down, then Grafana will get a timeout. There will be no response from Prometheus at all.

    We will need to handle the symptom, rather than the metric value, as is returned when a Node exporter is down.

  • Create an Email Alert Contact Point8:21

    I want to send alerts using Grafana, but I need to first create an alert notification channel.

    In this lecture I will create a new channel for email alerts.

    I don't have an SMTP server available, so install a local send only SMTP server on my Grafana server.


  • Create Telegram Contact Point4:43

    We can also add Telegram as a Contact Point for Alerting.

    To do this install the Telegram app on your phone or PC. It will be easiest to set this up on the PC first.

    You will need a BOT API Token and Chat ID.

    See Video for example how to do this.

  • Users and Roles8:50

    We add users to our Grafana system using several different methods such as,

    • Add User,

    • Invite User,

    • User Sign Up,

    • Anonymous users

    We also set the various roles of our users and manage the various permissions of our dashboards to allow certain roles to view and/or edit.

  • Teams3:16

    Teams help to segregate groups of users further.

    You can assign team permissions to your dashboards and add/remove users from the teams instead without needing to go into each individual dashboard and reassign/add/remove particular user permissions each time.

  • Organizations3:50

    Orgs can be used to create a new Grafana configuration with its own dashboards, data sources, users, team, alerts on an existing Grafana install.

    Users can be shared between Orgs if you need.

  • Course Conclusion1:22
  • Install InfluxDB Server and Data Source8:37

    We are going to install InfluxDB v2, the InfluxDB data source, a Telegraf agent and then collect some data.

    InfluxDB is a database useful for storing large amounts of timestamped data.

    Telegraf is an agent that supports plugins and it will save it's data into InfluxDB.

  • Install Telegraf Agent and Configure for InfluxDB7:54

    Now to install the Telegraf agent and configure the output plugin to save data into the InfluxDB.

  • Install A Dashboard For Default InfluxDB/Telegraf Metrics4:06

    Now that we have a System dashboard visible in InfluxDB, we can also re-produce this same dashboard in Grafana.

    In this video, I demonstrate the process of doing that.

  • Install SNMP Agent and Configure Telegraf SNMP Input9:15

    SNMP stands for Simple Network Management Protocol. 

    We can configure Telegraf to read SNMP, save it into InfluxDB and view it in Grafana.

    Common devices that support SNMP are routers, switches, printers, servers, workstations and other devices found on IP networks.

    Not every network device supports SNMP, or has it enabled, and there is a good chance you don't have an SNMP enabled device available that you can use in this lecture.

    So, I will also show you how to install and configure SNMP on your server, as well as read the SNMP data with Telegraf, save it into InfluxDB and view it in Grafana.


  • Add Multiple SNMP Devices to Telegraf Config6:26

    I will add several more SNMP agents to the Telegraf config.

    In order for Telegraf to connect to the external SNMP agents, those other SNMP agents will need to be configured to allow my Telegraf agent on my Grafana server to connect remotely.

    At the end of the lecture, I have 3 separate SNMP agents I can query for the next lecture.

  • Import SNMP Dashboard that uses InfluxDB and Telegraf4:44

    We Import a SNMP Dashboard that uses the InfluxDB data source and the Telegraf collector.


  • Elasticsearch Data Source and Database8:35

    I demonstrate installing and querying Elasticsearch 7.16.

    Elasticsearch uses the JavaVM. So I recommend a minimum spec of 2GB RAM for the server that you use for the Elasticsearch service.

    I am using Debian Package Instructions from https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html


  • Setup Elasticsearch Filebeat7:49

    I demonstrate how to setup a Filebeat service to read systemd logs.

    And then we can set up a new data source in Grafana, or modify the existing and test it using the explore tab.

  • Setup Elasticseach Metricbeat4:31

    I demonstrate how to setup a Metricbeat service to send to the Elasticsearch server.

  • Setup an Advanced Elasticsearch Dashboard3:45

    Now to install an advanced dashboard that uses both the Filebeat and Metricbeat data sources at the same time.

    I will set this up on my Linux server where the Filebeat process is already running.

    Download Metricbeat for your OS from https://www.elastic.co/downloads/beats/metricbeat

    My OS is a Debian based Ubuntu 20.04

  • Install Promtail Binary and Start as a Service4:32

    Now we will create the Promtail service that will act as the collector for Loki.

  • Install a Second Promtail Service16:01

    We can install a Promtail service on other servers, and point them to an existing Loki service already running on a different server. If you have multiple Promtail services distributed around your network, and all pushing data to one main Loki service, then there are a few more considerations.

    We then need to make sure that the job label in your Promtail configuration scrape_configs is unique from the perspective of the Loki service that it will be pushing to.

    If using a Promtail service, or Loki service across the network, then it is important that you consider who can access it, or whether it needs to be encrypted since the transmitted data is likely to contain sensitive information about your server and other services.

  • Read Nginx Logs with Promtail9:36

    We will add to our Promtail scrape configs, the ability to read the Nginx access logs.

    We need to add a new job_name to our existing Promtail config_promtail.yml

    Restart the Promtail service and check its status.

    If I go back into Grafana, I will see the new nginx job inside the Explore panel.

    This is pretty good now, but we can make it better.

    I want to be able to filter by the status code and other http properties.

    We can use the loki pattern parser to dynamically create labels for query refinement.

    Now I can create a dashboard for Nginx status codes.

Requirements

  • Basic Linux Experience
  • Basic MySQL Familiarity
  • All commands entered during the lectures are provided in the corresponding resources

Description

Welcome to my course on Grafana

Grafana is an analytics platform for all of your metrics. Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. Create, explore, and share dashboards with your team and foster a data driven culture. Trusted and loved by the community.

This is a Learn by example course, where I demonstrate all the concepts discussed so that you can see them working, and you can try them out for yourself as well.

With this course, comes accompanying documentation that you can access for free. You will then be able to match what you see in the videos and copy/paste directly from my documentation and see the same result.

In this course we will,

  • Install Grafana from Packages

  • Create a domain name, install an SSL certificate and change the default port

  • Explore the Graph, Stat, Gauge, Bar Gauge, Table, Text, Heatmap and Logs Panels

  • Create many different types of Data Sources from MySQL, Zabbix, InfluxDB, Prometheus and Loki

  • We will configure their various collection processes such as MySQL Event Scheduler, Telegraf, Node Exporters, SNMP agents, Alloy and Beats

  • We will look at graphing Time Series data versus Non Time Series data

  • We will also install dashboards for each of the Data Sources, experimenting with community created dashboards plus experimenting with our own

  • We will create Annotation Queries and link the Log and Graphs panels together

  • We will look at Dynamic Dashboard Variables, Dynamic Tables and Graphs

  • We will look at creating Value Groups/Tags and how to use them with different kinds of data sources

  • We will set up Alerting Channels/Contact Points and understand the different alerting options, configure an example to detect offline SNMP devices and demonstrate receiving email alerts via a local SMTP server

At the end of the course, you will have your own dedicated working Grafana Server, which will be in the cloud, with SSL, a domain name, with many example Data Sources and collectors configured, that you can call your own, ready for you to take it to the next level.

Once again, this is a Learn by example course, with all the example commands available for you to copy and paste. I demonstrate them working, and you will be able to do that to.

You are now ready to continue.

Thanks for taking part in my course, and i'll see you there.

Who this course is for:

  • Network, Systems and Database Administrators
  • Infrastructure Monitoring Specialists
  • IT Platform Specialists
  • DevOps Technicians
  • Enthusiasts wanting a better understanding and better visibility of their networks in the home or office
  • Someone who is curious and wants a good understanding of what Grafana does and what it's good at.