Thread-Safety in Go – an Overlooked Concern

Thread-Safety in Go - An overlooked concern
Gopher on image was designed by Renee French. (http://reneefrench.blogspot.com/)

When you first start tinkering with concurrency in any language, what's the most sought after goal is extracting the maximum output from the hardware you have available.

That's why we use it and study it in the first place - to achieve optimal parallelism & get some significant speed-up for our apps out of the box.

However, a not so glamorous part of studying the subject is understanding how to write thread-safe code. The techniques and principles which will enable you to keep your application well-behaved, even after scaling it to dozens of threads.

Even though this is an important thing to consider while writing concurrent code, it is often overlooked in most learning resources about concurrency. This problem is even more relevant in the Go community due to two common misunderstandings I will cover in the article.

Continue Reading

Speaking at Golab Conf this year!

This year, I'm going to be presenting at Golab Conf about Advanced Dependency Management in Go using Fx. I'm also hosting a workshop on integrating your Go service \w the ELK stack.

In the talk, we'll cover what the Fx framework is and how it can help you reduce some of the component wiring boilerplate as well as help you structure your applications into reusable modules, which is especially great in a microservice environment!

As for the workshop, it's a VERY hands-on 3-hour workshop in which you'll learn how to use the Elastic stack to greatly enhance your services' observability. If you have no idea what all that means, then this workshop is definitely for you. It will give you the knowledge to evaluate if these tools are right for you and the skills to fully integrate this into your systems & start using it right away.

If any of that sounds interesting to you, then book your seat!

Otherwise, check out the full agenda here as there are also other pretty cool talks & some quite interesting workshops!

The conference is hosted online throughout 19th October to 25th October from the comfort of your own seat at home.

The "Advanced Dependency Management in Go using Fx" talk is held on 16th October, 17:30 PM GMT +2.

The "Integrating your Go service with the ELK stack" workshop is held on 21st October, 12:30 PM GMT+2.

I'll see you there!

UPDATE:

The videos from the talk + workshop are out. Check them out:

Advanced Dependency Management in Go using Fx

Workshop - Integrating your Go service with the ELK stack

Using Kibana to Debug Production Issues

Debugging production issues with Kibana


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!

Continue Reading

How to create a Logging Dashboard with Kibana

Kibana Dashboard


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.

Continue Reading

Eliminate the undocumented TODOs with todocheck

todocheck logo

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!".

Continue Reading

A Concise Guide to the Latest Go Generics Draft Design

Generics in Go

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.

Continue Reading

How to Use Structured Logs in your Go Application

structured logs in Kibana


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.

Continue Reading

How to integrate your Go Service with ELK

Go loves ELK


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?

Continue Reading

Site Footer

BulgariaEnglish