mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-10 22:29:00 +08:00
Merge pull request #750 from SigNoz/fix/telemetry-bug
fix: avoid panic by handling getOutboundIP() error
This commit is contained in:
commit
74170ffb4a
@ -61,6 +61,10 @@ func getOutboundIP() string {
|
||||
ip := []byte("NA")
|
||||
resp, err := http.Get("https://api.ipify.org?format=text")
|
||||
|
||||
if err != nil {
|
||||
return string(ip)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
if err == nil {
|
||||
ipBody, err := ioutil.ReadAll(resp.Body)
|
||||
|
Loading…
x
Reference in New Issue
Block a user