Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The DevOps 2.1 Toolkit: Docker Swarm

You're reading from  The DevOps 2.1 Toolkit: Docker Swarm

Product type Book
Published in May 2017
Publisher
ISBN-13 9781787289703
Pages 436 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Viktor Farcic Viktor Farcic
Profile icon Viktor Farcic

Table of Contents (22) Chapters

Title Page
Credits
About the Author
www.PacktPub.com
Customer Feedback
Preface
1. Continuous Integration with Docker Containers 2. Setting Up and Operating a Swarm Cluster 3. Docker Swarm Networking and Reverse Proxy 4. Service Discovery inside a Swarm Cluster 5. Continuous Delivery and Deployment with Docker Containers 6. Automating Continuous Deployment Flow with Jenkins 7. Exploring Docker Remote API 8. Using Docker Stack and Compose YAML Files to Deploy Swarm Services 9. Defining Logging Strategy 10. Collecting Metrics and Monitoring the Cluster 11. Embracing Destruction: Pets versus Cattle 12. Creating and Managing a Docker Swarm Cluster in Amazon Web Services 13. Creating and Managing a Docker Swarm Cluster in DigitalOcean 14. Creating and Managing Stateful Services in a Swarm Cluster 15. Managing Secrets in Docker Swarm Clusters 16. Monitor Your GitHub Repos with Docker and Prometheus

Scraping, querying, and visualizing Prometheus metrics


Prometheus server is designed to pull the metrics from instrumented services. However, since we wanted to avoid unnecessary coupling, we used exporters that provide the metrics we need. Those exporters are already running as Swarm services, and now we are ready to exploit them through Prometheus. To instantiate the Prometheus service, we should create a configuration file with the exporters running in our cluster. Before we do that, we need to retrieve the IPs of all the instances of an exporter service. If you recall the Chapter 4Service Discovery inside a Swarm Cluster, we can retrieve all the IPs by appending the tasks. prefix to the service name.

To retrieve the list of all the replicas of the node-exporter service, we could, for example, drill it from one of the instances of the util service:

docker exec -it $UTIL_ID \
    drill tasks.node-exporter

The relevant part of the output is as follows:

;; ANSWER SECTION:
tasks.node-exporter...
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 $15.99/month. Cancel anytime}