From 000b5b904a0096f945d34057f81359aade4b6587 Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Fri, 24 Mar 2023 15:07:01 -0700 Subject: [PATCH] `runsc`: Differentiate between `directfs` and non-`directfs` in metric labels. This renames the `gofermode` metadata metric label to `fsmode`, which is either "default" or "directfs". PiperOrigin-RevId: 519247987 --- runsc/config/config.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/runsc/config/config.go b/runsc/config/config.go index 9f2fdd794..f1981e3b9 100644 --- a/runsc/config/config.go +++ b/runsc/config/config.go @@ -391,15 +391,19 @@ func (b Bundle) Validate() error { // MetricMetadata returns key-value pairs that are useful to include in metrics // exported about the sandbox this config represents. func (c *Config) MetricMetadata() map[string]string { + var fsMode = "goferfs" + if c.DirectFS { + fsMode = "directfs" + } return map[string]string{ - "version": version.Version(), - "platform": c.Platform, - "network": c.Network.String(), - "numcores": strconv.Itoa(runtime.NumCPU()), - "coretags": strconv.FormatBool(c.EnableCoreTags), - "overlay": c.Overlay2.String(), - "gofermode": "default", - "cpuarch": runtime.GOARCH, + "version": version.Version(), + "platform": c.Platform, + "network": c.Network.String(), + "numcores": strconv.Itoa(runtime.NumCPU()), + "coretags": strconv.FormatBool(c.EnableCoreTags), + "overlay": c.Overlay2.String(), + "fsmode": fsMode, + "cpuarch": runtime.GOARCH, } }