Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Prometheus

You're reading from   Mastering Prometheus Gain expert tips to monitoring your infrastructure, applications, and services

Arrow left icon
Product type Paperback
Published in Apr 2024
Publisher Packt
ISBN-13 9781805125662
Length 310 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
William Hegedus William Hegedus
Author Profile Icon William Hegedus
William Hegedus
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Fundamentals of Prometheus FREE CHAPTER
2. Chapter 1: Observability, Monitoring, and Prometheus 3. Chapter 2: Deploying Prometheus 4. Chapter 3: The Prometheus Data Model and PromQL 5. Chapter 4: Using Service Discovery 6. Chapter 5: Effective Alerting with Prometheus 7. Part 2: Scaling Prometheus
8. Chapter 6: Advancing Prometheus: Sharding, Federation, and High Availability 9. Chapter 7: Optimizing and Debugging Prometheus 10. Chapter 8: Enabling Systems Monitoring with the Node Exporter 11. Part 3: Extending Prometheus
12. Chapter 9: Utilizing Remote Storage Systems with Prometheus 13. Chapter 10: Extending Prometheus Globally with Thanos 14. Chapter 11: Jsonnet and Monitoring Mixins 15. Chapter 12: Utilizing Continuous Integration (CI) Pipelines with Prometheus 16. Chapter 13: Defining and Alerting on SLOs 17. Chapter 14: Integrating Prometheus with OpenTelemetry 18. Chapter 15: Beyond Prometheus 19. Index 20. Other Books You May Enjoy

The textfile collector

The textfile collector is a hidden gem in the Node Exporter. This single collector adds tremendous versatility to what you can accomplish with a Prometheus monitoring stack.

Using the textfile collector, you can read Prometheus-formatted metrics from files on the server and include them in the output of the Node Exporter’s /metrics scrape endpoint.

Being able to read metrics from a file opens up a whole new world of monitoring short-lived processes such as batch or cron jobs, where it isn’t possible or doesn’t make sense to expose metrics on an HTTP endpoint for Prometheus to scrape. For example, at my company, we leverage the textfile collector to expose metrics related to the last time a server executed its scheduled synchronization with our configuration management system.

The textfile collector is enabled by default but requires additional configuration to actually work. For the collector to work, it must know where it should...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime