Reader small image

You're reading from  Learn Grafana 7.0

Product typeBook
Published inJun 2020
PublisherPackt
ISBN-139781838826581
Edition1st Edition
Tools
Right arrow
Author (1)
Eric Salituro
Eric Salituro
author image
Eric Salituro

Eric Salituro is currently a Software Engineering Manger with the Enterprise Data and Analytics Platform team at Zendesk. He has an IT career spanning over 30 years, over 20 of which were in the motion picture industry working as a pipeline technical director and software developer for innovative and creative studios like DreamWorks, Digital Domain, and Pixar. Before moving to Zendesk, he worked at Pixar helping to manage and maintain their production render farm as a Senior Software Developer. Among his accomplishments there was the development of a Python API toolkit for Grafana aimed at streamlining the creation of rendering metrics dashboards
Read more about Eric Salituro

Right arrow
An Introduction to the Graph Panel

We've now come to the chapter you've been waiting for: using Grafana to actually graph something. In this chapter, we will examine the Grafana native plugin panel, known simply as the graph panel. While there are a number of different panels in Grafana to choose from, the graph panel is the go-to panel for producing beautifully styled metrics graphs. It is one of the most versatile panels, and on first viewing, it seems to have an intimidating set of features. Due to this, we will take a broader overview approach to the graph panel before diving further in later chapters.

Much like we did in Chapter 2, A Tour of the Grafana Interface, we're going to break down the major UI elements that comprise the graph panel. Since all panels are built from the same plugin architecture, you will find that many of the panels have a similar structure. Once you become familiar with the...

Technical requirements

Touring the graph panel

Here is a typical graph panel in edit mode:

The panel's UI can be broken down into roughly three main functional areas:

  1. Panel display: Preview display, and time picker
  2. Display settings: Panel visualization type, styles, and links
  3. Data configuration: Data query, data transformation, and alerting

Throughout this chapter, we will delve into each of these features. First, we will look at the Query tab in the context of how to use it to produce graphed data. Next, we will explore how the various display settings shape the look of the graph and how to set typical panel display features such as a title. Finally, we will see how the Alert tab can establish the monitoring rules for thresholds that, when exceeded, can trigger alerts. Of course, all of this is dependent on what we'll create next: a simple data source.

Creating a simple data source

...

Generating data series in the Query tab

If it isn't already selected, click on the Query tab to select it. The Query tab is where we will assign a data source to the panel's queries. With TestData DB set as the default data source, Grafana also sets up Random Walk to be the default query Scenario, so we are now ready to go with both a data source and a query that produces the displayed dataset series.

Before we go into the Query tab, we should probably talk a bit about its purpose. Rather than some similar applications that connect to a single database application, Grafana was designed to be agnostic about data. Grafana data source plugins are not only responsible for presenting a simplified query interface to the Grafana user but also for feeding the returned data into the Grafana 7 unified data model, which is used by many panels. Most Grafana users will find that, even with a simplified query UI, they can make relatively sophisticated queries.

In cases...

Editing the graph in the Panel tab

On the right-hand side of the graph display, you'll find the Panel tab, where you'll find a boatload of features for tailoring the look of your panel. The panel's myriad of options are available from one easily accessed column, with each one featuring a disclosure control so that you only need to see the options relevant to the task at hand.

The Settings section

Starting from the top of the Panel tab, the Settings section is used for general panel settings such as the title or description. As shown in the following screenshot, the Settingssection contains three settings:

  • Panel title: Sets the panel's title on the dashboard
  • Description: Sets the content of the panel's information popup
  • Transparent: Increases the panel's transparency:

Setting the panel's Title is obviously a good practice if you want to make it...

Monitoring with the Alert tab

We have now come to the Alert tab, the last of the graph panel tabs. In this pane, you can configure the panel with an alert. While we are going to look at the Grafana alerting system in more detail in Chapter 9, Grafana Alerting, let's take a peek at the interface to get a feel for what it takes to create an alert (spoiler: not much!). Click on the Create Alert button to have a look inside an alert.

The following screenshot shows a newly created alert:

An alert is composed of four key components:

  • Rule
  • Conditions
  • No Data & Error Handling
  • Notifications

Let's take a look at them now.

Rule

An Alert rule can be broken down into two basic settings: the rule name and an evaluation period. The rule Name is used by Grafana...

Summary

That's it for the graph panel for now! I invite you to play around with the various settings, especially those in the Visualization panel. Here are some simple exercises for you to try out:

  1. Create multiple data series in the Query tab. Try out the different Scenarios to see how they create different kinds of data. Rearrange the order to see what effect it has on the graph.
  2. Play with different combinations of drawing objects in the Displaysection. Change the fill or size of points, lines, and bars.
  3. Turn on the legend and test out its many options. Try clicking on various elements in the legend itself – you might find some surprises!

This chapter completesSection 1: Getting Started With Grafana. In this section, we installed the Grafana server, checked out the Grafana application interface, set up some simple dashboards, and graphed test data sources. In the next section,Section 2: Real-World Grafana, we...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learn Grafana 7.0
Published in: Jun 2020Publisher: PacktISBN-13: 9781838826581
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 $15.99/month. Cancel anytime

Author (1)

author image
Eric Salituro

Eric Salituro is currently a Software Engineering Manger with the Enterprise Data and Analytics Platform team at Zendesk. He has an IT career spanning over 30 years, over 20 of which were in the motion picture industry working as a pipeline technical director and software developer for innovative and creative studios like DreamWorks, Digital Domain, and Pixar. Before moving to Zendesk, he worked at Pixar helping to manage and maintain their production render farm as a Senior Software Developer. Among his accomplishments there was the development of a Python API toolkit for Grafana aimed at streamlining the creation of rendering metrics dashboards
Read more about Eric Salituro