Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ“ improve logging (#567)

authored by

Thibault Le Ouay and committed by
GitHub
92eca51e cb04ebde

+19 -6
+4
apps/checker/cmd/main.go
··· 64 64 c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"}) 65 65 return 66 66 } 67 + fmt.Printf("๐Ÿš€ Start processing for %+v \n", req) 67 68 68 69 response, err := checker.Ping(ctx, httpClient, req) 69 70 if err != nil { 71 + fmt.Printf("1๏ธโƒฃ first retry for %+v \n", req) 70 72 // Add one more retry 71 73 response, err = checker.Ping(ctx, httpClient, req) 72 74 if err != nil { 75 + fmt.Printf("2๏ธโƒฃ second retry for %+v \n", req) 76 + 73 77 checker.SendToTinyBird(ctx, checker.PingData{ 74 78 URL: req.URL, 75 79 Region: flyRegion,
+6 -1
apps/checker/fly.toml
··· 34 34 interval = "15s" 35 35 method = "GET" 36 36 timeout = "5s" 37 - path = "/ping" 37 + path = "/ping" 38 + 39 + [http_service.concurrency] 40 + type = "requests" 41 + hard_limit = 1000 42 + soft_limit = 500
+2 -2
apps/checker/go.mod
··· 20 20 github.com/klauspost/cpuid/v2 v2.2.4 // indirect 21 21 github.com/leodido/go-urn v1.2.4 // indirect 22 22 github.com/mattn/go-colorable v0.1.13 // indirect 23 - github.com/mattn/go-isatty v0.0.19 // indirect 23 + github.com/mattn/go-isatty v0.0.20 // indirect 24 24 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 25 25 github.com/modern-go/reflect2 v1.0.2 // indirect 26 26 github.com/pelletier/go-toml/v2 v2.0.8 // indirect ··· 29 29 golang.org/x/arch v0.3.0 // indirect 30 30 golang.org/x/crypto v0.9.0 // indirect 31 31 golang.org/x/net v0.10.0 // indirect 32 - golang.org/x/sys v0.12.0 // indirect 32 + golang.org/x/sys v0.16.0 // indirect 33 33 golang.org/x/text v0.9.0 // indirect 34 34 google.golang.org/protobuf v1.30.0 // indirect 35 35 gopkg.in/yaml.v3 v3.0.1 // indirect
+4
apps/checker/go.sum
··· 41 41 github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 42 42 github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 43 43 github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 44 + github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 45 + github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 44 46 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 45 47 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 46 48 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= ··· 81 83 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 82 84 golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= 83 85 golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 86 + golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= 87 + golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 84 88 golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= 85 89 golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= 86 90 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+2 -2
apps/checker/ping.go
··· 85 85 } 86 86 87 87 logger.Error().Err(err).Msg("error while pinging") 88 - return PingData{}, fmt.Errorf("error with monitor %s: %w", inputData.URL, err) 88 + return PingData{}, fmt.Errorf("error with monitorURL %s: %w", inputData.URL, err) 89 89 } 90 90 defer response.Body.Close() 91 91 92 92 if _, err := io.ReadAll(response.Body); err != nil { 93 - logger.Error().Err(err).Str("monitor", inputData.URL).Msg("error while reading body") 93 + logger.Error().Err(err).Str("monitorURL", inputData.URL).Msg("error while reading body") 94 94 return PingData{}, fmt.Errorf("error while reading body from %s: %w", inputData.URL, err) 95 95 } 96 96
+1 -1
apps/server/fly.toml
··· 23 23 min_machines_running = 1 24 24 25 25 processes = ["app"] 26 - [http_service.concurrency] 26 + [http_service.concurrency] 27 27 type = "requests" 28 28 hard_limit = 1000 29 29 soft_limit = 500