{"record":{"id":"6e4ecc046c684164","repo":"VictoriaMetrics/VictoriaMetrics","slug":"missing-metric-name","errorCode":null,"errorMessage":"missing metric name","messagePattern":"missing metric name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/protoparser/opentelemetry/pb/pb.go","lineNumber":671,"sourceCode":"\t//   string unit = 3;\n\t//   oneof data {\n\t//     Gauge gauge = 5;\n\t//     Sum sum = 7;\n\t//     Histogram histogram = 9;\n\t//     ExponentialHistogram exponential_histogram = 10;\n\t//     Summary summary = 11;\n\t//   }\n\t//   repeated opentelemetry.proto.common.v1.KeyValue metadata = 12;\n\t// }\n\n\tdctx.mm.reset()\n\n\tmetricName, ok, err := easyproto.GetString(src, 1)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read metric name: %w\", err)\n\t}\n\tif !ok {\n\t\treturn fmt.Errorf(\"missing metric name\")\n\t}\n\tdctx.mm.Name = metricName\n\n\tunit, ok, err := easyproto.GetString(src, 3)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read metric unit: %w\", err)\n\t}\n\tif ok {\n\t\tdctx.mm.Unit = unit\n\t}\n\n\tdctx.mm.Type = prompb.MetricTypeUnknown\n\n\tlsMetadata := promutil.GetLabels()\n\tdefer promutil.PutLabels(lsMetadata)\n\n\tvar fc easyproto.FieldContext\n\tfor len(src) > 0 {","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/protoparser/opentelemetry/pb/pb.go#L653-L689","documentation":"Field 1 is entirely absent from the Metric message: OTEL requires every metric to carry a name, so the decoder rejects the message outright instead of guessing.","triggerScenarios":"Thrown at lib/protoparser/opentelemetry/pb/pb.go:671 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a non-empty instrument name on every metric in the exporter/SDK","Check instrumentation code for metrics created without a name","Reject or fix unnamed metrics before export"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}