Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('Trace metric timeseries data source model', () => {
requestType: EXPLORE_GQL_REQUEST,
timeRange: new GraphQlTimeRange(testTimeRange.startTime, testTimeRange.endTime),
context: ObservabilityTraceType.Api,
filters: [],
interval: testInterval,
limit: 10000,
selections: [model.specification]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ import {
GraphQlExploreResult
} from '../../../../graphql/request/handlers/explore/explore-query';
import { GraphQlDataSourceModel } from '../graphql-data-source.model';
import { GraphQlFilter } from './../../../../graphql/model/schema/filter/graphql-filter';

export abstract class TraceSeriesValuesDataSourceModel<TData> extends GraphQlDataSourceModel<TData> {
protected abstract specification: ExploreSpecification;

protected fetchSpecificationData(interval: TimeDuration): Observable<GraphQlExploreResult[]> {
return this.query<ExploreGraphQlQueryHandlerService>(() => this.buildRequest(interval)).pipe(
map(response => response.results)
);
return this.query<ExploreGraphQlQueryHandlerService>(inheritedFilters =>
this.buildRequest(interval, inheritedFilters)
).pipe(map(response => response.results));
}

private buildRequest(interval: TimeDuration): GraphQlExploreRequest {
private buildRequest(interval: TimeDuration, inheritedFilters: GraphQlFilter[] = []): GraphQlExploreRequest {
return {
requestType: EXPLORE_GQL_REQUEST,
timeRange: this.getTimeRangeOrThrow(),
context: ObservabilityTraceType.Api,
interval: interval,
filters: [...inheritedFilters],
limit: 10000,
selections: [this.specification]
};
Expand Down