MetricsMetadata returns all the metric metadata of a user.
(ctx context.Context, req *client.MetricsMetadataRequest)
| 2264 | |
| 2265 | // MetricsMetadata returns all the metric metadata of a user. |
| 2266 | func (i *Ingester) MetricsMetadata(ctx context.Context, req *client.MetricsMetadataRequest) (resp *client.MetricsMetadataResponse, err error) { |
| 2267 | i.stoppedMtx.RLock() |
| 2268 | if err := i.checkRunningOrStopping(); err != nil { |
| 2269 | i.stoppedMtx.RUnlock() |
| 2270 | return nil, err |
| 2271 | } |
| 2272 | i.stoppedMtx.RUnlock() |
| 2273 | |
| 2274 | userID, err := users.TenantID(ctx) |
| 2275 | if err != nil { |
| 2276 | return nil, err |
| 2277 | } |
| 2278 | |
| 2279 | // Set pprof labels for profiling |
| 2280 | pprof.Do(ctx, pprof.Labels("user", userID), func(ctx context.Context) { |
| 2281 | userMetadata := i.getUserMetadata(userID) |
| 2282 | |
| 2283 | if userMetadata == nil { |
| 2284 | resp = &client.MetricsMetadataResponse{} |
| 2285 | return |
| 2286 | } |
| 2287 | |
| 2288 | resp = &client.MetricsMetadataResponse{Metadata: userMetadata.toClientMetadata(req)} |
| 2289 | }) |
| 2290 | |
| 2291 | return resp, nil |
| 2292 | } |
| 2293 | |
| 2294 | // CheckReady is the readiness handler used to indicate to k8s when the ingesters |
| 2295 | // are ready for the addition or removal of another ingester. |
nothing calls this directly
no test coverage detected