{"record":{"id":"77950bdc03e9960d","repo":"jaegertracing/jaeger","slug":"failed-getting-call-metrics-w","errorCode":null,"errorMessage":"failed getting call metrics: %w","messagePattern":"failed getting call metrics: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/metricstore/prometheus/metricstore/reader.go","lineNumber":232,"sourceCode":"\t\t\t\tm.callsMetricName, p.serviceFilter, p.spanKindFilter, p.rate, p.groupBy,\n\t\t\t\tm.callsMetricName, p.serviceFilter, p.spanKindFilter, p.rate, p.groupBy,\n\t\t\t)\n\t\t},\n\t}\n\terrorMetrics, err := m.executeQuery(ctx, metricsParams)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed getting error metrics: %w\", err)\n\t}\n\t// Non-zero error rates are available.\n\tif len(errorMetrics.Metrics) > 0 {\n\t\treturn errorMetrics, nil\n\t}\n\n\t// Check for the presence of call rate metrics to differentiate the absence of error rate from\n\t// the absence of call rate metrics altogether.\n\tcallMetrics, err := m.GetCallRates(ctx, &metricstore.CallRateQueryParameters{BaseQueryParameters: requestParams.BaseQueryParameters})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed getting call metrics: %w\", err)\n\t}\n\t// No call rate metrics are available, and by association, means no error rate metrics are available.\n\tif len(callMetrics.Metrics) == 0 {\n\t\treturn errorMetrics, nil\n\t}\n\n\t// Non-zero call rate metrics are available, which implies that there are just no errors, so we report a zero error rate.\n\tzeroErrorMetrics := make([]*metrics.Metric, 0, len(callMetrics.Metrics))\n\tfor _, cm := range callMetrics.Metrics {\n\t\tzm := *cm\n\t\tfor i := 0; i < len(zm.MetricPoints); i++ {\n\t\t\tzm.MetricPoints[i].Value = &metrics.MetricPoint_GaugeValue{GaugeValue: &metrics.GaugeValue{Value: &metrics.GaugeValue_DoubleValue{DoubleValue: 0.0}}}\n\t\t}\n\t\tzeroErrorMetrics = append(zeroErrorMetrics, &zm)\n\t}\n\n\terrorMetrics.Metrics = zeroErrorMetrics\n\treturn errorMetrics, nil","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/metricstore/prometheus/metricstore/reader.go#L214-L250","documentation":"GetErrorRates delegates to GetCallRates to distinguish 'no error-rate data' from 'no call-rate data at all'. When the call-rate range query fails, the error is wrapped with this prefix. Like [380], this indicates a failed Prometheus QueryRange call, not empty data.","triggerScenarios":"Calling GetErrorRates where the nested GetCallRates -> executeQuery -> client.QueryRange call fails (connection error, invalid query, Prometheus API error, cancelled context).","commonSituations":"Same as error-rate failures: bad Prometheus URL, Prometheus outage, network partition, or call-rate query rejected by the server.","solutions":["Fix the underlying Prometheus connectivity/query problem identified by the wrapped inner error.","Verify the configured Prometheus server URL and that call-rate metrics (jaeger_spans_calls_total family) exist in Prometheus.","Check Prometheus /api/v1/status/flags and server logs for rejected queries.","Confirm query range parameters (EndTime, Step) are valid and within Prometheus retention."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if err := promClient.Query(ctx, promclient.NewClientV1(api.Config{}), `jaeger_spans_calls_total`); err != nil {\n    return fmt.Errorf(\"call-rate metrics unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"callMetrics, err := m.GetCallRates(ctx, &metricstore.CallRateQueryParameters{...})\nif err != nil {\n    return nil, fmt.Errorf(\"failed getting call metrics: %w\", err)\n}","preventionTips":["Confirm jaeger_spans_calls_total metrics exist in Prometheus before using the metrics API.","Keep Jaeger and Prometheus server versions compatible.","Alert on Prometheus API error rates."],"tags":["prometheus","metrics","storage","network"],"backgroundTag":"prometheus-query-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}