{"record":{"id":"21b3f91740bc3730","repo":"juicedata/juicefs","slug":"convert-metrics-w","errorCode":null,"errorMessage":"convert metrics: %w","messagePattern":"convert metrics: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/java/libjfs/remote_write.go","lineNumber":153,"sourceCode":"\t\t}\n\t}\n\tif err != nil || len(mfs) == 0 {\n\t\tswitch rw.errorHandling {\n\t\tcase AbortOnError:\n\t\t\treturn err\n\t\tcase ContinueOnError:\n\t\t\tif rw.logger != nil {\n\t\t\t\trw.logger.Println(\"continue on error:\", err)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Convert metrics to TimeSeries\n\ttsList, err := rw.ConvertMetricsToTimeSeries(mfs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"convert metrics: %w\", err)\n\t}\n\n\tif len(tsList) == 0 {\n\t\treturn nil // No samples to push\n\t}\n\n\t// Send to remote write endpoint\n\twr := &prompb.WriteRequest{Timeseries: tsList}\n\tdata, err := wr.Marshal()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal protobuf: %w\", err)\n\t}\n\n\tcompressed := snappy.Encode(nil, data)\n\treq, err := http.NewRequest(\"POST\", rw.url, bytes.NewReader(compressed))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create request: %w\", err)\n\t}","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/libjfs/remote_write.go#L135-L171","documentation":"Returned by RemoteWriter.Push in the Java SDK when converting gathered Prometheus metric families into TimeSeries fails — unexpected metric types or malformed label/sample data. The wrapped error identifies the offending conversion step.","triggerScenarios":"Thrown at sdk/java/libjfs/remote_write.go:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that registered metrics use standard Prometheus types with valid names/labels"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}