Skip to content

Commit

Permalink
feat: add empty operators to explore (#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgrant authored Dec 6, 2024
1 parent 67b1e8e commit eb56714
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeFilterable } from './util'
import type { BasicExploreFilter, BasicExploreInFilterV2, BasicExploreQuery } from './basic'
import type { BasicExploreEmptyFilterV2, BasicExploreFilter, BasicExploreInFilterV2, BasicExploreQuery } from './basic'
import { basicExploreAggregations, queryableBasicExploreDimensions } from './basic'

export const queryableExploreDimensions = [
Expand All @@ -23,6 +23,10 @@ export interface ExploreInFilterV2 extends Omit<BasicExploreInFilterV2, 'field'>
field: FilterableExploreDimensions
}

export interface ExploreEmptyFilterV2 extends Omit<BasicExploreEmptyFilterV2, 'field'> {
field: FilterableExploreDimensions
}

export const exploreAggregations = [
...basicExploreAggregations,
'response_latency_p99',
Expand All @@ -48,7 +52,7 @@ export const exploreAggregations = [

export type ExploreAggregations = typeof exploreAggregations[number]

export type ExploreFilterAll = ExploreFilter | ExploreInFilterV2
export type ExploreFilterAll = ExploreFilter | ExploreInFilterV2 | ExploreEmptyFilterV2

export interface ExploreQuery extends Omit<BasicExploreQuery, 'metrics' | 'dimensions' | 'filters'> {
metrics?: ExploreAggregations[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeFilterable } from './util'
import type { BasicExploreFilter, BasicExploreInFilterV2, BasicExploreQuery } from './basic'
import type { BasicExploreEmptyFilterV2, BasicExploreFilter, BasicExploreInFilterV2, BasicExploreQuery } from './basic'

export const queryableAiExploreDimensions = [
'control_plane',
Expand Down Expand Up @@ -31,6 +31,10 @@ export interface AiExploreInFilterV2 extends Omit<BasicExploreInFilterV2, 'field
field: FilterableAiExploreDimensions
}

export interface AiExploreEmptyFilterV2 extends Omit<BasicExploreEmptyFilterV2, 'field'> {
field: FilterableAiExploreDimensions
}

export const aiExploreAggregations = [
'total_tokens',
'prompt_tokens',
Expand All @@ -46,7 +50,7 @@ export const aiExploreAggregations = [

export type AiExploreAggregations = typeof aiExploreAggregations[number]

export type AiExploreFilterAll = AiExploreFilter | AiExploreInFilterV2
export type AiExploreFilterAll = AiExploreFilter | AiExploreInFilterV2 | AiExploreEmptyFilterV2

export interface AiExploreQuery extends Omit<BasicExploreQuery, 'metrics' | 'dimensions' | 'filters'> {
metrics?: AiExploreAggregations[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeFilterable } from './util'
import type { ExploreFilterTypesV2, GranularityValues, TimeRangeV4 } from './common'
import type { ExploreFilterTypesV2, GranularityValues, RequestFilterTypeEmptyV2, TimeRangeV4 } from './common'

export const queryableBasicExploreDimensions = [
'api_product',
Expand Down Expand Up @@ -32,6 +32,10 @@ export interface BasicExploreInFilterV2 {
value: (string | number | null)[]
}

export interface BasicExploreEmptyFilterV2 {
operator: RequestFilterTypeEmptyV2
field: FilterableBasicExploreDimensions
}
export const basicExploreAggregations = [
'active_services',
'request_count',
Expand All @@ -41,7 +45,7 @@ export const basicExploreAggregations = [

export type BasicExploreAggregations = typeof basicExploreAggregations[number]

export type BasicExploreFilterAll = BasicExploreFilter | BasicExploreInFilterV2
export type BasicExploreFilterAll = BasicExploreFilter | BasicExploreInFilterV2 | BasicExploreEmptyFilterV2

export interface BasicExploreQuery {
metrics?: BasicExploreAggregations[]
Expand Down

0 comments on commit eb56714

Please sign in to comment.