From 1c9531cd53772386e4aa396a20ab899165ac1555 Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Thu, 23 Mar 2023 19:25:47 -0700 Subject: [PATCH] `runsc`: Add version information to sandbox metric metadata. This allows the runsc version to be tracked in monitoring. PiperOrigin-RevId: 519025313 --- runsc/config/BUILD | 1 + runsc/config/config.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/runsc/config/BUILD b/runsc/config/BUILD index 8db4bdb26..6b7471719 100644 --- a/runsc/config/BUILD +++ b/runsc/config/BUILD @@ -18,6 +18,7 @@ go_library( "//pkg/refs", "//pkg/sentry/watchdog", "//runsc/flag", + "//runsc/version", ], ) diff --git a/runsc/config/config.go b/runsc/config/config.go index bc238c324..9f2fdd794 100644 --- a/runsc/config/config.go +++ b/runsc/config/config.go @@ -28,6 +28,7 @@ import ( "gvisor.dev/gvisor/pkg/refs" "gvisor.dev/gvisor/pkg/sentry/watchdog" "gvisor.dev/gvisor/runsc/flag" + "gvisor.dev/gvisor/runsc/version" ) // Config holds configuration that is not part of the runtime spec. @@ -391,6 +392,7 @@ func (b Bundle) Validate() error { // exported about the sandbox this config represents. func (c *Config) MetricMetadata() map[string]string { return map[string]string{ + "version": version.Version(), "platform": c.Platform, "network": c.Network.String(), "numcores": strconv.Itoa(runtime.NumCPU()),