Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Observability with Grafana
Observability with Grafana

Observability with Grafana: Monitor, control, and visualize your Kubernetes and cloud platforms using the LGTM stack

Arrow left icon
Profile Icon Rob Chapman Profile Icon Peter Holmes
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (4 Ratings)
Paperback Jan 2024 356 pages 1st Edition
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Rob Chapman Profile Icon Peter Holmes
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (4 Ratings)
Paperback Jan 2024 356 pages 1st Edition
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€26.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Observability with Grafana

Introducing Observability and the Grafana Stack

The modern computer systems we work with have moved from the realm of complicated into the realm of complex, where the number of interacting variables make them ultimately unknowable and uncontrollable. We are using the terms complicated and complex as per system theory. A complicated system, like an engine, has clear causal relationships between components. A complex system, such as the flowing of traffic in a city, shows emergent behavior from the interactions of its components.

With the average cost of downtime estimated to be $9,000 per minute by Ponemon Institute in 2016, this complexity can cause significant financial loss if organizations do not take steps to manage this risk. Observability offers a way to mitigate these risks, but making systems observable comes with its own financial risks if implemented poorly or without a clear business goal.

In this book, we will give you a good understanding of what observability is and who the customers who might use it are. We will explore how to use the tools available from Grafana Labs to gain visibility of your organization. These tools include Loki, Prometheus, Mimir, Tempo, Frontend Observability, Pyroscope, and k6. You will learn how to use Service Level Indicators (SLIs) and Service Level Objectives (SLOs) to obtain clear transparent signals of when a service is operating correctly, and how to use the Grafana incident response tools to handle incidents. Finally, you will learn about managing their observability platform using automation tools such as Ansible, Terraform, and Helm.

This chapter aims to introduce observability to all audiences, using examples outside of the computing world. We’ll introduce the types of telemetry used by observability tools, which will give you an overview of how to use them to quickly understand the state of your services. The various personas who might use observability systems will be outlined so that you can explore complex ideas later with a clear grounding on who will benefit from their correct implementation. Finally, we’ll investigate Grafana’s Loki, Grafana, Tempo, Mimir (LGTM) stack, how to deploy it, and what alternatives exist.

In this chapter, we’re going to cover the following main topics:

  • Observability in a nutshell
  • Telemetry types and technologies
  • Understanding the customers of observability
  • Introducing the Grafana stack
  • Alternatives to the Grafana stack
  • Deploying the Grafana stack

Observability in a nutshell

The term observability is borrowed from control theory. It’s common to use the term interchangeably with the term monitoring in IT systems, as the concepts are closely related. Monitoring is the ability to raise an alarm when something is wrong, while observability is the ability to understand a system and determine whether something is wrong, and why.

Control theory was formalized in the late 1800s on the topic of centrifugal governors in steam engines. This diagram shows a simplified view of such a system:

Figure 1.1 – James Watt’s steam engine flyweight governor (source: https://www.mpoweruk.com)

Figure 1.1 – James Watt’s steam engine flyweight governor (source: https://www.mpoweruk.com)

Steam engines use a boiler to boil water in a pressure vessel. The steam pushes a piston backward and forward, which converts heat energy to reciprocal energy. In steam engines that use centrifugal governors, this reciprocal energy is converted to rotational energy via a wheel connected to a piston. The centrifugal governor provides a physical link backward through the system to the throttle. This means that the speed of rotation controls the throttle, which, in turn, controls the speed of rotation. Physically, this is observed by the balls on the governor flying outward and dropping inward until the system reaches equilibrium.

Monitoring defines the metrics or events that are of interest in advance. For instance, the governor measures the pre-defined metric of drive shaft revolutions. The controllability of the throttle is then provided by the pivot and actuator rod assembly. Assuming the actuator rod is adjusted correctly, the governor should control the throttle from fully open to fully closed.

In contrast, observability is achieved by allowing the internal state of the system to be inferred from its external outputs. If the operating point adjustment is incorrectly set, the governor may spin too fast or too slowly, rendering the throttle control ineffective. A governor spinning too fast or too slowly could also indicate that the sliding ring is stuck in place and needs oiling. Importantly, this insight can be gained without defining in advance what too fast or too slow means. The insight that the governor is spinning too fast or too slowly also needs very little knowledge of the full steam engine.

Fundamentally, both monitoring and observability are used to improve the reliability and performance of the system in question.

Now that we have introduced the high-level concepts, let’s explore a practical example outside of the world of software services.

Case study – A ship passing through the Panama Canal

Let’s imagine a ship traversing the Agua Clara locks on the Panama Canal. This can be illustrated using the following figure:

Figure 1.2 – The Agua Clara locks on the Panama Canal

Figure 1.2 – The Agua Clara locks on the Panama Canal

There are a few aspects of these locks that we might want to monitor:

  • The successful opening and closing of each gate
  • The water level inside each lock
  • How long it takes for a ship to traverse the locks

Monitoring these aspects may highlight situations that we need to be alerted about:

  • A gate is stuck open because of a mechanical failure
  • The water level is rapidly descending because of a leak
  • A ship is taking too long to exit the locks because it is stuck

There may be situations where the data we are monitoring are within acceptable limits, but we can still observe a deviation from what is considered normal, which should prompt further action:

  • A small leak has formed near the top of the lock wall:
    • We would see the water level drop but only when it is above the leak
    • This could prompt maintenance work on the lock wall
  • A gate in one lock is opening more slowly because it needs maintenance:
    • We would see the time between opening and closing the gate increase
    • This could prompt maintenance on the lock gate
  • Ships take longer to traverse the locks when the wind is coming from a particular direction:
    • We could compare hourly average traversal rates
    • This could prompt work to reduce the impact of wind from one direction

Now that we’ve seen an example of measuring a real-world system, we can group these types of measurements into different data types to best suit the application. Let’s introduce those now.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Use personas to better understand the needs and challenges of observability tools users
  • Get hands-on practice with Grafana and the LGTM stack through real-world examples
  • Implement and integrate LGTM with AWS, Azure, GCP, Kubernetes and tools such as OpenTelemetry, Ansible, Terraform, and Helm
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

To overcome application monitoring and observability challenges, Grafana Labs offers a modern, highly scalable, cost-effective Loki, Grafana, Tempo, and Mimir (LGTM) stack along with Prometheus for the collection, visualization, and storage of telemetry data. Beginning with an overview of observability concepts, this book teaches you how to instrument code and monitor systems in practice using standard protocols and Grafana libraries. As you progress, you’ll create a free Grafana cloud instance and deploy a demo application to a Kubernetes cluster to delve into the implementation of the LGTM stack. You’ll learn how to connect Grafana Cloud to AWS, GCP, and Azure to collect infrastructure data, build interactive dashboards, make use of service level indicators and objectives to produce great alerts, and leverage the AI & ML capabilities to keep your systems healthy. You’ll also explore real user monitoring with Faro and performance monitoring with Pyroscope and k6. Advanced concepts like architecting a Grafana installation, using automation and infrastructure as code tools for DevOps processes, troubleshooting strategies, and best practices to avoid common pitfalls will also be covered. After reading this book, you’ll be able to use the Grafana stack to deliver amazing operational results for the systems your organization uses.

Who is this book for?

If you’re an application developer, a DevOps engineer, a SRE, platform engineer, or a cloud engineer concerned with Day 2+ systems operations, then this book is for you. Product owners and technical leaders wanting to gain visibility of their products in a standardized, easy to implement way will also benefit from this book. A basic understanding of computer systems, cloud computing, cloud platforms, DevOps processes, Docker or Podman, Kubernetes, cloud native, and similar concepts will be useful.

What you will learn

  • Understand fundamentals of observability, logs, metrics, and distributed traces
  • Find out how to instrument an application using Grafana and OpenTelemetry
  • Collect data and monitor cloud, Linux, and Kubernetes platforms
  • Build queries and visualizations using LogQL, PromQL, and TraceQL
  • Manage incidents and alerts using AI-powered incident management
  • Deploy and monitor CI/CD pipelines to automatically validate the desired results
  • Take control of observability costs with powerful in-built features
  • Architect and manage an observability platform using Grafana

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 12, 2024
Length: 356 pages
Edition : 1st
Language : English
ISBN-13 : 9781803248004
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jan 12, 2024
Length: 356 pages
Edition : 1st
Language : English
ISBN-13 : 9781803248004
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 113.97
Modern DevOps Practices
€37.99
Observability with Grafana
€37.99
The Ultimate Docker Container Book
€37.99
Total 113.97 Stars icon

Table of Contents

21 Chapters
Part 1: Get Started with Grafana and Observability Chevron down icon Chevron up icon
Chapter 1: Introducing Observability and the Grafana Stack Chevron down icon Chevron up icon
Chapter 2: Instrumenting Applications and Infrastructure Chevron down icon Chevron up icon
Chapter 3: Setting Up a Learning Environment with Demo Applications Chevron down icon Chevron up icon
Part 2: Implement Telemetry in Grafana Chevron down icon Chevron up icon
Chapter 4: Looking at Logs with Grafana Loki Chevron down icon Chevron up icon
Chapter 5: Monitoring with Metrics Using Grafana Mimir and Prometheus Chevron down icon Chevron up icon
Chapter 6: Tracing Technicalities with Grafana Tempo Chevron down icon Chevron up icon
Chapter 7: Interrogating Infrastructure with Kubernetes, AWS, GCP, and Azure Chevron down icon Chevron up icon
Part 3: Grafana in Practice Chevron down icon Chevron up icon
Chapter 8: Displaying Data with Dashboards Chevron down icon Chevron up icon
Chapter 9: Managing Incidents Using Alerts Chevron down icon Chevron up icon
Chapter 10: Automation with Infrastructure as Code Chevron down icon Chevron up icon
Chapter 11: Architecting an Observability Platform Chevron down icon Chevron up icon
Part 4: Advanced Applications and Best Practices of Grafana Chevron down icon Chevron up icon
Chapter 12: Real User Monitoring with Grafana Chevron down icon Chevron up icon
Chapter 13: Application Performance with Grafana Pyroscope and k6 Chevron down icon Chevron up icon
Chapter 14: Supporting DevOps Processes with Observability Chevron down icon Chevron up icon
Chapter 15: Troubleshooting, Implementing Best Practices, and More with Grafana Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(4 Ratings)
5 star 75%
4 star 0%
3 star 0%
2 star 0%
1 star 25%
Average Joe Feb 21, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I enjoyed the level of detail that was provided in this book. It was well organized for both beginners and experts of application developers. If you want great awareness of your application is operation, then this book is for you.
Amazon Verified review Amazon
Chappers Jan 17, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A well written tech book, lets you easily follow along with helpful steps to help you create a Grafana cloud instance and deploy a demo application to a Kubernetes cluster.Nothing is better than something you can follow along rather than an extensive dump of technical information! Thank you for putting this book together!
Amazon Verified review Amazon
Jan Jan 16, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I recently had the opportunity to read this book that provided a comprehensive and up-to-date overview of observability with Grafana. I was particularly impressed with that the book incorporated also recent new features/services from Grafana labs.One aspect that stood out to me was the book's coverage of OpenTelemetry. This is crucial as it ensures that users are not locked into a specific vendor - it is a Grafana's commitment to providing a flexible and open solution for observability.I found myself agreeing with all the concepts mentioned in the book, as they aligned with industry best practices and provided practical insights into implementing effective observability strategies.Overall, I highly recommend this book to anyone interested in gaining a comprehensive understanding of observability with LGTM stack. Its up-to-date content, inclusion of recent features, and emphasis on OpenTelemetry support make it a valuable resource for both newcomers and seasoned professionals in the field.
Amazon Verified review Amazon
Akko Apr 20, 2024
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
It is just to force you to use grafana cloud. Everything is there in grafana just use that's all it there in this book. It never talks anything apart from this. Really repending on buying this book. You will never learn anything apart from on where to find result on cloud and how to run jars prepared by author to send data to cloud. Nothing else absolute waste.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.