runsc: Add version information to sandbox metric metadata.

This allows the runsc version to be tracked in monitoring.

PiperOrigin-RevId: 519025313
This commit is contained in:
Etienne Perot
2023-03-23 19:28:54 -07:00
committed by gVisor bot
parent d0326a67da
commit 1c9531cd53
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -18,6 +18,7 @@ go_library(
"//pkg/refs",
"//pkg/sentry/watchdog",
"//runsc/flag",
"//runsc/version",
],
)
+2
View File
@@ -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()),