Skip to content
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
Expand Up @@ -8,7 +8,7 @@
package org.elasticsearch.xpack.esql.qa.rest.generative;

import org.elasticsearch.xpack.esql.CsvSpecReader;
import org.elasticsearch.xpack.esql.action.PromqlFeatures;
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
import org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase;

import java.io.IOException;
Expand Down Expand Up @@ -74,7 +74,7 @@ protected void shouldSkipTest(String testName) throws IOException {

assumeFalse(
"Tests using PROMQL are not supported for now",
testCase.requiredCapabilities.contains(PromqlFeatures.capabilityName())
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.PROMQL_COMMAND_V0.capabilityName())
);

assumeFalse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ false | two | 2024-05-10T00:22:00.000Z
;

absent_over_time_events_received_promql-Ignore
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0

PROMQL index=k8s step=2m is_absent=(max by (pod) (absent_over_time(events_received{cluster="prod",pod="two"}[2m])))
| SORT step | LIMIT 10;
Expand Down Expand Up @@ -50,7 +50,7 @@ false | staging | 2024-05-10T00:20:00.000Z
;

absent_over_time_of_long_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0

PROMQL index=k8s step=10m is_absent=(max by (cluster) (absent_over_time(network.bytes_in[10m])))
| SORT cluster, step | LIMIT 10;
Expand Down Expand Up @@ -84,7 +84,7 @@ false | staging | 2024-05-10T00:20:00.000Z
;

absent_over_time_of_boolean_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0

PROMQL index=k8s step=10m is_absent=(max by (cluster) (absent_over_time(network.eth0.up[10m])))
| SORT step, cluster | LIMIT 10;
Expand Down Expand Up @@ -166,7 +166,7 @@ false | staging | 2024-05-10T00:20:00.000Z
;

absent_over_time_of_integer_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0

PROMQL index=k8s step=10m is_absent=(max by (cluster) (absent_over_time(network.eth0.currently_connected_clients[10m])))
| SORT step, cluster | LIMIT 10;
Expand Down Expand Up @@ -313,7 +313,7 @@ false | staging | 2024-05-10T00:20:00.000Z
;

absent_over_time_with_filtering_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0

PROMQL index=k8s step=10m is_absent=(max by (cluster) (absent_over_time(network.bytes_in{pod!="three"}[10m])))
| SORT step, cluster | LIMIT 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// scalar-scalar tests

addition_scalar_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h sum=(1+1);

sum:double | step:datetime
Expand Down Expand Up @@ -33,7 +33,7 @@ network_in_bits:long | _timeseries:keyword
;

multiplication_metric_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h network_in_bits=(network.total_bytes_in * 8)
| SORT network_in_bits DESC;

Expand Down Expand Up @@ -71,7 +71,7 @@ network_in_bits:long | _timeseries:keyword
;

multiplication_within_series_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h network_in_bits=(last_over_time(network.total_bytes_in[1h]) * 8)
| SORT network_in_bits DESC;

Expand Down Expand Up @@ -99,7 +99,7 @@ max_bits:long | step:datetime
;

across_series_multiplication_metric_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max(network.total_bytes_in * 8)
) | SORT max_bits DESC;
Expand All @@ -120,7 +120,7 @@ max_bits:long | step:datetime
;

multiplication_across_series_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max(network.total_bytes_in) * 8
) | SORT max_bits DESC;
Expand All @@ -143,7 +143,7 @@ max_bits:long | TBUCKET(1h):datetime | cluster:keyword
;

across_series_grouping_multiplication_within_series_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max by (cluster) (last_over_time(network.total_bytes_in[1h]) * 8)
) | SORT max_bits DESC;
Expand All @@ -168,7 +168,7 @@ max_bits:long | TBUCKET(1h):date | cluster:keyword
;

across_series_grouping_multiplication_metric_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max by (cluster) (network.total_bytes_in * 8)
) | SORT max_bits DESC;
Expand All @@ -193,7 +193,7 @@ max_bits:long | step:datetime | cluster:keyword
;

multiplication_across_series_grouping_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max by (cluster) (network.total_bytes_in) * 8
) | SORT max_bits DESC;
Expand All @@ -218,7 +218,7 @@ max_bits:long | step:datetime | cluster:keyword
;

multiplication_across_series_grouping_within_series_scalar_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max_bits=(
max by (cluster) (last_over_time(network.total_bytes_in[1h])) * 8
)
Expand All @@ -240,7 +240,7 @@ max:long
;

addition_scalar_inner_and_outer_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h max=(10 + max(10 + network.total_bytes_in))
| KEEP max;

Expand Down Expand Up @@ -273,7 +273,7 @@ in_n_out:long | _timeseries:keyword
;

addition_metric_metric_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h in_n_out=(network.eth0.rx + network.eth0.tx)
| SORT in_n_out DESC;

Expand Down Expand Up @@ -304,7 +304,7 @@ div:long | step:datetime | cluster:keyword
;

division_metric_metric_grouping_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h div=(
max by (cluster) (network.total_bytes_in / network.total_bytes_in)
)
Expand All @@ -329,7 +329,7 @@ div:long | step:datetime | cluster:keyword
;

division_metric_metric_grouping_filtering_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h div=(
max by (cluster) (network.total_bytes_in{cluster!="prod"} / network.total_bytes_in{cluster!="staging"})
) | SORT cluster;
Expand All @@ -356,7 +356,7 @@ div:double | step:datetime | cluster:keyword
;

division_within_series_grouping_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h div=(
max by (cluster) (rate(network.total_bytes_in[1h]) / rate(network.total_bytes_in[1h]))
) | SORT cluster;
Expand Down Expand Up @@ -386,7 +386,7 @@ ratio:double | step:datetime | cluster:keyword
;

tx_ratio_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h ratio=(
max by (cluster) (
network.eth0.tx /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cost:double | time_bucket:datetime
;

avg_over_time_of_double_no_grouping_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1m cost=(sum(avg_over_time(network.cost[1m])))
| SORT cost DESC, step DESC | LIMIT 10;

Expand Down Expand Up @@ -46,7 +46,7 @@ cost:double | time_bucket:datetime
;

avg_over_time_of_double_no_grouping_single_bucket_promql
required_capability: promql_pre_tech_preview_v14
required_capability: promql_command_v0
PROMQL index=k8s step=1h cost=(sum(avg_over_time(network.cost[1h])));

cost:double | step:datetime
Expand Down
Loading