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
This commit is contained in:
Etienne Perot
2023-03-24 15:09:46 -07:00
committed by gVisor bot
parent 588b4e13ce
commit 000b5b904a
+12 -8
View File
@@ -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,
}
}