Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
286d508
Deprecate default metric
gmarouli Feb 4, 2026
fe48c91
Add warning to the downsampling tests
gmarouli Feb 4, 2026
bf05f7f
Update apm
gmarouli Feb 4, 2026
9a05aa9
Update esql tests
gmarouli Feb 5, 2026
61194f6
Update transport downsample action to not use `default_metric` when p…
gmarouli Feb 5, 2026
a8aed21
Add warning to `yamlRestCompat` tests
gmarouli Feb 5, 2026
031c183
Add warning to more tests
gmarouli Feb 5, 2026
a948ef5
Fix esql java rest tests
gmarouli Feb 5, 2026
7782ae0
Remove usages of delegateField apart from exists queries
gmarouli Feb 5, 2026
7165e43
Adding the warning handler to more cases
gmarouli Feb 5, 2026
55d4c54
more fixes
gmarouli Feb 5, 2026
0458d5d
more fixes
gmarouli Feb 5, 2026
3c584d2
Merge branch 'main' into deprecate-aggregate-metric-double-default-me…
gmarouli Feb 5, 2026
8e7a438
[CI] Auto commit changes from spotless
Feb 5, 2026
d27c372
Fix accidental test skipping
gmarouli Feb 5, 2026
080c5ea
Deal with warning
gmarouli Feb 5, 2026
1e4df9f
Merge branch 'main' into deprecate-aggregate-metric-double-default-me…
gmarouli Feb 6, 2026
951b426
Merge branch 'main' into deprecate-aggregate-metric-double-default-me…
gmarouli Feb 6, 2026
1c1b73a
Add comments
gmarouli Feb 6, 2026
035f91a
Update docs/changelog/141877.yaml
gmarouli Feb 6, 2026
d08deb7
Revert removal of `isFieldWithinQuery`
gmarouli Feb 6, 2026
c5e8810
Merge branch 'main' into deprecate-aggregate-metric-double-default-me…
gmarouli Feb 10, 2026
040e8b8
Merge branch 'main' into deprecate-aggregate-metric-double-default-me…
gmarouli Feb 12, 2026
1e252e5
Do not use only max as default.
gmarouli Feb 12, 2026
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
5 changes: 5 additions & 0 deletions docs/changelog/141877.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
area: Mapping
issues: []
pr: 141877
summary: Deprecate aggregate metric double default metric configuration
type: enhancement
Original file line number Diff line number Diff line change
Expand Up @@ -1998,11 +1998,11 @@ protected static CreateIndexResponse createIndex(String name, Settings settings)
}

protected static CreateIndexResponse createIndex(RestClient client, String name, Settings settings) throws IOException {
return createIndex(client, name, settings, null, null);
return createIndex(client, name, settings, null, null, RequestOptions.DEFAULT);
}

protected static CreateIndexResponse createIndex(RestClient client, String name, Settings settings, String mapping) throws IOException {
return createIndex(client, name, settings, mapping, null);
return createIndex(client, name, settings, mapping, null, RequestOptions.DEFAULT);
}

protected static CreateIndexResponse createIndex(String name, Settings settings, String mapping) throws IOException {
Expand All @@ -2013,9 +2013,30 @@ protected static CreateIndexResponse createIndex(String name, Settings settings,
return createIndex(client(), name, settings, mapping, aliases);
}

protected static CreateIndexResponse createIndex(
String name,
Settings settings,
String mapping,
String aliases,
RequestOptions requestOptions
) throws IOException {
return createIndex(client(), name, settings, mapping, aliases, requestOptions);
}

public static CreateIndexResponse createIndex(RestClient client, String name, Settings settings, String mapping, String aliases)
throws IOException {
return createIndex(client::performRequest, name, settings, mapping, aliases);
return createIndex(client::performRequest, name, settings, mapping, aliases, RequestOptions.DEFAULT);
}

public static CreateIndexResponse createIndex(
RestClient client,
String name,
Settings settings,
String mapping,
String aliases,
RequestOptions requestOptions
) throws IOException {
return createIndex(client::performRequest, name, settings, mapping, aliases, requestOptions);
}

protected static CreateIndexResponse createIndex(
Expand All @@ -2024,6 +2045,17 @@ protected static CreateIndexResponse createIndex(
Settings settings,
String mapping,
String aliases
) throws IOException {
return createIndex(execute, name, settings, mapping, aliases, RequestOptions.DEFAULT);
}

protected static CreateIndexResponse createIndex(
CheckedFunction<Request, Response, IOException> execute,
String name,
Settings settings,
String mapping,
String aliases,
RequestOptions requestOptions
) throws IOException {
final Request request = newXContentRequest(HttpMethod.PUT, "/" + name, (builder, params) -> {
if (settings != null) {
Expand Down Expand Up @@ -2053,6 +2085,7 @@ protected static CreateIndexResponse createIndex(

return builder;
});
request.setOptions(requestOptions);

if (settings != null && settings.getAsBoolean(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true) == false) {
expectSoftDeletesWarning(request, name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
setup:
- skip:
features: allowed_warnings
- do:
cluster.health:
wait_for_events: languid

---
"Test metrics-apm.app-* dynamic mapping":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
bulk:
index: metrics-apm.app.svc1-testing
refresh: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
setup:
- skip:
features: allowed_warnings
- do:
cluster.health:
wait_for_events: languid

---
"Test metrics-apm.internal-* data stream rerouting":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
bulk:
index: metrics-apm.internal-testing
refresh: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
setup:
- skip:
features: [allowed_warnings]
- do:
cluster.health:
wait_for_events: languid
Expand Down Expand Up @@ -220,6 +222,8 @@ setup:
---
"Test logs @custom ingest pipelines":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
bulk:
refresh: true
body:
Expand All @@ -243,6 +247,8 @@ setup:
---
"Test metrics @custom ingest pipelines":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
bulk:
refresh: true
body:
Expand Down Expand Up @@ -294,6 +300,8 @@ setup:
---
"Test traces @custom ingest pipelines":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
bulk:
refresh: true
body:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
setup:
- skip:
features: allowed_warnings
- do:
cluster.health:
wait_for_events: languid

- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
cluster.put_component_template:
name: "metrics@custom"
body:
Expand All @@ -21,6 +25,8 @@ setup:
source: metrics@custom

- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
cluster.put_component_template:
name: "metrics-apm.app@custom"
body:
Expand All @@ -39,6 +45,8 @@ setup:
---
"Test metrics @custom component templates":
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
indices.create_data_stream:
name: metrics-apm.app.svc1-testing
- do:
Expand All @@ -47,6 +55,8 @@ setup:
cluster.health:
wait_for_events: languid
- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
indices.get_field_mapping:
index: metrics-apm.app.svc1-testing
fields: custom_field*
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ tasks.named("yamlRestCompatTestTransform").configure(
task.skipTest("esql/192_lookup_join_on_aliases/alias-pattern-single", "New SORT warning not in original test")
task.skipTest("ml/data_frame_analytics_crud/Test put config with remote source index", "Error message changed")
task.skipTest("esql/40_tsdb/PromQL irate on counter field", "We filter out null values now")
// Expected deprecation warning to compat yaml tests:
task.addAllowedWarningRegex("Parameter \\[default_metric\\] is deprecated and will be removed in a future version")
task.skipTest("aggregate-metrics/40_avg_agg/Test avg agg with query", "Default metric cannot be defined, so the query is empty")
task.skipTest("aggregate-metrics/30_sum_agg/Test sum agg with query", "Default metric cannot be defined, so the query is empty")
task.skipTest("aggregate-metrics/50_value_count_agg/Test value_count agg with query", "Default metric cannot be defined, so the query is empty")
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
* Provides the XPack features that this version of the code supports
*/
public class XPackFeatures implements FeatureSpecification {

public static final NodeFeature AGGREGATE_METRIC_DOUBLE_DEPRECATED_DEFAULT_METRIC = new NodeFeature(
"aggregate_metric_double.default_metric.deprecated"
);

@Override
public Set<NodeFeature> getFeatures() {
return Set.of();
return Set.of(AGGREGATE_METRIC_DOUBLE_DEPRECATED_DEFAULT_METRIC);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ setup:
- requires:
cluster_features: ["gte_v8.10.0"]
reason: "Downsampling executed using persistent task framework from version 8.10"
test_runner_features: allowed_warnings

- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
indices.downsample:
index: test
target_index: test-downsample
Expand Down
9 changes: 9 additions & 0 deletions x-pack/plugin/downsample/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,12 @@ configurations {
artifacts {
basicRestSpecs(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
}

tasks.named("yamlRestCompatTestTransform").configure({ task ->
// Expected deprecation warning to compat yaml tests:
task.addAllowedWarningRegex("Parameter \\[default_metric\\] is deprecated and will be removed in a future version")
task.skipTest("downsample/10_basic/Downsample a downsampled index", "Default metric has been removed")
task.skipTest("downsample/10_basic/Downsample histogram as label", "Default metric has been removed")
task.skipTest("downsample/10_basic/Downsample index", "Default metric has been removed")
task.skipTest("downsample-with-security/10_basic/Downsample index", "Default metric has been removed")
})
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,11 @@ setup:
- requires:
cluster_features: ["gte_v8.13.0"]
reason: _tsid hashing introduced in 8.13
test_runner_features: allowed_warnings

- do:
allowed_warnings:
- "Parameter [default_metric] is deprecated and will be removed in a future version"
indices.downsample:
index: test
target_index: test-downsample
Expand Down Expand Up @@ -355,7 +358,6 @@ setup:
- match: { test-downsample.mappings.properties.@timestamp.meta.time_zone: UTC }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.type: aggregate_metric_double }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.metrics: [ "min", "max", "sum", "value_count" ] }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.default_metric: max }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.time_series_metric: gauge }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-counter.type: long }
- match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-counter.time_series_metric: counter }
Expand Down
Loading