Monitoring Docker: Monitor your Docker containers and their apps using various native and third-party tools with the help of this exclusive guide!
()
About this ebook
This book will show you how monitoring containers and keeping a keen eye on the working of applications helps improve the overall performance of the applications that run on Docker. With the increased adoption of Docker containers, the need to monitor which containers are running, what resources they are consuming, and how these factors affect the overall performance of the system has become the need of the moment.
This book covers monitoring containers using Docker's native monitoring functions, various plugins, as well as third-party tools that help in monitoring. Well start with how to obtain detailed stats for active containers, resources consumed, and container behavior. We also show you how to use these stats to improve the overall performance of the system. Next, you will learn how to use SysDig to both view your containers performance metrics in real time and record sessions to query later. By the end of this book, you will have a complete knowledge of how to implement monitoring for your containerized applications and make the most of the metrics you are collecting
Read more from Russ Mc Kendrick
Kubernetes for Serverless Applications: Implement FaaS by effectively deploying, managing, monitoring, and orchestrating serverless applications using Kubernetes Rating: 0 out of 5 stars0 ratingsLearn Ansible: Automate your cloud infrastructure, security configuration, and application deployment with Ansible Rating: 0 out of 5 stars0 ratingsLearn Ansible: Automate cloud, security, and network infrastructure using Ansible 2.x Rating: 0 out of 5 stars0 ratingsThe Kubernetes Bible: The definitive guide to deploying and managing Kubernetes across major cloud platforms Rating: 4 out of 5 stars4/5Mastering Docker: Unlock new opportunities using Docker's most advanced features, 3rd Edition Rating: 0 out of 5 stars0 ratingsInfrastructure as Code for Beginners: Deploy and manage your cloud-based services with Terraform and Ansible Rating: 0 out of 5 stars0 ratingsExtending Docker Rating: 0 out of 5 stars0 ratingsDocker High Performance: Complete your Docker journey by optimizing your application's work?ows and performance, 2nd Edition Rating: 0 out of 5 stars0 ratings
Related to Monitoring Docker
Related ebooks
Monitoring Docker Rating: 0 out of 5 stars0 ratingsBeginning DevOps with Docker: Automate the deployment of your environment with the power of the Docker toolchain Rating: 0 out of 5 stars0 ratingsDocker High Performance Rating: 0 out of 5 stars0 ratingsDeveloping with Docker Rating: 0 out of 5 stars0 ratingsPuppet for Containerization Rating: 0 out of 5 stars0 ratingsDocker High Performance: Complete your Docker journey by optimizing your application's work?ows and performance, 2nd Edition Rating: 0 out of 5 stars0 ratingsDocker and Kubernetes for Java Developers Rating: 0 out of 5 stars0 ratingsDocker for Serverless Applications: Containerize and orchestrate functions using OpenFaas, OpenWhisk, and Fn Rating: 0 out of 5 stars0 ratingsSecuring Docker Rating: 0 out of 5 stars0 ratingsThe DevOps 2.0 Toolkit Rating: 0 out of 5 stars0 ratingsPersistence in PHP with Doctrine ORM Rating: 0 out of 5 stars0 ratingsImplementing Modern DevOps: Enabling IT organizations to deliver faster and smarter Rating: 0 out of 5 stars0 ratingsDocker on Windows Rating: 0 out of 5 stars0 ratingsPython Microservices Development: Build, test, deploy, and scale microservices in Python Rating: 4 out of 5 stars4/5Implementing Cloud Design Patterns for AWS Rating: 0 out of 5 stars0 ratingsConfiguration Management with Chef-Solo Rating: 0 out of 5 stars0 ratingsKubernetes for Developers: Use Kubernetes to develop, test, and deploy your applications with the help of containers Rating: 0 out of 5 stars0 ratingsCloud Development and Deployment with CloudBees Rating: 0 out of 5 stars0 ratingsHands-On DevOps with Vagrant: Implement end-to-end DevOps and infrastructure management using Vagrant Rating: 0 out of 5 stars0 ratingsPractical Docker with Python: Build, Release and Distribute your Python App with Docker Rating: 0 out of 5 stars0 ratingsGetting Started with Review Board Rating: 0 out of 5 stars0 ratingsLearning Docker: Build, ship, and scale faster Rating: 0 out of 5 stars0 ratingsDevOps with Kubernetes: Accelerating software delivery with container orchestrators, 2nd Edition Rating: 0 out of 5 stars0 ratingsAdvanced Express Web Application Development: For experienced JavaScript developers this book is all you need to build highly scalable, robust applications using Express. It takes you step by step through the development of a single page application so you learn empirically. Rating: 0 out of 5 stars0 ratingsMastering PhoneGap Mobile Application Development Rating: 0 out of 5 stars0 ratingsMastering Flask Web Development: Build enterprise-grade, scalable Python web applications, 2nd Edition Rating: 0 out of 5 stars0 ratingsLearn Docker – Fundamentals of Docker 19.x: Build, test, ship, and run containers with Docker and Kubernetes, 2nd Edition Rating: 0 out of 5 stars0 ratings
Networking For You
Networking All-in-One For Dummies Rating: 5 out of 5 stars5/5CompTIA Network+ Practice Tests: Exam N10-008 Rating: 0 out of 5 stars0 ratingsCybersecurity: The Beginner's Guide: A comprehensive guide to getting started in cybersecurity Rating: 5 out of 5 stars5/5AWS Certified Cloud Practitioner Study Guide: CLF-C01 Exam Rating: 5 out of 5 stars5/5The Compete Ccna 200-301 Study Guide: Network Engineering Edition Rating: 5 out of 5 stars5/5A Beginner's Guide to Ham Radio Rating: 0 out of 5 stars0 ratingsHome Networking Do-It-Yourself For Dummies Rating: 4 out of 5 stars4/5OSINT 101 Handbook: Expert-Level Intelligence Gathering: Advanced Reconnaissance, Threat Assessment, And Counterintelligence Rating: 0 out of 5 stars0 ratingsNmap Essentials Rating: 4 out of 5 stars4/5Emergency Preparedness and Off-Grid Communication Rating: 3 out of 5 stars3/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Raspberry Pi Electronics Projects for the Evil Genius Rating: 3 out of 5 stars3/5CompTIA Network+ Certification Guide (Exam N10-008): Unleash your full potential as a Network Administrator (English Edition) Rating: 0 out of 5 stars0 ratingsCCNA Certification Study Guide, Volume 2: Exam 200-301 Rating: 0 out of 5 stars0 ratingsProgramming Arduino: Getting Started with Sketches Rating: 4 out of 5 stars4/5Telecosm: How Infinite Bandwidth Will Revolutionize Our World Rating: 4 out of 5 stars4/5Computer Networking: An introductory guide for complete beginners: Computer Networking, #1 Rating: 5 out of 5 stars5/5Microsoft Azure For Dummies Rating: 0 out of 5 stars0 ratingsQuantum Computing For Dummies Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsSharePoint For Dummies Rating: 0 out of 5 stars0 ratingsWindows Command Line Administration Instant Reference Rating: 0 out of 5 stars0 ratingsGroup Policy: Fundamentals, Security, and the Managed Desktop Rating: 0 out of 5 stars0 ratingsWikis For Dummies Rating: 3 out of 5 stars3/5Microsoft Certified Azure Fundamentals Study Guide: Exam AZ-900 Rating: 0 out of 5 stars0 ratingsNetworking For Dummies Rating: 5 out of 5 stars5/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Amazon Web Services (AWS) Interview Questions and Answers Rating: 5 out of 5 stars5/5
Reviews for Monitoring Docker
0 ratings0 reviews
Book preview
Monitoring Docker - Russ McKendrick
Table of Contents
Monitoring Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to Docker Monitoring
Pets, Cattle, Chickens, and Snowflakes
Pets
Cattle
Chickens
Snowflakes
So what does this all mean?
Docker
Launching a local environment
Cloning the environment
Running a virtual server
Halting the virtual server
Summary
2. Using the Built-in Tools
Docker stats
Running Docker stats
What just happened?
What about processes?
Docker top
Docker exec
Summary
3. Advanced Container Resource Analysis
What is cAdvisor?
Running cAdvisor using a container
Compiling cAdvisor from source
Collecting metrics
The Web interface
Overview
Processes
CPU
Memory
Network
Filesystem
Viewing container stats
Subcontainers
Driver status
Images
This is all great, what's the catch?
Prometheus
Launching Prometheus
Querying Prometheus
Dashboard
The next steps
Alternatives?
Summary
4. A Traditional Approach to Monitoring Containers
Zabbix
Installing Zabbix
Using containers
Using vagrant
Preparing our host machine
The Zabbix web interface
Docker metrics
Create custom graphs
Compare containers to your host machine
Triggers
Summary
5. Querying with Sysdig
What is Sysdig?
Installing Sysdig
Using Sysdig
The basics
Capturing data
Containers
Further reading
Using Csysdig
Summary
6. Exploring Third Party Options
A word about externally hosted services
Deploying Docker in the cloud
Why use a SaaS service?
Sysdig Cloud
Installing the agent
Exploring your containers
Summary and further reading
Datadog
Installing the agent
Exploring the web interface
Summary and further reading
New Relic
Installing the agent
Exploring the web interface
Summary and further reading
Summary
7. Collecting Application Logs from within the Container
Viewing container logs
ELK Stack
Starting the stack
Logspout
Reviewing the logs
What about production?
Looking at third party options
Summary
8. What Are the Next Steps?
Some scenarios
Pets, Cattle, Chickens, and Snowflakes
Pets
Cattle
Chickens
Snowflakes
Scenario one
Scenario two
Scenario three
A little more about alerting
Chickens
Cattle and Pets
Sending alerts
Keeping up
Summary
Index
Monitoring Docker
Monitoring Docker
Copyright © 2015 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, and its dealers and distributors will be held liable for any damages caused or alleged to be 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.
First published: December 2015
Production reference: 1041215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-275-3
www.packtpub.com
Credits
Author
Russ McKendrick
Reviewer
Marcelo Correia Pinheiro
Commissioning Editor
Veena Pagare
Acquisition Editor
Rahul Nair
Content Development Editor
Anish Sukumaran
Technical Editor
Saurabh Malhotra
Copy Editor
Trishya Hajare
Project Coordinator
Izzat Contractor
Proofreader
Safis Editing
Indexers
Mariammal Chettiyar
Priya Sane
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade
About the Author
Russ McKendrick is an experienced solutions architect who has been working in IT and IT-related industries for the better part of 23 years. During his career, he has had varied responsibilities in a number of industries, ranging from looking after entire IT infrastructures to providing first line, second line, and senior support in client facing, and internal teams for corporate organizations.
He works almost exclusively with Linux, using open source systems and tools on various platforms ranging from dedicated hardware and virtual machines to public clouds.
About the Reviewer
Marcelo Correia Pinheiro is a Brazilian software engineer from Porto Alegre. He started to work as a web designer and programmer in 2000 with ASP and PHP, naturally getting in touch with the Microsoft .NET framework and Java running respective databases of choice for web applications. Since 2003, he has used Linux and UNIX-related operational systems, from Slackware to Gobo Linux, Archlinux, CentOS, Debian, and today OSX, having some contact with BSD distributions too. He has lost some nights compiling and applying patches to the Linux kernel to make its desktop work. Since the beginning, he has been acting as a problem solver, no matter what the programming language, database, or platform is—open source enthusiast.
After a few years, he decided to live in São Paulo to work with newer technologies such as NoSQL, cloud computing, and Ruby, where he started to conduct tech talks with this language in Locaweb. He created some tools to standardize development using tools such as vagrant and Ruby gems—some of these in their GitHub—in Locaweb to ensure fast application packaging and reduced deployment rollbacks. In 2013, he changed his career to be a full-stack developer following the DevOps movement. Since 2012, he has attended, as a speaker, some of the biggest software conferences in Brazil—RS on Rails, QConSP, The Developer's Conference, and RubyConf Brazil—talking not only about Ruby, but also about some of the well-known DevOps tools such as Terraform, Packer, Ansible, and Docker. Today, he works as a DevOps consultant in their company.
In his free time, he loves playing the guitar, having some fun with cats, traveling, and drinking beer. He can be found on his blog (http://salizzar.net), Twitter (https://twitter.com/salizzar), GitHub (https://github.com/salizzar) and Linkedin (https://www.linkedin.com/in/salizzar).
He has worked as a reviewer for Vagrant Virtual Development Environment Cookbook, a Packt Publishing book with useful recipes using vagrant with configuration management tools such as Puppet, Chef, Ansible, and SaltStack.
I want to thank all my friends, who believed in my potential since the beginning and who still follow me despite the distance. I would also like to thank my mentors, Gleicon Moraes, Roberto Gaiser, and Rodrigo Campos, who gave me the incentive and tips to be a better software engineer and person.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
Support files, eBooks, discount offers, and morehttps://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
With the increase in the adoption of Docker containers, the need to monitor which containers are running, what resources they are consuming, and how it affects the overall performance of the system, has become a time-related need. Monitoring Docker will teach you how monitoring containers and keeping a keen eye on the working of applications help to improve the overall performance of the applications that run on Docker.
This book will cover monitoring containers using Docker's native monitoring functions, various plugins, and also third-party tools that help in monitoring. The book will first cover how to obtain detailed stats for the active containers, resources consumed, and container behavior. This book will also show the readers how to use these stats to improve the overall performance of the system.
What this book covers
Chapter 1, Introduction to Docker Monitoring, discusses