{"record":{"id":"732c89b8975c25c2","repo":"thanos-io/thanos","slug":"proxy-labelnames","errorCode":null,"errorMessage":"proxy LabelNames()","messagePattern":"proxy LabelNames\\(\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/query/querier.go","lineNumber":503,"sourceCode":"\tif hints == nil {\n\t\thints = &storage.LabelHints{}\n\t}\n\n\treq := &storepb.LabelNamesRequest{\n\t\tPartialResponseStrategy: q.partialResponseStrategy,\n\t\tStart:                   q.mint,\n\t\tEnd:                     q.maxt,\n\t\tMatchers:                pbMatchers,\n\t\tLimit:                   int64(hints.Limit),\n\t}\n\n\tif q.isDedupEnabled() {\n\t\treq.WithoutReplicaLabels = q.replicaLabels\n\t}\n\n\tresp, err := q.proxy.LabelNames(ctx, req)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"proxy LabelNames()\")\n\t}\n\n\tvar warns annotations.Annotations\n\tfor _, w := range resp.Warnings {\n\t\twarns.Add(errors.New(w))\n\t}\n\n\treturn resp.Names, warns, nil\n}\n\nfunc (q *querier) Close() error { return nil }\n\n// maxResolutionFromSelectHints finds the max possible resolution by inferring from the promql query.\nfunc maxResolutionFromSelectHints(maxResolutionMillis int64, hintsRange int64, hintsFunc string) int64 {\n\tif hintsRange > 0 {\n\t\tif _, ok := promqlFuncRequiresTwoSamples[hintsFunc]; ok {\n\t\t\tmaxResolutionMillis = min(maxResolutionMillis, hintsRange/2)\n\t\t}","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/query/querier.go#L485-L521","documentation":"LabelNames proxies the gRPC LabelNames RPC to all stores; any error returned by proxy.LabelNames is wrapped as 'proxy LabelNames()'. This is the umbrella error for store-side RPC failures during label name lookups.","triggerScenarios":"Calling LabelNames while stores are unreachable, return remote errors, or the context deadline expires during the RPC fan-out.","commonSituations":"Store gateway restart, misconfigured store addresses, TLS handshake failures, heavy cardinality causing RPC timeouts.","solutions":["Check store health and connectivity; inspect the wrapped RPC error","Verify store address configuration and service discovery","Increase query/store timeouts if under heavy load","Retry once stores recover; check thanos query store status in UI/API"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check store reachability\nif !allStoresHealthy(ctx, stores, 2*time.Second) {\n    return errors.New(\"stores unhealthy; skip LabelNames fan-out\")\n}","typeGuard":null,"tryCatchPattern":"names, warns, err := q.LabelNames(ctx, hints, matchers...)\nif err != nil {\n    if strings.Contains(err.Error(), \"proxy LabelNames()\") {\n        return retryBackoff(ctx, 3, func() error { return fetchNames() })\n    }\n    return err\n}","preventionTips":["Monitor gRPC connectivity to stores","Use readiness probes so dead stores are removed from fan-out","Set generous but bounded deadlines for LabelNames RPCs"],"tags":["thanos","grpc","labels","network"],"backgroundTag":"upstream-api-error","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}