mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
This commit adds the hostname field to the server monitor report in order to include the hostname of the server in the collected metrics. This information is useful for identifying and distinguishing between different servers in the monitoring system.
17 lines
203 B
Go
17 lines
203 B
Go
package utils
|
|
|
|
import (
|
|
"log/slog"
|
|
"os"
|
|
)
|
|
|
|
func GetHostname() string {
|
|
hostname, err := os.Hostname()
|
|
if err != nil {
|
|
slog.Error("Failed to fetch hostname", err)
|
|
return ""
|
|
}
|
|
|
|
return hostname
|
|
}
|