Book Image

Microservices Deployment Cookbook

By : Vikram Murugesan
Book Image

Microservices Deployment Cookbook

By: Vikram Murugesan

Overview of this book

This book will help any team or organization understand, deploy, and manage microservices at scale. It is driven by a sample application, helping you gradually build a complete microservice-based ecosystem. Rather than just focusing on writing a microservice, this book addresses various other microservice-related solutions: deployments, clustering, load balancing, logging, streaming, and monitoring. The initial chapters offer insights into how web and enterprise apps can be migrated to scalable microservices. Moving on, you’ll see how to Dockerize your application so that it is ready to be shipped and deployed. We will look at how to deploy microservices on Mesos and Marathon and will also deploy microservices on Kubernetes. Next, you will implement service discovery and load balancing for your microservices. We’ll also show you how to build asynchronous streaming systems using Kafka Streams and Apache Spark. Finally, we wind up by aggregating your logs in Kafka, creating your own metrics, and monitoring the metrics for the microservice.
Table of Contents (15 chapters)
Microservices Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Exporting Dropwizard metrics over to Graphite


In the early recipes of this chapter, we learned how to create metrics using Dropwizard's Codahale library. Later, we learned how to start Graphite using Docker and understood the basics of using the Graphite interface. In this recipe, we will be exporting the metrics we created in the geolocation application over to this Graphite instance, which will then be used by Grafana for graphing.

Getting ready

As we will be working on the geolocation application, follow these steps:

  1. Open the STS IDE.

  2. Navigate to the geolocation project, and get ready for the next step.

  3. Start Graphite if you haven't done so. You can use the docker-compose-graphite.yml file that we created earlier to start Graphite.

How to do it...

The geolocation application currently exposes two metrics using the Codahale MetricRegistry: geolocationWriteRequestCount and geolocationLastWriteTime. There were two methods we used to view these metrics: using Spring's /metrics endpoint and using...