{"record":{"id":"296f009a0971e5c2","repo":"SigNoz/signoz","slug":"error-getting-updated-metrics-metadata-s","errorCode":null,"errorMessage":"error getting updated metrics metadata: %s","messagePattern":"error getting updated metrics metadata: (.+?)","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/query-service/app/clickhouseReader/reader.go","lineNumber":3009,"sourceCode":"\tfor rows.Next() {\n\t\tvar name string\n\t\tif err := rows.Scan(&name); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error while scanning metric name: %s\", err.Error())\n\t\t}\n\t\tif skipSignozMetrics && strings.HasPrefix(name, \"signoz\") {\n\t\t\tcontinue\n\t\t}\n\t\tmetricNames = append(metricNames, name)\n\t}\n\n\tif len(metricNames) == 0 {\n\t\treturn &response, nil\n\t}\n\n\t// Get all metadata in one shot\n\tmetadataMap, apiError := r.GetUpdatedMetricsMetadata(ctx, orgID, metricNames...)\n\tif apiError != nil {\n\t\treturn &response, fmt.Errorf(\"error getting updated metrics metadata: %s\", apiError.Error())\n\t}\n\n\tseen := make(map[string]struct{})\n\tfor _, name := range metricNames {\n\t\tmetadata := metadataMap[name]\n\n\t\ttyp := string(metadata.MetricType)\n\t\ttemporality := string(metadata.Temporality)\n\t\tisMonotonic := metadata.IsMonotonic\n\n\t\t// Non-monotonic cumulative sums are treated as gauges\n\t\tif typ == \"Sum\" && !isMonotonic && temporality == string(v3.Cumulative) {\n\t\t\ttyp = \"Gauge\"\n\t\t}\n\n\t\t// unlike traces/logs `tag`/`resource` type, the `Type` will be metric type\n\t\tkey := v3.AttributeKey{\n\t\t\tKey:      name,","sourceCodeStart":2991,"sourceCodeEnd":3027,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/clickhouseReader/reader.go#L2991-L3027","documentation":"In the metric metadata assembly path, the reader calls GetUpdatedMetricsMetadata to fetch metadata for the listed metric names; that call returned an ApiError which is wrapped into this message. The inner error text explains whether it was a ClickHouse exec failure, scan failure, or something else, so the %s is the diagnostic payload.","triggerScenarios":"Listing metrics (with metadata) when the metadata query against signoz_metrics_metadata fails: table missing, ClickHouse down, or a scan/type error inside GetUpdatedMetricsMetadata for one of the requested names.","commonSituations":"Metadata table not yet created on fresh installs; interrupted migrations; intermittent ClickHouse unavailability during metrics explorer usage.","solutions":["Unwrap and read the inner apiError.Error() text — it identifies the real failing stage","Ensure signoz_metrics metadata tables exist (run migrations) and ClickHouse is healthy","Retry after restoring ClickHouse; metadata queries are read-only and safe to retry","Reduce the metricNames batch if the query times out on very large metric cardinality"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// unwrap inner ApiError and branch on its Typ for retry vs 404 vs 500\nif err != nil {\n  if strings.Contains(err.Error(), \"UNKNOWN_TABLE\") { return &response, nil }\n  return nil, err\n}","preventionTips":["Create metadata tables via migrations before enabling metrics explorer","Retry transient failures; metadata queries are idempotent reads","Batch metric names to keep metadata queries fast"],"tags":["clickhouse","metrics","metadata","wrapper-error"],"backgroundTag":"database-query-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}