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
Visualization Panels in Grafana

In the previous chapter, we took a comprehensive look at the Graph panel and explored a number of its powerful features. In this chapter, we're going to (mostly) set aside the Graph panel in favor of some of Grafana's other visualization tools.

While the Graph panel is indeed powerful and versatile, it isn't the only way to display data in Grafana. Sometimes, you need a different way to present your data, and other times you just want to break up the monotony of look at a grid of graphs. For these reasons, Grafana provides panels that depict data in a number of ways, and we'll examine each of them in this chapter.

First, we'll look at panels that condense data, such as the Stat panel and the Gauge and Bar Gauge panels. Next, we'll display geographically distributeddata with the Worldmap panel and finally, we'll look at depicting our datasets in...

Technical requirements

Introducing the Stat panel

After the Graph panel, the Stat panel may well be the next most used panel for a number of reasons:

  • It makes it extremely easy to see the value at a distance.
  • It boils down a large dataset into a single value.
  • It can feature several visually important cues.

Before we create any panels, Stat or otherwise, we need to get some data to display. We'll continue to use our US National Weather Service (NWS) weather data, especially as we're getting more familiar with the structure of the data.

Loading the dataset

The steps to load the dataset are as follows:

  1. In order to choreograph our services, we'll be using the same docker-compose.yml file as we did in Chapter 4, Connecting Grafana to a Data Source:
version: "3"

services:
  grafana:
    image: "grafana/grafana:latest"
    ports:
      - "3000:3000"
    environment...

Working with the Gauge panel

The Gauge panel is intended to emulate the look of a semicircular analog graph, and it comes with a comprehensive set of controls for text and color. Along with the controls over the display and the value, there are better threshold and value mapping controls compared to those in the Stat panel.

To get a feel for using this gauge, let's set up a set of wind-speed gauges, one for each station.

First, let's set up a query for the wind speed for all the stations. We'll use the math operator to convert the value from the native meters per second setting to kilometers per hour:

  • FROM:defaultwindSpeed
  • SELECT:field (value)math (/1000 * 3600)
  • GROUP BY:tag (station)
  • FORMAT AS:Time series
  • Query options/the Min interval:1m

Once we have our query, we'll set the look of our panel. We'll first start with the Panel tab, then move on to the settings...

Geolocating data on the Worldmap panel

Up until now, we've been exclusively using graph panels that are available on Grafana out of the box. We're going to mix things up a little by bringing in a new plugin panel and visualizing a new dataset.

There are two mechanisms for installing a new plugin—the grafana-cli command-line tool and an environment variable setting in the Grafana configuration. Because we can easily do it in Docker Compose at the same time as we launch the service, we're going to opt for the second method. All that is required is to set the GF_INSTALL_PLUGINS environment variable to the list of desired plugins in our docker-compose.yml file and restart Grafana.

In order to visualize the location of earthquakes around the world, we'll need to install a Worldmap plugin panel.

  1. Check the Grafana plugin directory at https://grafana.com/grafana/plugins to lead you to the Worldmap panel.
  2. Click on...

Structuring data fields in the Table panel

Our last panel is one of the least graphically visual options of the panels you will encounter in Grafana. The Table panel provides a spreadsheet-like data grid that is useful if you want to see the rows of actual data, along with any aggregations. When rolling up your data series into an aggregation, the Table panel is much more useful than the Graph panel legend. It also gives you the capability to sort any of its columns with a single click. The number of rows can be set to give you either a fixed window of data or a scrolling list.

Comparing aggregations

To give you an idea of how the Table panel compares to the Graph panel legend, let's create a panel and have it display a set of common aggregations. Create a new panel and select a table from Choose Visualization. Enter these parameters for the Query tab:

  • Query: InfluxDB Weather
  • SELECT: default temperature
  • FROM: field ...

Summary

In this chapter, we looked at a number of the key plugin panels that come preinstalled with Grafana. We examined the Stat, Gauge, and Bar Gauge panels—panels that reduce the complexity of each data series into a single graphical or textual representation. These panels also give you a number of styling tools to augment the visual appeal and significance of your data.

We also looked at the optional Worldmap panel, one of the many panels that can be downloaded from Grafana Labs. The Worldmap panel is useful for displaying data tagged with latitude and longitude. We also showed how to represent data values visually by mapping them to a specified size and/or color.

Finally, we explored some of the capabilities of the Table panel. The Table panel is a gridded data panel, similar in appearance to a spreadsheet, that displays time-series data by row or column or in aggregation, or it simply displays tabular data. We learned how to use regular expressions...

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