(w http.ResponseWriter, r *http.Request)
| 248 | } |
| 249 | |
| 250 | func (q *Querier) SearchTagValuesHandler(w http.ResponseWriter, r *http.Request) { |
| 251 | isSearchBlock := api.IsSearchBlock(r) |
| 252 | |
| 253 | // Enforce the query timeout while querying backends |
| 254 | ctx, cancel := context.WithDeadline(r.Context(), time.Now().Add(q.cfg.Search.QueryTimeout)) |
| 255 | defer cancel() |
| 256 | |
| 257 | ctx, span := tracer.Start(ctx, "Querier.SearchTagValuesHandler") |
| 258 | defer span.End() |
| 259 | |
| 260 | var resp *tempopb.SearchTagValuesResponse |
| 261 | if !isSearchBlock { |
| 262 | req, err := api.ParseSearchTagValuesRequest(r) |
| 263 | if err != nil { |
| 264 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 265 | return |
| 266 | } |
| 267 | |
| 268 | resp, err = q.SearchTagValues(ctx, req) |
| 269 | if err != nil { |
| 270 | handleError(w, err) |
| 271 | return |
| 272 | } |
| 273 | } else { |
| 274 | req, err := api.ParseSearchTagValuesBlockRequest(r) |
| 275 | if err != nil { |
| 276 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 277 | return |
| 278 | } |
| 279 | resp, err = q.SearchTagValuesBlocks(ctx, req) |
| 280 | if err != nil { |
| 281 | handleError(w, err) |
| 282 | return |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | writeFormattedContentForRequest(w, r, resp, span) |
| 287 | } |
| 288 | |
| 289 | func (q *Querier) SearchTagValuesV2Handler(w http.ResponseWriter, r *http.Request) { |
| 290 | isSearchBlock := api.IsSearchBlock(r) |
nothing calls this directly
no test coverage detected