mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
feat: adds support for Hetzner and coolify deployment platform in statsreporter (#8409)
This commit is contained in:
parent
2a53918ebd
commit
2ac45b0174
@ -104,6 +104,8 @@ func detectPlatform() string {
|
|||||||
return "heroku"
|
return "heroku"
|
||||||
case os.Getenv("RENDER") != "" || os.Getenv("RENDER_SERVICE_ID") != "":
|
case os.Getenv("RENDER") != "" || os.Getenv("RENDER_SERVICE_ID") != "":
|
||||||
return "render"
|
return "render"
|
||||||
|
case os.Getenv("COOLIFY_RESOURCE_UUID") != "":
|
||||||
|
return "coolify"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to detect cloud provider through metadata endpoints
|
// Try to detect cloud provider through metadata endpoints
|
||||||
@ -151,5 +153,16 @@ func detectPlatform() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hetzner metadata
|
||||||
|
if req, err := http.NewRequest(http.MethodGet, "http://169.254.169.254/hetzner/v1/metadata", nil); err == nil {
|
||||||
|
if resp, err := client.Do(req); err == nil {
|
||||||
|
resp.Body.Close()
|
||||||
|
if resp.StatusCode == 200 {
|
||||||
|
return "hetzner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return "unknown"
|
return "unknown"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user