Learn Grafana 10.x - Eric Salituro - E-Book

Learn Grafana 10.x E-Book

Eric Salituro

0,0
29,99 €

oder
-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Get ready to unlock the full potential of the open-source Grafana observability platform, ideal for analyzing and monitoring time-series data with this updated second edition. This beginners guide will help you get up to speed with Grafana’s latest features for querying, visualizing, and exploring logs and metrics, no matter where they are stored.
Starting with the basics, this book demonstrates how to quickly install and set up a Grafana server using Docker. You’ll then be introduced to the main components of the Grafana interface before learning how to analyze and visualize data from sources such as InfluxDB, Telegraf, Prometheus, Logstash, and Elasticsearch. The book extensively covers key panel visualizations in Grafana, including Time Series, Stat, Table, Bar Gauge, and Text, and guides you in using Python to pipeline data, transformations to facilitate analytics, and templating to build dynamic dashboards. Exploring real-time data streaming with Telegraf, Promtail, and Loki, you’ll work with observability features like alerting rules and integration with PagerDuty and Slack. As you progress, the book addresses the administrative aspects of Grafana, from configuring users and organizations to implementing user authentication with Okta and LDAP, as well as organizing dashboards into folders, and more.
By the end of this book, you’ll have gained all the knowledge you need to start building interactive dashboards.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Learn Grafana 10.x

A beginner’s guide to practical data analytics, interactive dashboards, and observability

Eric Salituro

BIRMINGHAM—MUMBAI

Learn Grafana 10.x
Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Kaustubh Manglurkar

Publishing Product Manager: Apeksha Shetty

Book Project Manager: Kirti Pisat

Senior Editor: Tazeen Shaikh

Technical Editor: Rahul Limbachiya

Copy Editor: Safis Editing

Proofreader: Safis Editing

Indexer: Subalakshmi Govindhan

Production Designer: Ponraj Dhandapani

DevRel Marketing Coordinator: Nivedita Singh

First published: June 2020

Second edition: December 2023

Production reference: 1201123

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-80323-108-2

www.packtpub.com

To my wife, Susan, for her infinite patience, support, and companionship. To my mother, Patricia, who introduced her son to so many books, yet never expected that he would someday go on to write one.

– Eric Salituro

Contributors

About the author

Eric Salituro is currently a software engineering manager with the enterprise data and analytics platform team at Zendesk. He has an IT career that spans more than 35 years, over 20 of which were spent in the motion picture industry working as a pipeline technical director and software developer for innovative and creative studios such as 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 is the development of a Python API toolkit for Grafana aimed at streamlining the creation of rendering metrics dashboards. He is the author of Learn Grafana 7.0.

About the reviewers

Chad Isenberg has been working as a data professional since 2018 and is currently a data engineer at Zendesk. His experience and interests include analytics, data platforms, data quality, DataOps, and many other data-prefixed subjects. He is passionate about the data community and contributes articles and blog posts to platforms such as Medium and LinkedIn.

Mahdi Karabiben is a data engineer with over 7 years of experience working on petabyte-scale data projects. As part of Zendesk’s core data team, he’s currently leading multiple projects related to data quality and observability. Prior to Zendesk, Mahdi worked on building data platforms at FactSet, Crédit Agricole CIB, and Numberly.

Table of Contents

Preface

Part 1 – Getting Started with Grafana

1

Introducing Data Visualization with Grafana

Technical requirements

Appreciating data and visualization

Storing, retrieving, and visualizing data

Why Grafana?

Exploration

Analysis

Presentation

Observability

Choosing Grafana

Installing Grafana

Grafana in a Docker container

Make and Makefile

Grafana for macOS

Grafana for Linux

Grafana for Windows

Grafana Cloud

Connecting to the Grafana server

Summary

Further reading

2

Touring the Grafana Interface

Technical requirements

Exploring Grafana—the Home dashboard

Introducing the Grafana search bar

Grafana logo

Organization menu

Search box

+ (add) menu

Help

Grafana blog

User menu

Expanding Grafana’s main menu

Home

Starred

Dashboards

Explore

Alerting

Connections

Administration

Exploring the Grafana dashboard UI

Grafana dashboard title bar

Dashboard content

Summary

3

Diving into Grafana's Time Series Visualization

Touring the Grafana panel UI

Creating a simple data source

Creating a graph panel

Generating data series in the Query tab

What is a query?

Query tab features

Duplicating an existing query

Transform

Editing the panel settings

Selecting panel visualizations

The Panel options section

The Tooltip section

The Legend section

The Axis section

The Graph styles section

The Standard options section

The Data links section

The Value mappings section

The Thresholds section

Monitoring with the Alert tab

Further exploration

Summary

Part 2 – Real-World Grafana

4

Connecting Grafana to a Prometheus Data Source

Technical requirements

Installing the Prometheus server

Installing Prometheus from Docker

Configuring the Prometheus data source

Exploring Prometheus

Using Explore for investigation

Configuring Grafana metrics

Querying the Prometheus data source

Typing in a metrics query

Querying for process metrics

Querying for memory metrics

Detecting trends with aggregations

Applying aggregations to our query data

Understanding the data source limitations

Querying limits for series aggregations

Querying limits for time aggregations

Exploring data source dashboards

Summary

5

Extracting and Visualizing Data with InfluxDB and Grafana

Technical requirements

Making advanced queries

Launching server Docker containers

Writing the ETL script

Running the script

Setting up an InfluxDB database

Configuring the InfluxDB data source

Understanding the time series data visualization

Displaying time-aggregated data

Debugging queries with Query inspector

Observing time interval effects

Setting the minimum interval

Setting the axis

Setting axis units

Converting temperature into Fahrenheit

Autoscaling the Y axis

Dual y axis display

Working with legends

Setting legend contents

Enabling legend aggregations

Summary

6

Shaping Data with Grafana Transformations

About Grafana DataFrames and transformations

Exploring the various transformation functions

Installing the TestData data source

Selecting transformations

Adding fields

Modifying fields

Filtering results

Reducing rows

Combining tables

Expanding analysis with a transformation

Chaining transformations into a visualization pipeline

Limitations of transformations

Summary

7

Surveying Key Grafana Visualizations

Technical requirements

Launching server Docker containers

Setting up the InfluxDB database

Initializing the InfluxDB server

Generating an API token

Configuring the InfluxDB data source

Building the Python Docker container

Loading the data

Reviewing the table visualization

Comparing aggregations

Overriding field settings

Setting a display name

Introducing the stat visualization

Creating a stat visualization panel

Setting stat styles

Defining value mappings in a stat visualization

Adding visual interest with a gauge

Exploring the gauge options

Setting the threshold values and colors

Going linear with a bar gauge

Exploring the bar gauge settings

Building a bar gauge

Summary

8

Surveying Additional Grafana Visualizations

Technical requirements

Launching server Docker containers

Setting up the InfluxDB database

Initializing the InfluxDB server

Generating an API token

Configuring the InfluxDB data source

Building the Python Docker container

Exploring spatial data with the Geomap visualization

Ingesting a new earthquake dataset

Mapping earthquake data with the Geomap visualization

Displaying category data with a bar chart visualization

Understanding histograms

Producing histograms with transformations

Displaying histogram data with the bar chart visualization

Visualizing histogram data over time with the heatmap

Summary

9

Creating Insightful Dashboards

Technical requirements

Launching server Docker containers

Setting up the InfluxDB database

Designing a dashboard

Conveying information

Determining the visual context

Prioritizing elements of importance

Creating a high information-density dashboard

Ingesting the weather data

Designing the dashboard

Adding the first row

Adding the second row

Adding the third row

Adding the fourth row

Adding the fifth row

Creating a high-information visibility dashboard

Designing the dashboard

Ingesting the earthquake data

Adding the first row

Adding the second row

Adding the third row

Parting thoughts

Considering layout

Automating ingestion

Summary

10

Working with Advanced Dashboard Features and Elasticsearch

Technical requirements

Building the data server

Connecting Grafana to Elasticsearch

Querying with Elasticsearch

Creating a template variable

Adding template variables to the graph panel

Templating additional variables

Creating ad hoc filters

Repeating rows and panels with template variables

Creating a new dashboard

Setting up the template variables

Configuring the panels

Linking dashboards

Adding dashboard tags

Locking down a template variable

Creating dashboard links

Annotating dashboards

Annotating the graph panel

Querying tagged annotations

Creating Elasticsearch annotation queries

Sharing dashboards

Sharing dashboard links

Sharing dashboards by exporting

Sharing dashboard snapshots

Summary

11

Streaming Real-Time IoT Data from Telegraf Agent to Grafana Live

Technical requirements

Streaming real-time data from Telegraf to Grafana

Setting up Grafana for streaming

Installing the Telegraf agent

Configuring the Telegraf agent

Running Telegraf

Streaming IoT data with MQTT and Mosquitto

Describing the pipeline architecture

Configuring the Telegraf MQTT consumer

Installing the Mosquitto broker

Generating messages to an IoT data pipeline

Examining the simulated metrics data

Reviewing the mqtt_pub.py script

Running the mqtt_pub.py script

Exploring the IoT data

Summary

12

Monitoring Data Streams with Grafana Alerts

Technical requirements

Monitoring and observability

Monitoring processes

Monitoring system resources

Monitoring applications

Capturing metrics for alerting

Alerting in Grafana

Alert rules

Labels

Notification policies

Contact points

Defining alert rules

What condition…

What metrics…

How long…

Monitoring systems

Monitoring applications

Alert messaging to contact points

Configuring an email contact point

Configuring a PagerDuty contact point

Configuring a Slack contact point

Routing alerts with notification policies

Specific routing

Mute timings

On your own

Summary

13

Exploring Log Data with Grafana’s Loki

Technical requirements

Loading system logs into Loki

Networking our services

Installing Promtail

Installing Loki

Launching Grafana

Creating a Loki data source

Visualizing Loki log data with Explore

Simulating logs with flog

Configuring promtail

Promtail in Docker Compose

Alternative Docker log capture

Querying logs and metrics with Explore

Summary

Part 3 – Managing Grafana

14

Organizing Dashboards and Folders

Managing dashboards and folders

Naming a dashboard

Dashboard naming tips

Working with dashboard folders

Tips to manage dashboard folders

Starring and tagging dashboards

Marking dashboards as favorites

Tagging dashboards

Building and running dashboard playlists

Creating a playlist

Displaying a playlist

Displaying playlists in normal mode

Displaying playlists in TV mode

Displaying playlists in Kiosk mode

Displaying playlists with auto fit panels

Editing a playlist

Exploring the Dashboard list panel

Setting Dashboard list panel options

Duplicating dashboards

Internal dashboard duplications

External dashboard duplications

Summary

15

Managing Permissions for Users, Teams, and Organizations

Understanding key permission concepts

Organizations

Users

Roles

Teams

Adding users

Adding users – by invitation only

Adding users – a self-service model

Setting permissions

Setting organization roles

Setting folder permissions

Setting dashboard permissions

Establishing teams

Setting up a team

Permission rules

Administering users and organizations

Managing users

Organization admin and Super Admin roles

Managing organizations

Summary

16

Authenticating Grafana Logins Using LDAP or OAuth 2 Providers

Authenticating with OpenLDAP

Setting up an OpenLDAP server

Configuring Grafana to use LDAP

Securing the bind password

Testing the Grafana configuration

Adding a user to OpenLDAP

Looking up a user in Grafana

Authenticating with OAuth 2

GitHub OAuth 2 authentication

Google OAuth 2 authentication

Authenticating with Okta

Summary

17

Cloud Monitoring AWS, Azure, and GCP

Configuring an AWS CloudWatch data source

Creating the policy

Creating the user

Configuring a new Grafana connection for AWS CloudWatch

Configuring a Microsoft Azure Monitor data source

Registering the Grafana application

Setting the application role

Generating application secrets

Configuring a new Grafana connection for Azure Monitor

Configuring Azure Log Analytics

Configuring a GCM data source

Enabling a Google Cloud API

Creating a Google service account

Configuring a new Grafana connection for GCM

Summary

Index

Other Books You May Enjoy

Preface

Grafana is an open source analytical platform used for analyzing and monitoring time-series data. This second edition will help you to get up to speed with Grafana 10’s latest features for querying, visualizing, and exploring logs and metrics no matter where they are stored. Along the way, we’ll introduce key concepts and best practices in software development, data visualization, and application administration.

The book begins by showing you how to quickly install and set up a Grafana server using Docker. You’ll become familiar with important components of the Grafana interface and learn how to analyze and visualize data from sources including InfluxDB, Telegraf, Prometheus, Logstash, and Elasticsearch.

We will cover many of Grafana’s key panel visualizations, including Time Series, Stat, Table, Bar Gauge, and Text. You’ll use Python to pipeline data, transformations to facilitate analytics, and templates to build dynamic dashboards. You’ll explore real-time data streaming with Telegraf, Promtail, and Loki, as well as observability features such as alerting rules, PagerDuty, and Slack integrations.

As you progress, the book will delve into the administrative aspects of Grafana, from configuring users and organizations to implementing user authentication with Okta and LDAP, organizing dashboards into folders, and more.

By the end of this book, you’ll have gained the knowledge you need to extract, transform, and load data; connect Grafana to time-series databases; build interactive dashboards; and leverage ad hoc data exploration for observability. Whether you are interested in visualization for data science or observability for your operations, this book will provide the launch pad for anyone looking to become proficient using a data visualization and observability application such as Grafana.

Who this book is for

This book is for business intelligence developers, business analysts, data analysts, and anyone interested in performing time-series data analysis and monitoring using Grafana. Those looking to create and share interactive dashboards or looking to get up to speed with the latest features of Grafana will also find this book useful. Although no prior knowledge of Grafana is required, basic knowledge of data visualization and some Python programming experience will help you understand the concepts covered in the book.

What this book covers

Chapter 1, Introducing Data Visualization with Grafana, provides a brief introduction to the use of data visualization in general and specifically in Grafana. We will then move on to installing a Grafana server onto your machine, using either a native installer or a Docker container. Launching the server and connecting to it with a web browser will also be covered.

Chapter 2, Touring the Grafana Interface, will explore the workings of the major UI components after you have launched and connected to the Grafana web application. We will look at the search bar, side menu, and Home dashboard.

Chapter 3, Diving into Grafana's Time Series Visualization, will dive into the Time series panel visualization for a closer look at how to work with the major components of the main Grafana visualization. After connecting to a test data source, we will also identify common panel components in preparation for working with other visualizations.

Chapter 4, Connecting Grafana to a Prometheus Data Source, will show you how to launch the Prometheus time-series database from a Docker container, load an actual time-series dataset, and query and visualize data in Grafana.

Chapter 5, Extracting and Visualizing Data with InfluxDB and Grafana, will show how to write a simple Python Extract, Transform, and Load (ETL) script to access data from a public data server and push it to InfluxDB. We’ll also connect Grafana to InfluxDB and try out some more advanced query techniques.

Chapter 6, Shaping Data with Grafana Transformations, will introduce the concept of the Grafana data frame, and how the different Grafana transformations can shape query data. We’ll also chain transformations into a more complex data pipeline.

Chapter 7, Surveying Key Grafana Visualizations, will see us use the Table, Stat, Bar Gauge, and Gauge panel visualizations to display our weather data.

Chapter 8, Surveying Additional Grafana Visualizations, will see us modify the Python ETL script to download earthquake data. We’ll visualize the data using Geomap, Bar chart, Histogram, and Heatmap visualizations.

Chapter 9, Creating Insightful Dashboards, uses what we’ll have learned about Grafana panel visualizations and some basic information design principles to create production dashboards for visualizing weather and earthquake data.

Chapter 10, Working with Advanced Dashboard Features and Elasticsearch, explores the powerful advanced features of the dashboard, including annotations, templating with variables, and dashboard linking, as well as techniques for sharing dashboards. We’ll pull down public data from the city of San Francisco and use Logstash and Elasticsearch as the data source.

Chapter 11, Streaming Real-Time IoT Data from Telegraf Agent to Grafana Live, will present the first in a trilogy of chapters on observability by introducing the concept of real-time data streaming. We’ll build a data pipeline to stream data from an Internet of Things (IoT) simulator using standard MQTT protocols and then use InfluxDB to send the messages to Grafana Explore.

Chapter 12, Monitoring Data Streams with Grafana Alerts, will show you how to take streaming data, monitor it for anomalies with alerting rules, and connect those alerts to a set of notification channels, including email, PagerDuty, and Slack.

Chapter 13,Exploring Log Data with Grafana’s Loki, will complete the observability trilogy by showing how to capture observability metrics and logs with the combination of Promtail and Loki. We’ll perform an ad hoc analysis with Explore to check for correlations between metrics patterns and logging events.

Chapter 14, Organizing Dashboards and Folders, will show you how to label dashboards and organize them into folders to make them easier to find. We’ll also look at other dashboard features, such as starred dashboards, dashboard playlists, and the Dashboard listpanel visualization.

Chapter 15, Managing Permissions for Users, Teams, and Organizations, will show you how to manage users, teams, and organizations, including access control and user addition and deletion.

Chapter 16, Authenticating Grafana Logins Using LDAP or OAuth 2 Providers, will show you how managers can connect Grafana user authentication to a variety of services. We’ll authenticate using an internal LDAP server and use OAuth 2 to authenticate using external services from GitHub, Google, and Okta.

Chapter 17, Cloud Monitoring AWS, Azure, and GCP, will show how Grafana can provide monitoring support for a variety of services provided by major cloud platforms, such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP).

To get the most out of this book

In order to complete the majority of the exercises in this book, you will need to download and install Docker along with Docker Compose. For the examples in the book, we will be downloading and installing other software and datasets, including Grafana and Loki, so you will occasionally need an internet connection. You can download and install each software package independently, but our tutorial instructions are designed to work with Docker. We do that so that all software dependencies and network management can be encapsulated within the Docker container paradigm.

We will run a fair amount of software from the command line, so you should be comfortable with typing commands into a shell, such as Bash or Windows PowerShell. To access the contents of the book’s GitHub repository, you will either need Git or an unzip application.

Having an interest in science in general and data science, in particular, will go a long way toward making this book interesting and useful. It would also be helpful to have some programming experience with a scripting language such as Python, but since all the code is included, you can run it directly from a clone of the book’s GitHub repository. Some familiarity with relational databases will help you understand some of the terminology and concepts behind time-series databases.

Software/hardware covered in the book

Operating system requirements

Grafana

Windows, macOS, or Linux

Docker

Windows, macOS, or Linux

Loki/Promtail

Windows, macOS, or Linux

Prometheus

Windows, macOS, or Linux

InfluxDB/Telegraf

Windows, macOS, or Linux

Elasticsearch/Logstash

Windows, macOS, or Linux

OpenLDAP

Windows, macOS, or Linux

Python 3.7+

Windows, macOS, or Linux

Grafana is an application under constant development and revision, and as such, the depictions, descriptions, and illustrations in this book represent a snapshot in time and are current at the time of writing. By the time you read this book, features may have been added, altered, or deleted outside of our control. However, we believe any deviations from the book should be easily accommodated with only minor adjustments.

It might also be helpful to use an IDE application such as Microsoft Visual Studio Code, or JetBrains PyCharm.

In order to follow along with the exercises in Chapter 16, Authenticating Grafana Logins Using LDAP or OAuth 2 Providers, you will need accounts with GitHub, Google, and Okta. To follow the exercises in Chapter 17, Cloud Monitoring AWS, Azure, and GCP, you will need to create an account with AWS, GCP, and Microsoft Azure.

The examples and software in this book have not been validated for security reasons. They require an external internet connection and leverage open source software under a variety of licenses, so if you intend to use any of this software within a security-conscious computing environment (such as in an education or corporate environment), it is highly recommended that you consult your local IT professionals in advance.

I hope to show with the examples in this book how easy it is to build simple data visualization pipelines with Grafana and today’s open source tools. I also hope this book will inspire and empower you to seek out your own datasets to acquire, analyze, and visualize. Best of luck!

If you are using the digital version of this book, we advise you to type the code in yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code. Each chapter folder includes dashboards, docker-compose.yml files, and a Makefile to help out when running some of the command-line tools.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Learn-Grafana-10. Any update to the code will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”

A block of code is set as follows:

FROM python:3 SELECT mean("value") FROM "temperature" WHERE $timeFilter GROUP BY time($__interval), "station" fill(none)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

listener 1883allow_anonymous true

Any command-line input or output is written as follows:

% docker-compose down

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Click on Load Data | API Tokens.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Learn Grafana 10.x, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/9781803231082

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

Part 1 – Getting Started with Grafana

In this section, you will gain a broad understanding of how to quickly set up a Grafana application server and use it to visualize data. You will also learn about Grafana’s basic features such as the search bar, main menu, panel visualizations, and dashboards. Further, you will also take a deep dive into how to query data sources and graph the results with Time series panel visualizations.

This part comprises the following chapters:

Chapter 1, Introducing Data Visualization with GrafanaChapter 2, Touring the Grafana InterfaceChapter 3, Diving into Grafana's Time Series Visualization

1

Introducing Data Visualization with Grafana

Welcome to Learn Grafana 10.x! Together, we will explore Grafana, an exciting, multi-faceted visualization tool for data exploration, analysis, and alerting. We will learn how to install Grafana, become familiar with some of its many features, and even use it to investigate publicly available real-world datasets.

Whether you are an engineer watching terabytes of metrics for a critical system fault, an administrator sifting through a haystack of log output looking for the needle of an application error, or just a curious citizen eager to know how your city works, Grafana can help you monitor, explore, and analyze data. The key to getting a handle on big data is the ability to visualize it.

But before we find out how Grafana gives you that ability, we’ll need to cover a few basic concepts behind data visualization. Following that, we’ll set up our own instance of Grafana, which will form the fundamental building block for the exercises that follow in later chapters.

The following topics will be covered in this chapter:

Appreciating data and visualization – we’ll take a brief overview of the data landscape and how visualization is usefulWhy Grafana? We’ll look at what makes Grafana an attractive solutionInstalling Grafana – we’ll install the Grafana application server and get it runningConnecting to the Grafana server – we’ll launch the Grafana application by connecting to the installed server from a web browser

Tutorial code, dashboards, and other helpful files for this chapter can be found in the book’s GitHub repository at https://github.com/PacktPublishing/Learn-Grafana-10/tree/main/Chapter01.

Technical requirements

Grafana is relatively easy to set up, but since it is a web server application, you will need to execute a few shell commands to get it running. For the purposes of this book, we will assume that you will access Grafana from the same computer that you installed it on. The following are the technical requirements for installing and running Grafana:

Familiarity with the command shellA terminal application or an SSH to the machine where you plan to install GrafanaDocker (in order to run Grafana from a Docker container)

Optionally, you will need to have the following:

Administrator access to install and run Grafana from the command line, rather than in a Docker container

Appreciating data and visualization

In the not-too-distant past, most of us consumed data pretty much solely via a daily newspaper—the financial pages, the sports section, and the weather forecast. However, in recent years, the ubiquity of computing power has immersed every part of our lives in a sea of data.

Around the clock, our built environment and devices collect innumerable amounts of data, which we consume. Our morning routine starts with a review of emails, social media posts, and news feeds on a smartphone or tablet, and whereas we once put down the daily newspaper when we left for work, our phones come with us everywhere.

We walk around or exercise and our phones capture our activity and location data via the global positioning system (GPS), while our smartwatches capture our vital signs. When we browse the web, every single interaction down to a mouse click is logged and stored for analysis. The servers that deliver these experiences are monitored and maintained by engineers on a round-the-clock basis. Marketers and salesforces continually analyze this data in order to make business-critical decisions.

On the way to work, our cars, buses, and trains contain increasingly sophisticated computers that silently log tens of thousands of real-time metrics, using them to calculate efficiency, profitability, engine performance, and environmental impact. Technicians evaluating these physical systems’ health or troubleshooting problems often sift through an enormous stream of data to tease out the signs of a faulty sensor or a failed part. The importance of this data is globally recognized. This is precisely why data recorders are the most valuable forensic artifact after any transportation accident, and why their recovery generates such widespread media coverage.

Meanwhile, in the modern home, a smart thermostat dutifully logs the settings on a Heating, Ventilation, and Air Conditioning (HVAC) system, as well as the current temperature both inside and outside the house. These devices continually gather real-time weather information in order to make decisions about how and when to run most efficiently.

Similar to the systems at home, but on a much larger scale, nearly every building we pass through during the day collects and monitors the health of a number of key infrastructure systems, from air conditioning to plumbing to security. No amount of paper could possibly record the thousands of channels of data flowing through these physical plants, and yet the building management system aggregates this data to make the same kinds of simple decisions as the homeowner does.

Moreover, these examples represent only a drop in the ocean of data. Around the world, governments, scientists, NGOs, and everyday citizens collect, store, and analyze their own datasets. They are all confronted with the same issue: how to aggregate, collate, or distill the mass of data into a form that a human can perceive and act on in a few seconds or less. The response to this issue is effective data storage and visualization.

Storing, retrieving, and visualizing data

For years, the basic language of data visualization was well-defined: using a chart, graph, histogram, and so on. What was missing was the ability to rapidly create these charts and graphs not in hours or days but in seconds or even milliseconds. This requires processing power that draws representations of thousands and thousands of data points in the time it takes to refresh a computer display.

For decades, only the most powerful computers could manage the processing power required to visualize data on this scale, and the software they ran was specialized and expensive. However, a number of trends in computing have converged to produce a renaissance in data acquisition and visualization, making it accessible not only to domain practitioners but also to technically proficient members of the general public. They are as follows:

Cheap general-purpose CPUs and graphics GPUsInexpensive high-capacity storage, optimized for physical size and maximum throughputWeb standards and technologies, including JavaScript and CSSOpen source software frameworks and toolkitsScalable cloud computation at affordable pricesBroadband networking to enterprises, homes, and mobile devices

A common feature of virtually all of this data, that is, for each sample from a sensor or line in a log file, is the snapshot from an invisible ticking clock: a timestamp. A dataset gathered from these data points across a period of time is referred to as a time series. A stored object containing one or more time series is a time-series dataset. An application that can provide optimized access to one or more of these datasets is called, naturally, a time-series database (TSDB). While a whole class of NoSQL time-series databases, such as InfluxDB, OpenTSDB, and Prometheus, have sprung up, venerable SQL relational databases, such as PostgreSQL and MySQL, have added their own support for time-series datasets.

That’s fine for storing and retrieving data, but what about visualizing data? Enter Grafana.

Why Grafana?

While there are many solutions in the data visualization space, Grafana is proving to be one of the most exciting, exhibiting rapid growth in scope and features, broad options for deployment and support, and an enthusiastic community contributing to its future growth. Before going into the specific features that make Grafana an attractive solution, let’s take a look at the criteria we might use to characterize a useful data visualization application:

Figure 1.1 – Grafana UI

For the purposes of this book, we will be looking at particular software applications that fulfill four major functions: exploration, analysis, presentation, and observability.

Exploration

Quickly loading and displaying a dataset with the idea of identifying the particularly interesting features for deeper analysis, sometimes referred to as drilling down, is an example of data exploration.

Another common term for data exploration is ad hoc analysis. This refers to the nature of using data visualization techniques without a pre-defined analysis in place. Ad hoc analysis is useful for getting a feel for the data’s characteristics, and whether any interesting patterns are discernable.

Figure 1.2 – Grafana exploration

In this book, we’ll be frequently using the Explore feature of Grafana to perform just this sort of data exploration.

Analysis

After we have examined our data, we may well want to analyze it. That is, we may want to quantify the data statistically or correlate it with other data. For example, we may want to see what the maximum value or average value is, or otherwise aggregate the data for a specific time range. We may also want to look at multiple datasets over the same time period to look for events that might be time-correlated.

Figure 1.3 – Grafana analysis

Grafana contains several analysis features that we highlight throughout the book. We will also leverage Grafana’s powerful transformation features to aid us in our analysis.

Presentation

Once we have identified the data we are interested in, we will want to present it in an aesthetically pleasing manner that also gives the viewer clarity about what the data represents, in effect helping to tell a story about the data, which would be otherwise difficult to do without specific domain knowledge.

Figure 1.4 – Grafana presentation

Assembling panels into dashboards is a common Grafana workflow for presentation, and we will spend much of our time in this book covering not only how to construct dashboards to tell the story of our data, but also how to structure our data visualizations to be both clear and meaningful.

Observability

Finally, we may need to observe the data over time, or even in real time as it may represent critical data. If the data crosses into a realm of concern, we may need to be notified immediately.

Grafana has extensive and powerful observability features, along with integrations for popular notification services such as PagerDuty. In this book, we’ll learn how to build alerts to detect anomalies in our data, and how to craft appropriate notifications depending upon the severity of the alert.

Choosing Grafana

While there are quite a few powerful data analytics tools on the market that fulfill these functions, Grafana has a number of features that make it an attractive choice:

Fast: The Grafana backend is written in Google’s exciting Go language, making it extremely performant when querying data sources or feeding thousands of data points to multiple dashboard panels.Open: Grafana supports a plugin model for its dashboard panels and data sources. The number of plugins is constantly growing as the Grafana community enthusiastically contributes to the project.Beautiful: Grafana leverages the attractive and powerful D3 library. Many of the popular dashboard tools, such as Datadog and Zabbix, can quickly generate beautiful graphs from thousands of data channels, but they only offer some limited control over the display elements. Grafana provides fine-grained control over most graph elements including axes, lines, points, fills, annotations, and legends. It even offers the much sought-after dark mode.Versatile: Grafana is not tied to a particular database technology. For example, Kibana is a powerful, well-known member of Elasticsearch’s Elasticsearch, Logstash, and Kibana (ELK) stack; it is only capable of visualizing Elasticsearch data sources. This gives it the advantage over Grafana of a better ability to integrate Elasticsearch’s analysis tools in its graphing panels. However, due to its plugin architecture, Grafana can support a variety of ever-growing data sources (at last count in 2022, over 150), from traditional RDBMs, such as MySQL and PostgresQL, to modern TSDBs, such as InfluxDB and Prometheus. Not only can each graph display data from a variety of data sources, but a single graph can also combine data from multiple data sources.Free: While they are very powerful tools indeed, Datadog and Splunk are commercial packages and, as such, charge fees to manage all but the smallest datasets. If you want to get your feet wet, Grafana is freely available under the Apache open source license, and if you do plan to run it in your enterprise, you can purchase tiered support.

These are just some of the criteria you might use to evaluate Grafana against similar products. Your mileage may vary, but now is a great time to be in the market for visualization tools. Grafana and its competitors each have their own strengths and weaknesses, but they are all very capable applications. Here’s a short list of the few we covered:

Kibana (https://www.elastic.co/)Splunk (www.splunk.com)Datadog (https://www.datadoghq.com/)Zabbix (https://www.zabbix.com/)

With this in mind, let’s install Grafana.

Installing Grafana

At its core, Grafana runs as a web server, and as such, it is not a typical double-click application. You will need to be comfortable with the command line and have administrator privileges on the computer you plan to install Grafana on. To download the latest versions of Grafana, check out https://grafana.com/grafana/download.

The Grafana application server runs on *nix operating systems (Linux, OS X, and Windows), and it can be installed locally on a laptop or workstation or on a remote server. It is even available as a hosted application if you’d rather not deal with setting up or managing a server application on your own.

In this section, we’ll walk through the most typical installation options:

DockerOS XLinuxWindowsHosted Grafana in the cloud

Once you’ve completed the installation of your choice, proceed to the Connecting to the Grafana server section for instructions on how to access Grafana from a web browser.

Grafana in a Docker container

The easiest and least complex installation method is to run Grafana from within a Docker container. Docker is available for all major platforms and can be downloaded by visiting https://www.docker.com/.

After installing Docker, open a terminal window and type in the following command:

% docker run -d --name=grafana -p 3000:3000 grafana/grafana

The percent (%) symbol is simply there to indicate we are typing in commands to an interactive shell such as zsh or Windows PowerShell. If you are cutting and pasting from the book, you’ll want to leave out that symbol.

Docker will automatically download and run the latest version of Grafana for your computer’s architecture. Bear in mind that since this basic container has no persistent storage, nothing will be retained if you delete the container. I suggest you run the container with a temporary volume so that Grafana’s internal database will continue to exist, even if you destroy the container:

% docker volume create grafana-storage % docker run -d --name=grafana -p 3000:3000  \     -v grafana-storage:/var/lib/grafana \     grafana/grafana

Note

The book and its tutorial examples were written for the macOS operating system, a POSIX-compliant OS that shares many similarities to Linux, including the shell. However, with a few syntax modifications here and there, Windows users should be able to use these same commands in PowerShell.

For example, in the preceding command, you’ll want to use the backtick (`) in PowerShell for line continuation, rather than the backslash (\).

I will proceed with Docker and its companion product Docker Compose for the purposes of this book as it will allow an almost turnkey installation experience, as all the necessary dependencies will be automatically downloaded with the container. It will also install in its own sandbox, so you don’t need to worry about installing a stack of software that will be difficult to delete later. Finally, in future chapters, we will be setting up data sources using similar Docker containers, so managing the data pipeline as a combination of containers will be very consistent and straightforward.

Make and Makefile

In the book’s GitHub repository, you’ll find a Makefile in each chapter directory. You can use it to streamline some of the common Docker commands. If you’re not familiar with the make command or it isn’t installed on your computer, you can still cut and paste many of the commands embedded in the Makefile.

While space doesn’t permit a comprehensive introduction to the concepts that underlie make, here is a quick example of how to use it in concert with this book. The following is from the Makefile in the Chapter02 directory of the book’s GitHub repository:

up:     docker-compose up -d --pull missing

On the first line, the word up before the colon (:) is referred to as the target. Anything following that colon is a dependency; there are no dependencies associated with the target. The second line is the command; there must be at least one command. For decades, the venerable make command and associated Makefile have been the backbone for building software, often with hundreds of complex dependencies. Nonetheless, for our use of make, we’ll use it mostly as a notepad of shortcut commands. To use it, you simply run a make command from the shell:

% make <target>

make will first run any targets named in the list of dependencies, followed by the command(s) associated with the target. Run the following:

% make up

You are using make to run this equivalent command:

% docker-compose up -d --pull missing

There is no requirement to use make for this book; all the commands you need are in the text.

Grafana for macOS

There are two options for installing and running Grafana for macOS:

HomebrewCommand line binary install

Using Homebrew is the simplest option as it wraps all the installation chores in a single command. To get Homebrew, visit https://brew.sh/. If you want more control over where to install Grafana, the command line option is a better choice.

Homebrew

Homebrew does not ship as part of macOS, but you can easily install it:

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

To install Grafana via Homebrew, run the following commands:

% brew update % brew install grafana

If you want to keep Grafana running even after a reboot, use the Homebrew services subcommand to launch the installed Grafana application as a service. You will first need to confirm services installation:

% brew tap homebrew/services % brew services start grafana

Command line binary install

To install via the command line, open a Terminal shell window and download the macOS distribution tarball, then untar it into the directory of your choice (replace ${GRAFANA_VERSION} with the current version):

% wget https://dl.grafana.com/oss/release/grafana-${GRAFANA_VERSION}.darwin-amd64.tar.gz % tar -zxvf grafana-$GRAFANA_VERSION.darwin-amd64.tar.gz

Once you’ve untarred the file, cd into the directory and launch the binary by executing this command:

% ./bin/grafana-server web

Grafana for Linux

While Linux comes in a number of flavors, each falls into one of two installation systems: yum for Red Hat-based releases or apt for Debian or Ubuntu releases. Typically, you download the binary and then run the installer on the package file. To get the latest Grafana binaries for Linux, visit https://grafana.com/grafana/download?platform=linux.

Yum installation (Red Hat, Fedora, CentOS)

The installer for Red Hat distributions (CentOS, Fedora, and Red Hat) is yum. To download and install it (replace ${GRAFANA_VERSION} with the current version), use the following:

% wget https://dl.grafana.com/oss/release/grafana-%{GRAFANA_VERSION}.x86_64.rpm % sudo yum install grafana-${GRAFANA_VERSION}.x86_64.rpm

To start up Grafana, use systemctl:

% systemctl daemon-reload % systemctl start grafana-server % systemctl status grafana-server

To keep Grafana running even after a reboot, use the following:

% sudo systemctl enable grafana-server.service

Apt installation (Debian, Ubuntu)

The installer for the Debian distributions (Debian and Ubuntu) is dpkg. To download and install it (replace ${GRAFANA_VERSION} with the current version), use the following:

% sudo apt-get install -y adduser libfontconfig1 % wget https://dl.grafana.com/oss/release/grafana_${GRAFANA_VERSION}_amd64.deb % sudo dpkg -i grafana_${GRAFANA_VERSION}_amd64.deb

To start up Grafana, use the following:

% systemctl daemon-reload % systemctl start grafana-server % systemctl status grafana-server

To keep Grafana running even after a reboot, use the following:

% sudo systemctl enable grafana-server.service

Grafana for Windows

Installation for Windowsis straightforward:

Go to https://grafana.com/grafana/download?platform=windows.Download the latest MSI installer file from the download link.Launch the .msi file to install.

Grafana Cloud

If you would rather not install Grafana on your computer, or you don’t have access to a computer that can run Grafana, there is another option—Grafana will host a free instance for you. Free Grafana Cloud hosting provides very generous limits on the number of users, metrics, logs, and traces. To sign up for the hosted version, go to https://grafana.com/get/ and select Cloud.

Now that you have installed and started up Grafana, let’s have a look at the interface. Grafana is a web application, so we’ll connect to it with an ordinary web browser such as Chrome, Safari, or Edge.

Connecting to the Grafana server

Once you have installed and launched Grafana, open a browser page to access the Grafana application. It can be found at http://localhost:3000. If everything goes well, you should see a login page, as follows:

Figure 1.5 – Grafana login

Log in with the admin username with the password admin. You will then be prompted to change it to something more secure (which you can skip if you wish). Once you have logged in, you should see the base Grafana interface:

Figure 1.6 – Grafana home page

Great job! You’ve successfully installed and connected the Grafana application.

Summary

Congratulations! Over the course of this chapter, we learned about data visualization and why Grafana is a powerful tool for data visualization. We also downloaded and installed Grafana. Finally, we launched the Grafana application from our browser, setting us on a learning path for future chapters.

In our next chapter, we’ll take a tour of the Grafana interface and familiarize ourselves with its basic features. This will serve as a foundation for upcoming tutorial exercises. I’m looking forward to our shared journey!

Further reading

The official Grafana documentation can be found on their website at https://grafana.com/docs/.

2

Touring the Grafana Interface

By this point, you’ve successfully installed and run Grafana, so next, we’re going to familiarize ourselves with the Grafana user interface (UI). In this chapter, we will take a general tour of the default Home dashboard, mostly concentrating on the sidebar menu. While you will spend the majority of your time interacting directly with dashboards and panels, you will find that the sidebar is a helpful navigation hub, providing both quick access to simple creation pages and links to more complex functions, including data source creation, Explore, alert management, and server administration.

Note

This chapter is intended to provide a (mostly) high-level tour of these major features. We will go into more detail about many of these features later in the book. I’ll point out which chapters correspond to the topics covered. If you’re already somewhat familiar with Grafana, this chapter should serve as a quick review and a point of reference.

Specifically, we’ll cover the following topics in this chapter:

Exploring the main Grafana UI componentsIntroducing the Grafana search barIdentifying the UI components of the Home dashboard, including the title barDiving into the Grafana main menu items and sub-items

Technical requirements

Tutorial code, dashboards, and other helpful files for this chapter can be found in the book’s GitHub repository at https://github.com/PacktPublishing/Learn-Grafana-10/tree/main/Chapter02.

Exploring Grafana—the Home dashboard

After logging into the Grafana application, you should end up on the Home dashboard, as shown in the following figure. Here, I’ve annotated some of the key UI elements in the Grafana interface:

Figure 2.1 – The Home dashboard

The following are key UI elements located on the Home dashboard:

The Grafana logo button: This returns the user to the Home dashboard.Organization menu: This allows you to switch organizations.Search or jump to…: This searches for or jumps to various actions, pages, or preferences.Dashboard menu: This adds or imports dashboards and creates alert rules.Help menu: This links to documentation, support, and community pages.Grafana News: This opens the latest Grafana blog posts.User menu: This links to the user profile and preference settings or signs the user out.Menu toggle: This opens the main menu.Add menu: This adds panel visualizations, adds rows, or imports panels from the library.Dashboard settings: This opens the settings for the current dashboard.Top search bar toggle: This hides or reveals the search bar.Dashboards panel: This is a dashboard panel containing favorite and recently viewed dashboards.

Grafana is structured around three main interactive UI components that together constitute its core functionality: dashboards, panels, and rows. The page in the preceding screenshot is really just another dashboard—specifically, the Home dashboard. A dashboard acts as a canvas upon which you can display one or more rows of panels in a grid-like arrangement. It also can serve, as in the case of the Home page, as a web page; you can bookmark it or share it with a simple URL. An entire dashboard can be imported and exported in JSON text file format, making it easy to share, save, or transfer to another version of Grafana.

The most useful and visible component of a dashboard is the panel. Panels implement a variety of visualizations, from generating graphs, organizing data into tables, and displaying useful text to simply containing a menu list of dashboards—which happens to be the kind of panel you see on the Home dashboard in the preceding screenshot. Panels are implemented via plugins in Grafana, so any capable developer can add to the variety of Grafana panels by creating new ones. An administrator can download and install interesting panels beyond those that ship with Grafana.

Note

While a panel is technically now a container for a visualization, historically, each type of panel was implemented as an independent code object. As of a few releases ago, the panels were re-engineered under a common architecture supporting multiple visualizations. For the end user, there is no real distinction between a panel and its visualization; thus, the terms can be used interchangeably.

In Chapter 3, Diving into Grafana's Time Series Visualization, we’ll be taking a much closer look at what might be considered the canonical Grafana panel visualization—the time series panel visualization. Right now, let’s take a tour of Grafana’s dashboard UI.

Introducing the Grafana search bar

There are two main UI components visible on the Home dashboard:

Search bar at the topDashboard below

Each dashboard UI is organized around two main components:

A dashboard title bar containing the main menuDashboard rows and panels

Let’s start by taking a look at the controls on our Home dashboard. Depending upon the nature of the dashboard, you may see additional controls, which we will highlight later. For now, let’s keep things simple by looking at the basic controls.

At the top of the interface is the search bar. This contains several navigational features. If you’re familiar with older versions of Grafana, you will know that they were located in a side menu.

The portion of the dashboard that contains panels is the entire space below the title bar (as seen in Figure 2.1). The title bar contains the main side menu on the left and a set of controls on the right. The controls enable you to add new panels, open the dashboard’s settings, and hide/reveal the upper search bar.

At the top of the Grafana UI is the search bar. The search bar contains a collection of controls that, in previous versions of Grafana, were located in other areas of the UI. These include the following:

The Home buttonThe Organization menuThe search boxThe Dashboard menuThe Help menuGrafana blogThe User menu

We’ll be covering many of these controls over the course of the book, so I won’t go into much detail about them just now.

Grafana logo

On the far left of the dashboard search bar is the Grafana logo icon. It serves as a home button for Grafana. Clicking on it will take you to the Home dashboard, which can be set in the preferences to be any specific dashboard.

Figure 2.2 – The Grafana logo

Organization menu

Next to the Home button is the Organization menu. Grafana can be configured with one or more organizations, each having its own users, alert rules, and dashboards. We’ll talk more about organizations in Chapter 15, Managing Permissions for Users, Teams, and Organizations.

Search box

At the center of the search bar is the search box, an interesting multi-function control. Typing text into the box will activate the search function, listing out any matching links. Clicking on the box without typing will bring up a menu of shortcuts to special actions, pages, and preferences, as shown in the following figure:

Figure 2.3 – The search box

+ (add) menu

Clustered on the right side of the search bar are several menu icons. The leftmost is the + (add) menu. Clicking on it allows you to create a new dashboard, import an existing dashboard, or create a new alert rule, the basic building block of Grafana observability. We’ll look at creating dashboards in Chapter 9, Creating Insightful Dashboards, and we’ll introduce alert rules in Chapter 12, Monitoring Data Streams with Grafana Alerts. Let’s take a brief look at the menu items.

Figure 2.4 – Search bar add menu

These three options are simply shortcuts to actions that are normally accessed via the Grafana menu. Let’s checkthem out.

New dashboard

The New dashboard selection in the + menu is a shortcut to the New | New Dashboard selection on the Dashboards page. It creates a new empty dashboard containing instructions on how to add content to it. We’ll look at the Dashboards page a little later on.

Import dashboard

The + | Import dashboard selection is a shortcut to the New | Import menu option on the Dashboards page. Here is where you can import a previously exported dashboard. We’ll talk about both the import and export of dashboards in later chapters.

Create alert rule

This option is a shortcut to the + Create alert rule button on the Alerting | Alert rules page. We will discuss alert rules in this chapter a little later in the section covering the Grafana menu.

Help

To the right of the divider bar is the Help menu button, as shown in the following figure:

Figure 2.5 – The Help menu

Let’s go over some of the more notable options.

Support bundles

Support bundles are packages of useful debugging information primarily used by Grafana support. If you happen to run into a difficult issue and you open a support case, you may be asked to submit a support bundle along with your ticket.

Clicking on + New support bundle will open the Create support bundle page with a number of options for deciding what will be included in the bundle. Every option (with the exception of Basic information) is optional and may be omitted if you have any concerns about sending sensitive information.

Clicking on Create will create a bundle and add it to the list of support bundles where it can then be downloaded and attached to your support ticket or deleted by clicking on the trashcan icon.

Documentation

Selecting the Documentation button launches a new web page in your browser and opens the Grafana documentation home page for the corresponding version of Grafana.

Community

The Community option launches the Grafana Labs Community Forums website. The forum allows you to meet a community of other Grafana users and to share feedback with Grafana Labs about your product concerns and requests.

Keyboard shortcuts

Selecting Keyboard shortcuts displays a pop-up window with a cheat sheet of keyboard shortcuts. The other three are links to Grafana community forums, technical support, and documentation.

Grafana blog

To the right of the Help menu is a button that activates a Grafana Blog popup.

User menu

Finally, on the far right-hand side of the search bar is the User menu.

Figure 2.6 – The User menu

The User menu links to the settings pages for the current user, where you have options such as Profile, Notification history, and Change password. We’ll take a look at these next.

Profile

The Profile page serves a handfulof functions.

Figure 2.7 – User preferences page

User profile settings on this page fall into the following four functional groups:

Profile: You can set or change Name, Email, and UsernamePreferences: You can set or change UI Theme, Home Dashboard, Timezone, and Week startOrganizations: You can change the organization by clicking Select OrganizationSessions: You can log out of the session by clicking on the red power button

Notably, going to Preferences | Home Dashboard allows you to reconfigure your Home dashboard to another one of your choosing.

Notification history

The Notification history tab shows all of your notifications, which are mostly errors you’ve received. You can clear them out by selecting the message you want to delete (you can click the box at the top to select all of them) and clicking the Dismiss notifications button.

Change password

You can change your password here. You’ll need to authenticate with your old password and then enter the new one twice for confirmation.

Sign out

Sign out logs you outof Grafana.

That wraps up our tour of the Grafana search bar. It’s a relatively new addition to the Grafana UI, so expect it to undergo some revision with each numbered release.

Expanding Grafana’s main menu

The Grafana menu has been somewhat restructured in Grafana 10 compared to previous versions. Some items have been moved to other parts of the interface while others have been renamed. Many of the main menu items have additional submenu items that can be revealed by clicking on the disclosure icon. The state of the Grafana menu is kept even when it is hidden. A complete explanation of each item will not be provided here, but rest assured that we will cover most of them in later chapters of this book!

At the top level are the following Grafana menu options:

HomeStarredDashboardsExploreAlertingConnectionsAdministration

The icons in this menu lead to some of the most common yet impressive features of Grafana. For example, from this menu you can do the following:

Return to the Home dashboardCreate and manage dashboards and foldersExplore data sources in an ad hoc fashionCreate and manage alert rules, contact points, and notification policiesConfigure data sourcesConfigure users, teams, and organizations, download and install plugins, and create service accounts

As we tour the Grafana menu options, we’ll also walk through some of the more significant submenu items. Space does not permit us to go through all of them in detail, but over the course of this book, we will revisit them with tutorial examples