Instrumenting Your Go App With Prometheus

Prometheus is the new hotness on the monitoring front for it’s ability to integrate and monitor easily into container environments that predominate microservice architectures. This article shows you how to add some quick and dirty Prometheus metrics to your Go application. This recipe adds in count, total duration and histogram of durations for any RESTful endpoint with go-restful. It requires the Prometheus Golang client. Install Prometheus Client To start, install the Prometheus Go client with: [Read More]

Adding Twelve Factors To Your Go Server

What is Twelve-Factor App? Is an architectural style for building RESTful applications that fits well with cloud and microservice philosophies. Name Description I Codebase One codebase tracked in revision control, many deploys II Dependencies Explicitly declare and isolate dependencies III Config Store config in the environment IV Backing services Treat backing services as attached resources V Build, release, run Strictly separate build and run stages VI Processes Execute the app as one or more stateless processes VII Port binding Export services via port binding VIII Concurrency Scale out via the process model IX Disposability Maximize robustness with fast startup and graceful shutdown X Dev/prod parity Keep development, staging, and production as similar as possible XI Logs Treat logs as event streams XII Admin processes Run admin/management tasks as one-off processes For our purposes we will focus on III Config, VII Port Binding, IX Disposability and XI Logs. [Read More]
go  golang 

Go Vendoring and CircleCI

CircleCI is really nice but has some completely fubar’d support for Go. Chief among them, WHY WOULD YOU ADD TWO PATHS TO THE GOPATH? It also has no real support for godeps, glide or any other vendoring in Go 1.5+. Most of the blog posts that you will find on the web are out of date or plain wrong (especially the thoughtbot one). Here is a simple way to bend CircleCI to build and test your Go project. [Read More]
go  golang  cicd