diff --git a/metrics/cpu_disabled.go b/metrics/cpu_disabled.go
index b0b483ee4bce..025d97aeb32a 100644
--- a/metrics/cpu_disabled.go
+++ b/metrics/cpu_disabled.go
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
+//go:build ios || js
// +build ios js
package metrics
diff --git a/metrics/cputime_nop.go b/metrics/cputime_nop.go
index 1bf5537277fe..0188735a7833 100644
--- a/metrics/cputime_nop.go
+++ b/metrics/cputime_nop.go
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see .
+//go:build windows || js
// +build windows js
package metrics
diff --git a/metrics/runtime_cgo.go b/metrics/runtime_cgo.go
index 11722f76ccd5..4307ebdba689 100644
--- a/metrics/runtime_cgo.go
+++ b/metrics/runtime_cgo.go
@@ -1,3 +1,4 @@
+//go:build cgo && !appengine && !js
// +build cgo,!appengine,!js
package metrics
diff --git a/metrics/runtime_gccpufraction.go b/metrics/runtime_gccpufraction.go
index ca12c05bac74..28cd44752b45 100644
--- a/metrics/runtime_gccpufraction.go
+++ b/metrics/runtime_gccpufraction.go
@@ -1,3 +1,4 @@
+//go:build go1.5
// +build go1.5
package metrics
diff --git a/metrics/runtime_no_cgo.go b/metrics/runtime_no_cgo.go
index e760af554f1a..1799bef63bfb 100644
--- a/metrics/runtime_no_cgo.go
+++ b/metrics/runtime_no_cgo.go
@@ -1,3 +1,4 @@
+//go:build !cgo || appengine || js
// +build !cgo appengine js
package metrics
diff --git a/metrics/runtime_no_gccpufraction.go b/metrics/runtime_no_gccpufraction.go
index be96aa6f1be9..af1a4b63c809 100644
--- a/metrics/runtime_no_gccpufraction.go
+++ b/metrics/runtime_no_gccpufraction.go
@@ -1,3 +1,4 @@
+//go:build !go1.5
// +build !go1.5
package metrics
diff --git a/metrics/syslog.go b/metrics/syslog.go
index a0ed4b1b2364..551a2bd0f072 100644
--- a/metrics/syslog.go
+++ b/metrics/syslog.go
@@ -1,3 +1,4 @@
+//go:build !windows
// +build !windows
package metrics