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 Spring Boot Actuator metrics over to Graphite


In the previous recipe we learned how to export the metrics we created using Codahale over to Graphite. In this recipe, we will see how we can expose some metrics Spring Boot offers. Unfortunately, at this moment, the MetricRegistry does not expose all the metrics that Spring Boot offers. Only few of them are created using Codahale. If you take a look at the metrics that are available in /metrics, most of them are JVM related. So in this recipe, we will find another way to expose the JVM metrics via Codahale.

Getting ready

In this recipe, we will be adding a Maven dependency and some Java code to the geolocation project. So open up your STS IDE and navigate to the geolocation project. Make sure your Graphite instance is up and running. If not, start it using the docker-compose-graphite.yml file we created.

How to do it...

  1. In this recipe, we are going to expose some JVM metrics using Codahale. This will be exported to Graphite automatically...