Posts

PromCon 2018 Notes

Overview Prometheus graduated CNCF. Openmetrics joined the incubator stage of CNCF. Prometheus will offer built-in TLS and auth in HTTP endpoints, as well as implement subqueries (e.g. max_over_time(rate(foo[5m])[1h:1m])) Leveraging Prometheus to Build, Test, and Release New Products at DigitalOcean. Talk by Sneha Inguva from DigitalOcean Observability team. Slides Talks about leveraging Prometheus to build and … Continue reading PromCon 2018 Notes

Posted in Prometheus | Leave a comment

Go Memory Management

This is a blog post version of a talk I gave at Vilnius Go Meetup. If you’re ever in Vilnius and enjoy Go come join us and consider speaking ūüôā So, in this post we will explore Go memory management. Let’s begin with a following little program: func main() { http.HandleFunc(“/bar”, func(w http.ResponseWriter, r *http.Request) … Continue reading Go Memory Management

Posted in Go | Tagged , | 9 Comments

Advanced Standalone Kubelet tutorial for Raspberry Pi

So recently I adapted Kelsey Hightower’s Standalone Kubelet Tutorial for Raspberry Pi. Standalone Kubelet Tutorial for Raspberry Pi is a prerequisite for this tutorial, as I’m going to skip Linux installation and all the other parts. In this tutorial I will show you how to cross compile Kubernetes Kubelet to ARM architecture and we will … Continue reading Advanced Standalone Kubelet tutorial for Raspberry Pi

Posted in Kubernetes, Prometheus | Tagged , , , , | 6 Comments

Running Prometheus Node exporter on a router

So at home I have Asus RT-N14U router, which has 600 Mhz MIPS architecture CPU, 16mb of flash storage and 64mb of RAM. On the software side, I’m running Andy Padavan’s RT-N56U firmware (Thank you, Andy!), this firmware gives you all the router features, I think raw Linux, ssh and some basic tools. So Node … Continue reading Running Prometheus Node exporter on a router

Posted in Prometheus | Tagged , , , | 2 Comments

Exploring Prometheus Go client metrics

In this post I want to explore go metrics, which are exported by client_golang via promhttp.Handler() call. Here is a sample program, registering prom handler and listening on 8080 port: package main import ( “log” “net/http” “github.com/prometheus/client_golang/prometheus/promhttp” ) func main() { http.Handle(“/metrics”, promhttp.Handler()) log.Fatal(http.ListenAndServe(“:8080”, nil)) } When you hit your metrics endpoint, you will get … Continue reading Exploring Prometheus Go client metrics

Posted in Go, Prometheus | Tagged , | 2 Comments

Tracking request duration with Prometheus

I recently started using Prometheus¬†for instrumenting and I really like it! It has a cool concept of labels, ¬†a functional query language &¬†a bunch of very useful functions like rate(), increase() & histogram_quantile(). Adding metrics to your app is easy, ¬†just import prometheus client and register metrics HTTP handler¬†http.Handle(“/metrics”, promhttp.Handler()) This one-liner adds HTTP¬†/metrics endpoint … Continue reading Tracking request duration with Prometheus

Posted in Go | 5 Comments

Go scheduler: Ms, Ps & Gs

I decided to learn a bit more about Go internals and since it was long time that somebody wrote about Go scheduler, I though it would be an interesting post. So, let’s get to it! Basics The Go runtime manages scheduling, garbage collection, and the runtime environment for goroutines. Here,¬†I will focus only on the … Continue reading Go scheduler: Ms, Ps & Gs

Posted in Go | Leave a comment

yaml url.URL parsing

I was using gopkg.in/yaml.v2 to unmarshal a .yaml file into a struct and couldn’t find a solution to unmarshal an url string into url.URL. Trying to just use url.URL ¬†fails with: Error initializing configuration: yaml: unmarshal errors:\n line 54: cannot unmarshal !!str `http://…` into url.URL This is because, url.URL doesn’t adhere to yaml.v2.Unmarshaler interface. So … Continue reading yaml url.URL parsing

Posted in Go | Tagged , , , , | Leave a comment

Think about your dependencies

A little copying is better than a little dependency, says¬†Go proverb. Go has a huge standard library, which has support for many, many things. I think many developers, don’t utilize it fully. I mean I have¬†seen many new gophers¬†try to use packages for everything. For example, do you really need a dependency on github.com/stretchr/testify ? … Continue reading Think about your dependencies

Posted in Go | Tagged , , , , , , | Leave a comment

Go schema migration tools

In this post I did a comparison of¬†following tools: https://github.com/markbates/pop/soda https://github.com/GuiaBolso/darwin https://bitbucket.org/liamstask/goose https://github.com/go-gormigrate/gormigrate https://github.com/mattes/migrate https://github.com/pravasan/pravasan https://github.com/rubenv/sql-migrate https://github.com/BurntSushi/migration https://github.com/DavidHuie/gomigrate https://github.com/tanel/dbmigrate https://github.com/pressly/goose Summary TL;DR¬†If your looking for schema migration tool you can use: mattes/migrate, SQL defined schema migrations, with¬†a well defined and documented API, large database support and a useful CLI tool. This tool is actively maintained, … Continue reading Go schema migration tools

Posted in Go | Tagged , , , , | 10 Comments