In these series, I've covered the integration between a Go service and the ELK stack from scratch.
…Category: Golang
This article is part of the series Integrating your Go service with ELK
In the last chapter of these series, we covered how to create your first Kibana dashboard for a sample web application.
Although that will help you setup Kibana for your production services, what you'll be doing 99% of the time would be to actually use the dashboard to monitor & debug issues you observe on production.
This is the final post in the series for monitoring Go applications \w Kibana. It will give you some practice using your newly created dashboard to identify problems with a sample web application.
So if you've setup Kibana for the first time or you've just joined your new team & seen your Kibana dashboards without a clue what's going on, this post is for you!
…
This article is part of the series Integrating your Go service with ELK
In this tutorial, I'll show you how to create a dashboard for your application's structured logs in Kibana.
This is a follow-up to this article, which covers how to instrument your Go application \w structured logging for use by Kibana (in this tutorial).
We'll use Kibana v7.6 but any version you're using should work. It's just that your UI might look a bit different & you'll have to adjust.
Let's jump straight in! We'll stick to simple panels, which suite most of the use-cases you'd need.
…Yesterday, I released todocheck - a new kind of static code analyser for annotated TODOs.
Way too often, we let leftover TODOs slip into our main branch, which leaves your coworkers puzzles, looking at it a year from now.
They're thinking - what did I mean by "TODO: Move this to the users package"? What is the users package? It doesn't seem to exist anymore.
todocheck helps you fix this by forcing you to mark all your TODOs against an existing, open issue in your issue tracker.
That way, if you, at some point, close the issue, thinking you're done, the CI pipeline will sparkle in red as there is an open, unaddressed TODO in your main branch.
No longer can developers close a half-baked issue, rushing for the weekly sprint review to say "I'm done!".
…Recently, the Go team announced an updated draft design for their Generics in Go proposal. It goes into a lot of details about why certain decisions were made, implementation details, etc.
In this article, my goal is to summarise the major upcoming changes, as the whole draft design can be a mouthful for many.
I will provide some code snippets to demonstrate the major features as well as give you the chance to experiment yourself with them, thanks to the new Go playground with support for generics.
…
This article is part of the series Integrating your Go service with ELK
The Elastic stack (also referred to as ELK) can bring a lot of value to your production services. But it is not that much of value if you don't use structured logs in your services.
In one of my latest posts, I wrote about what ELK is and why you should care. I also wrote a tutorial about how to integrate ELK with your Go app.
In this article, I will walk you through how to integrate structured logging in your Go services. We will use a sample HTTP service with a few basic endpoints and we'll use the zap library to emit logs on error/success, which would also include some domain-specific info.
…
This article is part of the series Integrating your Go service with ELK
In my last post, I shared how much value the ELK stack could bring for your application in terms of the monitoring capabilities it gives you.
In this post, I will walk you through how to integrate your Go application with ELK, what are the different parts of ELK, how they work and how to create a basic configuration for them.
Let's jump straight in, shall we?
…
This article is part of the series Dependency Injection in Go using Fx
This article is part of the series Dependency Injection in Go using Fx
When you initially start a Go project, your main function typically has a bunch of wiring code - initialising your routes, plugging in middlewares, initialising your template engines, loggers, etc.
This is one of the great things about Go - you don't have any magic happening behind the scenes. The code is all there and you can read it and debug it.
But as your software grows, you start feeling the growing pains - your main function starts becoming more and more convoluted. You start having all sorts of small bits and pieces plugged in here and there - healthchecks, database setup code, metrics, tracers, external API connections, etc etc.
And what if your application grows into a microservice architecture? What do you do when you have five different microservices demanding the same bunch of setup code, specific to your environment?
In this article, I will introduce you to Fx. It's a Go framework which solves both problems outlined above using dependency injection.
Let's jump in.
All the code from this article is available in this repo.
So you want to learn Golang?
Great! Perhaps I could help you. When I learnt I'd be joining Uber, I had some time to prepare for the tech stack ahead. One of the key things I had to get onboarded to quickly was coding in Golang.
So I started searching for good courses around the web, which could help with getting me caught up with the language and its paradigms. Some were great, others were pretty bad. And the bad part is, it isn't obvious at first glance.
Actually, some of the most promoted courses on Golang are some of the most useless ones. So learning Go can be quite frustrating due to the lack of good courses out there.
In this article, I will share what good, bad and ugly courses I've encountered in the bumpy ride of learning Go.
…