Building IoT Visualizations using Grafana

Book description

The IoT developer's complete guide to building powerful dashboards, analyzing data, and integrating with other platforms

Key Features

  • Connect devices, store and manage data, and build powerful data visualizations
  • Integrate Grafana with other systems, such as Prometheus, OpenSearch, and LibreNMS
  • Learn about message brokers and data forwarders to send data from sensors and systems to different platforms

Book Description

Grafana is a powerful open source software that helps you to visualize and analyze data gathered from various sources. It allows you to share valuable information through unclouded dashboards, run analytics, and send notifications.

Building IoT Visualizations Using Grafana offers how-to procedures, useful resources, and advice that will help you to implement IoT solutions with confidence. You'll begin by installing and configuring Grafana according to your needs. Next, you'll acquire the skills needed to implement your own IoT system using communication brokers, databases, and metric management systems, as well as integrate everything with Grafana. You'll learn to collect data from IoT devices and store it in databases, as well as discover how to connect databases to Grafana, make queries, and build insightful dashboards. Finally, the book will help you implement analytics for visualizing data, performing automation, and delivering notifications.

By the end of this Grafana book, you'll be able to build insightful dashboards, perform analytics, and deliver notifications that apply to IoT and IT systems.

What you will learn

  • Install and configure Grafana in different types of environments
  • Enable communication between your IoT devices using different protocols
  • Build data sources by ingesting data from IoT devices
  • Gather data from Grafana using different types of data sources
  • Build actionable insights using plugins and analytics
  • Deliver notifications across several communication channels
  • Integrate Grafana with other platforms

Who this book is for

This book is for IoT developers who want to build powerful visualizations and analytics for their projects and products. Technicians from the embedded world looking to learn how to build systems and platforms using open source software will also benefit from this book. If you have an interest in technology, IoT, open source, and related subjects then this book is for you. Basic knowledge of administration tasks on Linux-based systems, IP networks and network services, protocols, ports, and related topics will help you make the most out of this book.

Table of contents

  1. Building IoT Visualizations Using Grafana
  2. Contributors
  3. About the author
  4. Rodrigo Juan Hernández is an electronic engineer who was passionate about IoT even before it existed. He has been working on tech for more than 18 years. He has worked for local government, and has been involved in a wide variety of projects and technologies, including IP networks, IP video surveillance, IT services, energy systems, and many others.
  5. About the reviewer
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the color images
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
  7. Part 1: Meeting Grafana
  8. Chapter 1: Getting Started with Grafana
    1. Technical requirements
      1. Managing data
      2. Performing visualizations
      3. Transformations, alerts, and annotations
    2. Installing Grafana on a Raspberry Pi
      1. Installation instructions
      2. Accessing Grafana for the first time
    3. Installing Grafana on Ubuntu Server
      1. Installation instructions
      2. Running Grafana on Ubuntu Server
    4. Installing Grafana with Docker
      1. Deploying Grafana with Docker CLI
    5. Initial configuration of Grafana
      1. Configuration files
      2. Environment variables
    6. Maybe you prefer the cloud option
    7. Summary
    8. Invitation to join us on Discord
  9. Chapter 2: Exploring Grafana
    1. Technical requirements
    2. Exploring the Grafana interface
      1. The main menu
    3. Organizations, dashboards, and panels
      1. Organizations
      2. Dashboards
      3. Panels
    4. How to get data into Grafana
      1. Data sources
    5. Making integrations easy with plugins
      1. Data source plugins
      2. Panel plugins
    6. Users and permissions
      1. Server level
      2. Organization level
      3. Teams
      4. Users
    7. Authentication methods
    8. Grafana authentication
      1. Short-lived tokens
      2. Anonymous authentication
      3. Authentication options
      4. Proxy authentication
      5. JWT authentication
      6. LDAP authentication
      7. GitHub OAuth2 authentication
    9. Summary
  10. Part 2: Collecting Data from IoT Devices
  11. Chapter 3: Connecting IoT Devices
    1. Technical requirements
    2. Sending data from IoT devices
    3. What is MQTT and what is it used for?
      1. Topics in MQTT
      2. QoS in MQTT
      3. MQTT 3.1.1
      4. MQTT 5
      5. MQTT clients
    4. Using an online MQTT broker
      1. Mosquitto
      2. HiveMQ
    5. Running your MQTT broker
    6. Sending data through HTTP
      1. HTTP methods
      2. HTTPS
      3. HTTP use case
    7. What is CoAP?
    8. What about WebSocket?
    9. How to select the right IoT protocol
    10. Summary
  12. Chapter 4: Data Sources for Grafana
    1. What is a data source?
    2. SQL versus NoSQL databases
      1. SQL databases
      2. What are NoSQL databases
    3. What are TSDBs?
    4. Google Sheets and CSV files
      1. Google Sheets data source
      2. Using files as data sources
    5. How to use live data
      1. Features
      2. Live channels
      3. Origin check
      4. Use of resources
      5. Maximum number of connections
    6. Summary
  13. Chapter 5: Using Time Series Databases
    1. Installing and configuring InfluxDB
      1. Installing InfluxDB
      2. Configuring the InfluxDB service
      3. Configuring the InfluxDB database
    2. Creating and managing an InfluxDB database
      1. Main concepts of InfluxDB databases
      2. Creating an InfluxDB bucket
      3. Storing values in the bucket
      4. Reading data from InfluxDB
    3. Installing and configuring OpenTSDB
      1. Installing OpenTSDB
      2. Configuring OpenTSDB
    4. Writing data in an OpenTSDB database
      1. Data schema
      2. Writing data
      3. Adding the data source to Grafana
    5. Summary
    6. Invitation to join us on Discord
  14. Part 3: Connecting Data Sources and Building Dashboards
  15. Chapter 6: Getting Data and Building Dashboards
    1. Getting data from time-series databases
    2. Showing time-series data in graph panels
      1. Panel options
      2. Time-series panel options
    3. Building table data panels
      1. Table panel options
      2. Building and customizing a table with multiple queries
    4. How to show categorical data
      1. Using stat panels
      2. Using bar charts
    5. Building a georeferenced map
      1. The Geomap panel
    6. Histograms and heatmaps
      1. The Histogram panel
      2. The Heatmap panel
    7. Summary
  16. Chapter 7: Managing Plugins
    1. Technical requirements
    2. How to install and manage plugins
      1. Installing a Grafana plugin on your server
      2. Installing plugins in a Grafana Cloud instance
      3. Plugins administration permissions
    3. All the flavors of plugins
      1. Signed versus unsigned plugins
      2. Types of plugins
    4. Summary
  17. Chapter 8: Organizing and Managing Dashboards
    1. Organizing panels and dashboards
      1. Controlling the visualization
      2. Building and showing playlists
    2. Properties of dashboards
      1. General dashboard properties
    3. Annotations and variables
      1. Annotations
      2. Variables
    4. Linking and sharing dashboards
      1. Linking dashboards and panels
      2. Sharing dashboards and panels
    5. Exporting and importing dashboards
      1. Exporting a dashboard
      2. Importing a dashboard
    6. Summary
  18. Part 4: Performing Analytics and Notifications
  19. Chapter 9: Performing Analytics in Grafana
    1. Technical requirements
    2. InfluxDB calculations
      1. InfluxQL functions
    3. Transformations in Grafana
      1. Add field from calculation
      2. Concatenate fields
      3. Convert field type
      4. Filter data by name
      5. Filter data by query
      6. Filter data by value
      7. Group by
      8. Labels to fields
      9. Merge
      10. Organize fields
      11. Join by field (outer transformation)
      12. Reduce
    4. Building advanced plots with Plotly
    5. Summary
    6. Invitation to join us on Discord
  20. Chapter 10: Alerting and Notifications in Grafana
    1. Technical requirements
    2. How Grafana manages alerts
      1. Using Alertmanager in Grafana
      2. Alert rule types
      3. No data and error handling
    3. Building numerical-based alerts
      1. Time-series and tabular data
    4. Notifications in Grafana
      1. Adding a contact point
    5. Connecting alerts and notifications
      1. Grouping notification policies
      2. Adding notification policies
      3. Editing the root policy
      4. Mute timings
      5. Silences
      6. Differences between mute timings and silences
    6. Summary
  21. Part 5: Integrating Grafana with Other Platforms
  22. Chapter 11: Using Grafana with Prometheus
    1. Technical requirements
    2. What is Prometheus?
      1. Architecture
      2. Data model
      3. Metric types
    3. Installing Prometheus
      1. Installing from binaries
      2. Installing from source
      3. Installing Prometheus using Docker
    4. Feeding Prometheus with data
      1. Prometheus clients
      2. Exporters
      3. Pushgateway
      4. Scraping configuration
    5. Integrating Prometheus and Grafana
      1. Editing Prometheus queries in Grafana
    6. Summary
  23. Chapter 12: Using Grafana with OpenSearch
    1. Technical requirements
    2. What OpenSearch is and what it is used for
      1. OpenSearch components
    3. Installing OpenSearch
      1. Disabling security for testing
    4. Ingesting data in OpenSearch
      1. Fluent Bit
      2. Configuring Fluent Bit for receiving MQTT messages
      3. Sending the data to OpenSearch
    5. Integrating OpenSearch and Grafana
      1. Adding the data source
      2. Building dashboards with the OpenSearch data source
      3. Interacting with OpenSearch using OpenSearch Dashboards
    6. Summary
    7. Invitation to join us on Discord
  24. Chapter 13: Showing Data from LibreNMS in Grafana
    1. Technical requirements
    2. What LibreNMS is and how you can use it
      1. SNMP
    3. Configuring LibreNMS to use InfluxDB
    4. Showing LibreNMS data on Grafana dashboards
    5. Showing network topology diagrams with quasi-live data
      1. Building diagrams with draw.io
      2. Using the FlowCharting panel
    6. Summary
  25. Chapter 14: Integrations for Grafana Cloud
    1. Technical requirements
    2. What is the Grafana Agent?
      1. Grafana Agent configuration
      2. Grafana Cloud service integrations
    3. Using the Linux Node integration
    4. Using the Home Assistant integration
    5. Using the RabbitMQ integration
    6. Summary
    7. Why subscribe?
  26. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts

Product information

  • Title: Building IoT Visualizations using Grafana
  • Author(s): Rodrigo Juan Hernández
  • Release date: July 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781803236124