Reader small image

You're reading from  Building IoT Visualizations using Grafana

Product typeBook
Published inJul 2022
PublisherPackt
ISBN-139781803236124
Edition1st Edition
Right arrow
Author (1)
Rodrigo Juan Hernández
Rodrigo Juan Hernández
author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández

Right arrow

Chapter 2: Exploring Grafana

In this chapter, you will learn about all the features included in Grafana. You will start to get familiar with the platform, understanding every aspect of it. First, you will discover all the menu options in the main interface. Then, you will learn about the graphical organization of Grafana, with organizations, dashboards, and panels. After that, you will learn how to ingest data into Grafana with data sources and find out about the different types.

Then, you will be introduced to plugins, which are pieces of software that make Grafana very easy to use. After that, you will learn about user management, through the topics of organizations, teams, and users. Finally, you will see some authentication methods that you can use with Grafana.

In this chapter, we’ll cover the following topics:

  • Exploring the Grafana interface
  • Organizations, dashboards, and panels
  • How to get data into Grafana
  • Making integrations easy with plugins...

Technical requirements

To get the most out of this chapter, you will need a running instance of Grafana. It can be running either on your server or in a Grafana Cloud service instance.

Exploring the Grafana interface

The user interface of Grafana is quite easy to navigate and use. In this section, you will explore all the options available on it.

Let’s start with the main screen.

The main menu

On the left side of the screen, you will find a menu, represented by some icons. Now, we will explore each of these options.

Figure 2.1 – Main menu

As you can see, Grafana offers a clean and easy-to-use user interface.

Search tool

Starting from the top, you can see a magnifying glass, which represents a search element. Using this tool, you can search for dashboards.

According to the user permissions, every user will find the dashboards that they are allowed to see and manage.

Create menu

Then, you will find a plus symbol, which opens up some options when you put your mouse over it.

The options available are as follows:

  • Dashboard
  • Folder
  • Import
  • Alerting

Each of these options is quite...

Organizations, dashboards, and panels

The user interface of Grafana is organized using a hierarchical structure.

From a high level to low, the structure is organizations, dashboards, and panels. Let’s understand these three entities.

Organizations

In Grafana, you can build multiple organizations to organize dashboards. Imagine you have several departments in an enterprise, and each of them is interested in different metrics.

You can create different organizations and assign the users of each department to the corresponding organization. In this way, each user only accesses the information that is relevant to them.

So, with a single instance of Grafana, you can manage information across all organizations without messing them up.

You can also assign a user to one or many organizations. Imagine a general manager that wants to see relevant information on the departments that depend on them. Each of these areas can have its organizational entities with dashboards...

How to get data into Grafana

In this section, we will learn about the different data sources that you can use to get data into Grafana.

In this chapter, you will not learn how to configure and use these data sources. Instead, you will acquire a clear picture of data sources, and in Chapter 4, Data Source for Grafana, you will learn how to use them.

Data sources

Data sources are the data backends that bring different types of data into Grafana. In this book, you will mostly see how to work with time series data.

Typically, you will feed data coming from databases, files, and APIs into the panels. However, Grafana has recently added other data sources, such as live data from WebSocket. We will cover all of these subjects in later chapters.

Among others, some possible data sources are as follows:

  • InfluxDB
  • Graphite
  • MySQL
  • Prometheus
  • OpenTSDB
  • Elasticsearch

Getting data into Grafana is as simple as follows:

  1. Configure Grafana to establish...

Making integrations easy with plugins

Without a doubt, plugins are a powerful tool in Grafana.

Grafana comes, by default, with a wide range of data sources and panels. As soon as you have Grafana running, you have all of them ready to use.

However, there are endless possibilities for using Grafana. Here is where plugins come to the rescue.

There are three types of plugins:

  • Panel plugins
  • Data source plugins
  • App plugins

Besides the plugins developed by Grafana Labs, you can use a lot of community plugins made by independent developers.

Let’s see what each of them can be used for.

Data source plugins

You can use data source plugins to access new types of databases. These plugins establish communication with databases and present the information in a way that Grafana understands.

So, connecting a new database is as easy as installing a data source plugin and configuring it.

You will use data source plugins to add access to databases...

Users and permissions

In Grafana, you can manage users at different levels. Each of these levels determines the tasks and permissions that a user can have.

You can assign different roles to users, allowing them to access the required resources.

There are four levels of permission management. Let’s see what they are.

Server level

The server level is the widest. It includes all the users that belong to the current instance of Grafana.

Users that have the Grafana Admin option set to Yes can manage all the organizations and user accounts in the server.

Organization level

Organizations are groups of users on a specific server.

You can create as many organizations as you need and assign users to one or more of them.

Besides users, within an organization, you can use data sources, plugins, and dashboards that are specific to that organization. So, you can have an organization with an InfluxDB database and another with a SQL database. None of these organizations...

Authentication methods

In this section, you will see all the authentication methods that you can use in Grafana. There are many possibilities, from basic authentication to integrated services.

First, let’s see a list of the authentication methods:

  • Grafana built-in user authentication
  • Auth proxy
  • Azure Active Directory OAuth
  • Generic OAuth
  • GitHub OAuth
  • GitLab OAuth
  • Google OAuth
  • JSON Web Token (JWT)
  • LDAP
  • Okta OAuth
  • SAML (Enterprise Edition only)

In the following sections, we will see some authentication methods.

Grafana authentication

In this section, you will explore some authentication methods that you can use with Grafana. However, due to the extensive configuration that these methods require, we will just see introductory information on each one.

The simplest method that you can use to authenticate users is the built-in user authentication system. This method is enabled by default, and you can use it as soon as you install Grafana, as we saw in Chapter 1, Getting Started with Grafana.

Short-lived tokens

Short-lived tokens allow active users to stay logged in. These short-lived tokens are rotated after a time equal to the specified by the token_rotation_interval_minutes configuration setting.

If the token or an active user is rotated, then login_maximum_inactive_lifetime_duration will be extended. So, the user can be inactive or even close the browser for a maximum time of timestamp of rotated token + login_maximum_inactive_lifetime_duration.

Besides these intervals, the...

Summary

In this chapter, you have familiarized yourself with the Grafana interface. Also, you have learned the basics of dashboards, panels, plugins, and data sources.

Furthermore, you learned how to manage users, teams, and organizations. These are important subjects for building a coherent hierarchy in Grafana.

Finally, you have seen several authentication methods that you can use in Grafana, including basic, proxy, JWT, LDAP, and GitHub.

Now that you have learned about the user interface of Grafana and the management of users, you can advance in your use of Grafana.

In the next chapter, you will learn how to send data to Grafana from IoT systems and devices.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Building IoT Visualizations using Grafana
Published in: Jul 2022Publisher: PacktISBN-13: 9781803236124
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández