{"record":{"id":"ae047581f09717fa","repo":"grafana/k6","slug":"metric-not-registered-q","errorCode":null,"errorMessage":"metric not registered %q","messagePattern":"metric not registered %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_session.go","lineNumber":360,"sourceCode":"\twv := struct {\n\t\tID             string\n\t\tName           string\n\t\tValue          json.Number\n\t\tRating         string\n\t\tDelta          json.Number\n\t\tNumEntries     json.Number\n\t\tNavigationType string\n\t\tURL            string\n\t\tSpanID         string\n\t}{}\n\n\tif err := json.Unmarshal([]byte(object), &wv); err != nil {\n\t\treturn fmt.Errorf(\"json couldn't be parsed: %w\", err)\n\t}\n\n\tmetric, ok := fs.k6Metrics.WebVitals[wv.Name]\n\tif !ok {\n\t\treturn fmt.Errorf(\"metric not registered %q\", wv.Name)\n\t}\n\n\tvalue, err := wv.Value.Float64()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"value couldn't be parsed %q\", wv.Value)\n\t}\n\n\tstate := fs.vu.State()\n\ttags := state.Tags.GetCurrentValues().Tags\n\tif state.Options.SystemTags.Has(k6metrics.TagURL) {\n\t\ttags = handleURLTag(fs.page, wv.URL, http.MethodGet, tags)\n\t}\n\n\ttags = tags.With(\"rating\", wv.Rating)\n\n\tnow := time.Now()\n\tpushIfNotDone(fs.vu.Context(), fs.logger, state.Samples, k6metrics.ConnectedSamples{\n\t\tSamples: []k6metrics.Sample{","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/grafana/k6/blob/94169daab29df52c1ed2ee0549657a577666b855/internal/js/modules/k6/browser/common/frame_session.go#L342-L378","documentation":"parseAndEmitWebVitalMetric parsed the web-vitals payload but the reported metric name (e.g. CLS, LCP, FCP, TTFID, INP) is not present in the k6Metrics.WebVitals registry. Either web-vitals emitted a new/unknown metric name or the metric registration step was skipped — an internal consistency guard.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_session.go:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update k6 so the web-vitals names and registered metrics match","Report to grafana/k6 with the unknown metric name from the error","Disable web-vitals collection if not needed, to avoid the code path"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94169daab29df52c1ed2ee0549657a577666b855","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}