Tempo: TraceQL Configurable static fields (#65284)

* TraceQL - configurable static fields for new UI

* TraceQL - filter out static fields from Tags section. Added tooltip to static fields

* Add more units to duration validation. Improve duration field tooltip with accepted units

* Better control of delete button on SearchField

* Move new config behind feature toggle

* Special title for intrinsic "name"

* Fix tests

* Move static fields not in the datasource to the Tags section

* Start using the useAsync hook in the Tempo TraceQL configuration page to retrieve the tags and datasource

* Fix tests

* Fix test. Use useAsync to retrieve options in SearchField

* Remove ability to set a default value in filter configuration.
Removed type from filter, dynamic filters are now any filters not present in the datasource config

* Updated the static filters tooltip

* Replace useState + useEffect with useMemo for scopedTag
This commit is contained in:
Andre Pereira
2023-03-31 10:35:37 +01:00
committed by GitHub
parent fb83414b6a
commit 541a03f33b
18 changed files with 425 additions and 222 deletions
@@ -16,12 +16,6 @@ const (
TempoQueryFiltersScopeUnscoped TempoQueryFiltersScope = "unscoped"
)
// Defines values for TempoQueryFiltersType.
const (
TempoQueryFiltersTypeDynamic TempoQueryFiltersType = "dynamic"
TempoQueryFiltersTypeStatic TempoQueryFiltersType = "static"
)
// Defines values for TempoQueryType.
const (
TempoQueryTypeClear TempoQueryType = "clear"
@@ -40,18 +34,6 @@ const (
TraceqlFilterScopeUnscoped TraceqlFilterScope = "unscoped"
)
// Defines values for TraceqlFilterType.
const (
TraceqlFilterTypeDynamic TraceqlFilterType = "dynamic"
TraceqlFilterTypeStatic TraceqlFilterType = "static"
)
// Defines values for TraceqlSearchFilterType.
const (
TraceqlSearchFilterTypeDynamic TraceqlSearchFilterType = "dynamic"
TraceqlSearchFilterTypeStatic TraceqlSearchFilterType = "static"
)
// Defines values for TraceqlSearchScope.
const (
TraceqlSearchScopeResource TraceqlSearchScope = "resource"
@@ -82,9 +64,6 @@ type TempoQuery struct {
// The tag for the search filter, for example: .http.status_code, .service.name, status
Tag *string `json:"tag,omitempty"`
// The type of the filter, can either be static (pre defined in the UI) or dynamic
Type TempoQueryFiltersType `json:"type"`
// The value for the search filter
Value *interface{} `json:"value,omitempty"`
@@ -134,9 +113,6 @@ type TempoQuery struct {
// The scope of the filter, can either be unscoped/all scopes, resource or span
type TempoQueryFiltersScope string
// The type of the filter, can either be static (pre defined in the UI) or dynamic
type TempoQueryFiltersType string
// TempoQueryType search = Loki search, nativeSearch = Tempo search for backwards compatibility
type TempoQueryType string
@@ -154,9 +130,6 @@ type TraceqlFilter struct {
// The tag for the search filter, for example: .http.status_code, .service.name, status
Tag *string `json:"tag,omitempty"`
// The type of the filter, can either be static (pre defined in the UI) or dynamic
Type TraceqlFilterType `json:"type"`
// The value for the search filter
Value *interface{} `json:"value,omitempty"`
@@ -167,11 +140,5 @@ type TraceqlFilter struct {
// The scope of the filter, can either be unscoped/all scopes, resource or span
type TraceqlFilterScope string
// The type of the filter, can either be static (pre defined in the UI) or dynamic
type TraceqlFilterType string
// TraceqlSearchFilterType static fields are pre-set in the UI, dynamic fields are added by the user
type TraceqlSearchFilterType string
// TraceqlSearchScope defines model for TraceqlSearchScope.
// TraceqlSearchScope static fields are pre-set in the UI, dynamic fields are added by the user
type TraceqlSearchScope string