{"record":{"id":"382baa873c2aa20d","repo":"grafana/k6","slug":"invalid-value-for-metric-metadata-s-only-strin","errorCode":null,"errorMessage":"invalid value for metric metadata '%s': only String, Boolean and Number types are accepted as a metric metadata value","messagePattern":"invalid value for metric metadata '(.+?)': only String, Boolean and Number types are accepted as a metric metadata value","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/execution/execution.go","lineNumber":431,"sourceCode":"\tstate   *lib.State\n}\n\n// Get a property value for the key. May return nil if the property does not exist.\nfunc (o *metadataDynamicObject) Get(key string) sobek.Value {\n\ttcv := o.state.Tags.GetCurrentValues()\n\tif metadatum, ok := tcv.Metadata[key]; ok {\n\t\treturn o.runtime.ToValue(metadatum)\n\t}\n\treturn nil\n}\n\n// Set a property value for the key. It returns true if successful. String, Boolean\n// and Number types are implicitly converted to the Sobek's relative string\n// representation. An exception is raised in case a denied type is provided.\nfunc (o *metadataDynamicObject) Set(key string, val sobek.Value) bool {\n\to.state.Tags.Modify(func(tagsAndMeta *metrics.TagsAndMeta) {\n\t\tif err := common.ApplyCustomUserMetadata(tagsAndMeta, key, val); err != nil {\n\t\t\tpanic(o.runtime.NewTypeError(err.Error()))\n\t\t}\n\t})\n\treturn true\n}\n\n// Has returns true if the property exists.\nfunc (o *metadataDynamicObject) Has(key string) bool {\n\tctv := o.state.Tags.GetCurrentValues()\n\tif _, ok := ctv.Metadata[key]; ok {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Delete deletes the property for the key. It returns true on success (note,\n// that includes missing property).\nfunc (o *metadataDynamicObject) Delete(key string) bool {\n\to.state.Tags.Modify(func(tagsAndMeta *metrics.TagsAndMeta) {","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/execution/execution.go#L413-L449","documentation":"Error \"invalid value for metric metadata '%s': only String, Boolean and Number types are accepted as a metric metadata value\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/execution/execution.go:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}