Skip to content

Commit

Permalink
cmd/prometheus: Issue a warning on 32 bit archs (prometheus#8012)
Browse files Browse the repository at this point in the history
* cmd/prometheus: Issue a warning on 32 bit archs

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie authored Oct 6, 2020
1 parent 924ce97 commit 946819e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"io"
"math"
"math/bits"
"net"
"net/http"
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
Expand Down Expand Up @@ -344,6 +345,10 @@ func main() {
klog.SetLogger(log.With(logger, "component", "k8s_client_runtime"))

level.Info(logger).Log("msg", "Starting Prometheus", "version", version.Info())
if bits.UintSize < 64 {
level.Warn(logger).Log("msg", "This Prometheus binary has not been compiled for a 64-bit architecture. Due to virtual memory constraints of 32-bit systems, it is highly recommended to switch to a 64-bit binary of Prometheus.", "GOARCH", runtime.GOARCH)
}

level.Info(logger).Log("build_context", version.BuildContext())
level.Info(logger).Log("host_details", prom_runtime.Uname())
level.Info(logger).Log("fd_limits", prom_runtime.FdLimits())
Expand Down

0 comments on commit 946819e

Please sign in to comment.