From the course: Go Performance Optimization

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Monitoring and alerting

Monitoring and alerting - Go Tutorial

From the course: Go Performance Optimization

Monitoring and alerting

- [Instructor] Metrics are your highest production and you should meter not only how many requests or how many errors, but also performance-related metrics. On top of that, you should have alerting if a metric, especially a performance one deca-grades requests are starting to get over, let's say a hundred milliseconds. Someone should wake up and see what's going on. When we talk about HTP servers, most of the time we do it with middleware. So I have a handle here that returns the time in UTC. And what I have here is a timing middleware. So a middleware is something that returns a handle and gets a handler. Sometimes middleware will also get the next handler to call maybe a logger and maybe some other information. There are slight variations but the idea is roughly the same. So I'm creating a function that starts the time and it defer calculates how much time has passed and save it to a log and we'll talk about the options…

Contents