Menu

Post image 1
Post image 2
1 / 2
0

Monitoring and Alerting for Video Platform Infrastructure with Go

DEV Community·ahmet gedik·22 days ago
#l972r4sK
Reading 0:00
15s threshold

Monitoring Across Time Zones TrendVidStream serves UAE (+4 UTC), Finland (+2), Czech Republic (+1), Denmark (+1), Belgium (+1), UK (+0), Switzerland (+1), and US (-5 to -8). A cron failure in Finland at 3am local is 1am UTC — monitoring must alert before users notice stale content. Health Check Endpoint package main import ( "database/sql" "encoding/json" "net/http" "time" ) type HealthResponse struct { Overall string `json:"overall"` Checks map [ string ] string `json:"checks"` Uptime string `json:"uptime"` Regions [] string `json:"regions_active"` } var ( startTime = time . Now () activeRegions = [] string { "AE" , "FI" , "CZ" , "DK" , "BE" , "CH" , "GB" , "US" } ) func healthHandler ( db * sql . DB ) http . HandlerFunc { return func ( w http . ResponseWriter , r * http . Request ) { checks := map [ string ] string {} overall := "ok" if err := db . Ping (); err != nil { checks [ "database" ] = "error: " + err .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More