Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add empty operators to explore #1836

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading