Skip to content

Commit

Permalink
Release time series aggegations as tech preview (#93546)
Browse files Browse the repository at this point in the history
Make time_series aggregation and rate aggregation (on counter fields) available without using the time series feature flag. This change makes these aggregations available as tech preview.
  • Loading branch information
martijnvg committed Feb 7, 2023
1 parent 815e6d7 commit 33c9636
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
15 changes: 15 additions & 0 deletions docs/changelog/93546.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pr: 93546
summary: Release time_series and rate (on counter fields) aggegations as tech preview
area: TSDB
type: feature
issues: []
highlight:
title: Release time_series and rate (on counter fields) aggegations as tech preview
body: |-
Make `time_series` aggregation and `rate` aggregation (on counter
fields) available without using the time series feature flag. This
change makes these aggregations available as tech preview.
Currently there is no documentation about the `time_series` aggregation.
This will be added in a followup change.
notable: true
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.elasticsearch.aggregations.pipeline.DerivativePipelineAggregationBuilder;
import org.elasticsearch.aggregations.pipeline.MovFnPipelineAggregationBuilder;
import org.elasticsearch.aggregations.pipeline.MovingFunctionScript;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.plugins.SearchPlugin;
Expand Down Expand Up @@ -55,15 +54,10 @@ public List<AggregationSpec> getAggregations() {
new AggregationSpec(MatrixStatsAggregationBuilder.NAME, MatrixStatsAggregationBuilder::new, new MatrixStatsParser())
.addResultReader(InternalMatrixStats::new)
);
if (IndexSettings.isTimeSeriesModeEnabled()) {
specs.add(
new AggregationSpec(
TimeSeriesAggregationBuilder.NAME,
TimeSeriesAggregationBuilder::new,
TimeSeriesAggregationBuilder.PARSER
).addResultReader(InternalTimeSeries::new)
);
}
specs.add(
new AggregationSpec(TimeSeriesAggregationBuilder.NAME, TimeSeriesAggregationBuilder::new, TimeSeriesAggregationBuilder.PARSER)
.addResultReader(InternalTimeSeries::new)
);
return List.copyOf(specs);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ private void parseSource(DefaultSearchContext context, SearchSourceBuilder sourc
context::isCancelled,
context::buildFilteredQuery,
enableRewriteAggsToFilterByFilter,
IndexSettings.isTimeSeriesModeEnabled() && source.aggregations().isInSortOrderExecutionRequired()
source.aggregations().isInSortOrderExecutionRequired()
);
context.addReleasable(aggContext);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.MapperPlugin;
Expand Down Expand Up @@ -136,9 +135,7 @@ private AggregationSpec rateAggregation() {
RateAggregationBuilder::new,
usage.track(AnalyticsStatsAction.Item.RATE, RateAggregationBuilder.PARSER)
).addResultReader(InternalRate::new).setAggregatorRegistrar(RateAggregationBuilder::registerAggregators);
if (IndexSettings.isTimeSeriesModeEnabled()) {
rate.addResultReader(InternalResetTrackingRate.NAME, InternalResetTrackingRate::new);
}
rate.addResultReader(InternalResetTrackingRate.NAME, InternalResetTrackingRate::new);
return rate;
}

Expand Down

0 comments on commit 33c9636

Please sign in to comment.