Book Image

Cloud Native programming with Golang

By : Mina Andrawos, Martin Helmich
Book Image

Cloud Native programming with Golang

By: Mina Andrawos, Martin Helmich

Overview of this book

Awarded as one of the best books of all time by BookAuthority, Cloud Native Programming with Golang will take you on a journey into the world of microservices and cloud computing with the help of Go. Cloud computing and microservices are two very important concepts in modern software architecture. They represent key skills that ambitious software engineers need to acquire in order to design and build software applications capable of performing and scaling. Go is a modern cross-platform programming language that is very powerful yet simple; it is an excellent choice for microservices and cloud applications. Go is gaining more and more popularity, and becoming a very attractive skill. This book starts by covering the software architectural patterns of cloud applications, as well as practical concepts regarding how to scale, distribute, and deploy those applications. You will also learn how to build a JavaScript-based front-end for your application, using TypeScript and React. From there, we dive into commercial cloud offerings by covering AWS. Finally, we conclude our book by providing some overviews of other concepts and technologies that you can explore, to move from where the book leaves off.
Table of Contents (19 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
7
AWS I – Fundamentals, AWS SDK for Go, and EC2

Setting up Prometheus and Grafana


Before using Prometheus and Grafana in our own application, let's take a look at how Prometheus works in principle.

Prometheus's basics

Unlike other monitoring solutions, Prometheus works by pulling data (called metrics in Prometheus jargon) from clients at regular intervals. This process is called scraping. Clients monitored by Prometheus have to implement an HTTP endpoint that can be scraped by Prometheus in a regular interval (by default, 1 minute). These metrics endpoints can then return application-specific metrics in a predefined format.

For example, an application could offer an HTTP endpoint at /metrics that responds to GET requests and returns the following body:

memory_consumption_bytes 6168432 
http_requests_count{path="/events",method="get"} 241 
http_requests_count{path="/events",method="post"} 5 
http_requests_count{path="/events/:id",method="get"} 125 

This document exposes two metrics—memory_consumption_bytes and http_requests_count. Each metric...