mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Search using TraceQL improvements (#64616)
* Added scope to filter * Intrinsic fields don't have scope * Consistent plus button placement next to the last tag. Changed All Scopes to "unscoped" * Added validation to duration fields * Disable options load when dropdown is opened * Use focused list of operators when all values are of type string or int/float * Fixed and added tests * Fix another test * Better way to prevent duplicate and redundant backend requests when a filter updates
This commit is contained in:
@@ -9,6 +9,13 @@
|
||||
|
||||
package dataquery
|
||||
|
||||
// Defines values for TempoQueryFiltersScope.
|
||||
const (
|
||||
TempoQueryFiltersScopeResource TempoQueryFiltersScope = "resource"
|
||||
TempoQueryFiltersScopeSpan TempoQueryFiltersScope = "span"
|
||||
TempoQueryFiltersScopeUnscoped TempoQueryFiltersScope = "unscoped"
|
||||
)
|
||||
|
||||
// Defines values for TempoQueryFiltersType.
|
||||
const (
|
||||
TempoQueryFiltersTypeDynamic TempoQueryFiltersType = "dynamic"
|
||||
@@ -26,6 +33,13 @@ const (
|
||||
TempoQueryTypeUpload TempoQueryType = "upload"
|
||||
)
|
||||
|
||||
// Defines values for TraceqlFilterScope.
|
||||
const (
|
||||
TraceqlFilterScopeResource TraceqlFilterScope = "resource"
|
||||
TraceqlFilterScopeSpan TraceqlFilterScope = "span"
|
||||
TraceqlFilterScopeUnscoped TraceqlFilterScope = "unscoped"
|
||||
)
|
||||
|
||||
// Defines values for TraceqlFilterType.
|
||||
const (
|
||||
TraceqlFilterTypeDynamic TraceqlFilterType = "dynamic"
|
||||
@@ -38,6 +52,13 @@ const (
|
||||
TraceqlSearchFilterTypeStatic TraceqlSearchFilterType = "static"
|
||||
)
|
||||
|
||||
// Defines values for TraceqlSearchScope.
|
||||
const (
|
||||
TraceqlSearchScopeResource TraceqlSearchScope = "resource"
|
||||
TraceqlSearchScopeSpan TraceqlSearchScope = "span"
|
||||
TraceqlSearchScopeUnscoped TraceqlSearchScope = "unscoped"
|
||||
)
|
||||
|
||||
// TempoDataQuery defines model for TempoDataQuery.
|
||||
type TempoDataQuery = map[string]interface{}
|
||||
|
||||
@@ -55,6 +76,9 @@ type TempoQuery struct {
|
||||
// The operator that connects the tag to the value, for example: =, >, !=, =~
|
||||
Operator *string `json:"operator,omitempty"`
|
||||
|
||||
// The scope of the filter, can either be unscoped/all scopes, resource or span
|
||||
Scope *TempoQueryFiltersScope `json:"scope,omitempty"`
|
||||
|
||||
// The tag for the search filter, for example: .http.status_code, .service.name, status
|
||||
Tag *string `json:"tag,omitempty"`
|
||||
|
||||
@@ -107,6 +131,9 @@ type TempoQuery struct {
|
||||
SpanName *string `json:"spanName,omitempty"`
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -121,6 +148,9 @@ type TraceqlFilter struct {
|
||||
// The operator that connects the tag to the value, for example: =, >, !=, =~
|
||||
Operator *string `json:"operator,omitempty"`
|
||||
|
||||
// The scope of the filter, can either be unscoped/all scopes, resource or span
|
||||
Scope *TraceqlFilterScope `json:"scope,omitempty"`
|
||||
|
||||
// The tag for the search filter, for example: .http.status_code, .service.name, status
|
||||
Tag *string `json:"tag,omitempty"`
|
||||
|
||||
@@ -134,8 +164,14 @@ type TraceqlFilter struct {
|
||||
ValueType *string `json:"valueType,omitempty"`
|
||||
}
|
||||
|
||||
// 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.
|
||||
type TraceqlSearchScope string
|
||||
|
||||
Reference in New Issue
Block a user