mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Inject status and status.code for tags autocomplete (#62794)
* Tempo: Inject status for v2 and status.code for v1 in the tags list for autocomplete * Small comment fix
This commit is contained in:
parent
ce5e067d28
commit
b78af0b0f0
@ -121,6 +121,11 @@ function useAutocomplete(datasource: TempoDatasource) {
|
||||
const tags = datasource.languageProvider.getTags();
|
||||
|
||||
if (tags) {
|
||||
// This is needed because the /api/search/tag/${tag}/values API expects "status.code" and the v2 API expects "status"
|
||||
// so Tempo doesn't send anything and we inject it here for the autocomplete
|
||||
if (!tags.find((t) => t === 'status.code')) {
|
||||
tags.push('status.code');
|
||||
}
|
||||
providerRef.current.setTags(tags);
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -148,6 +148,11 @@ function useAutocomplete(datasource: TempoDatasource) {
|
||||
const tags = datasource.languageProvider.getTags();
|
||||
|
||||
if (tags) {
|
||||
// This is needed because the /api/v2/search/tag/${tag}/values API expects "status" and the v1 API expects "status.code"
|
||||
// so Tempo doesn't send anything and we inject it here for the autocomplete
|
||||
if (!tags.find((t) => t === 'status')) {
|
||||
tags.push('status');
|
||||
}
|
||||
providerRef.current.setTags(tags);
|
||||
}
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user