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

Always report dimension and time series metric attributes in field caps api #93749

Closed
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
5 changes: 5 additions & 0 deletions docs/changelog/93749.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 93749
summary: Always report dimension and time series metric attributes in field caps api
area: TSDB
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ can't shadow metrics:
# Test that _tsid field is not added if an index is not a time-series index
no _tsid in standard indices:
- skip:
version: " - 8.4.99"
reason: time series params only on time series indices introduced in 8.5.0
version: " - 8.7.99"
reason: field caps api was changed to include time series attributes in non tsdb indices

- do:
indices.create:
Expand Down Expand Up @@ -209,7 +209,7 @@ no _tsid in standard indices:
- is_false: fields.metricset.keyword.non_searchable_indices
- is_false: fields.metricset.keyword.non_aggregatable_indices
- is_false: fields._tsid # _tsid metadata field must not exist in non-time-series indices
- is_false: fields.metricset.keyword.time_series_dimension # time_series_dimension param is ignored in non-time-series indices
- match: {fields.metricset.keyword.time_series_dimension: true}

---
no nested dimensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ field caps on time_series indices:
---
field caps on standard indices:
- skip:
version: " - 8.3.99"
reason: metric params only on time series indexes introduced in 8.4.0
version: " - 8.7.99"
reason: field caps api was changed to include time series attributes in non tsdb indices

- do:
field_caps:
Expand All @@ -162,7 +162,7 @@ field caps on standard indices:
- match: { fields.metricset.keyword.type: keyword }
- match: { fields.metricset.keyword.searchable: true }
- match: { fields.metricset.keyword.aggregatable: true }
- is_false: fields.metricset.keyword.time_series_dimension
- match: { fields.metricset.keyword.time_series_dimension: true }
- is_false: fields.metricset.keyword.non_dimension_indices
- is_false: fields.metricset.keyword.indices
- is_false: fields.metricset.keyword.non_searchable_indices
Expand All @@ -173,7 +173,7 @@ field caps on standard indices:
- match: { fields.k8s\.pod\.network\.rx.long.type: long }
- match: { fields.k8s\.pod\.network\.rx.long.searchable: true }
- match: { fields.k8s\.pod\.network\.rx.long.aggregatable: true }
- is_false: fields.k8s\.pod\.network\.rx.long.time_series_metric
- match: { fields.k8s\.pod\.network\.rx.long.time_series_metric: gauge }
- is_false: fields.k8s\.pod\.network\.rx.long.metric_conflicts_indices
- is_false: fields.k8s\.pod\.network\.rx.long.indices
- is_false: fields.k8s\.pod\.network\.rx.long.non_searchable_indices
Expand All @@ -183,7 +183,7 @@ field caps on standard indices:
- match: { fields.k8s\.pod\.network\.tx.long.type: long }
- match: { fields.k8s\.pod\.network\.tx.long.searchable: true }
- match: { fields.k8s\.pod\.network\.tx.long.aggregatable: true }
- is_false: fields.k8s\.pod\.network\.tx.long.time_series_metric
- match: { fields.k8s\.pod\.network\.tx.long.time_series_metric: counter }
- is_false: fields.k8s\.pod\.network\.tx.long.metric_conflicts_indices
- is_false: fields.k8s\.pod\.network\.tx.long.indices
- is_false: fields.k8s\.pod\.network\.tx.long.non_searchable_indices
Expand All @@ -194,8 +194,8 @@ field caps on standard indices:
---
field caps on mixed indices:
- skip:
version: " - 8.3.99"
reason: metric params only on time series indexes introduced in 8.4.0
version: " - 8.7.99"
reason: field caps api was changed to include time series attributes in non tsdb indices

- do:
field_caps:
Expand All @@ -205,26 +205,26 @@ field caps on mixed indices:
- match: { fields.metricset.keyword.type: keyword }
- match: { fields.metricset.keyword.searchable: true }
- match: { fields.metricset.keyword.aggregatable: true }
- is_false: fields.metricset.keyword.time_series_dimension
- match: { fields.metricset.keyword.non_dimension_indices: [ "test_non_time_series" ] }
- match: { fields.metricset.keyword.time_series_dimension: true }
- is_false: fields.metricset.keyword.non_dimension_indices
- is_false: fields.metricset.keyword.indices
- is_false: fields.metricset.keyword.non_searchable_indices
- is_false: fields.metricset.keyword.non_aggregatable_indices

- match: { fields.k8s\.pod\.network\.rx.long.type: long }
- match: { fields.k8s\.pod\.network\.rx.long.searchable: true }
- match: { fields.k8s\.pod\.network\.rx.long.aggregatable: true }
- match: { fields.k8s\.pod\.network\.rx.long.metric_conflicts_indices: [ "test_non_time_series", "test_time_series" ] }
- is_false: fields.k8s\.pod\.network\.rx.long.time_series_metric
- is_false: fields.k8s\.pod\.network\.rx.long.metric_conflicts_indices
- match: { fields.k8s\.pod\.network\.rx.long.time_series_metric: gauge }
- is_false: fields.k8s\.pod\.network\.rx.long.non_searchable_indices
- is_false: fields.k8s\.pod\.network\.rx.long.non_aggregatable_indices
- is_false: fields.k8s\.pod\.network\.rx.long.indices

- match: { fields.k8s\.pod\.network\.tx.long.type: long }
- match: { fields.k8s\.pod\.network\.tx.long.searchable: true }
- match: { fields.k8s\.pod\.network\.tx.long.aggregatable: true }
- match: { fields.k8s\.pod\.network\.tx.long.metric_conflicts_indices: [ "test_non_time_series", "test_time_series" ] }
- is_false: fields.k8s\.pod\.network\.tx.long.time_series_metric
- is_false: fields.k8s\.pod\.network\.tx.long.metric_conflicts_indices
- match: { fields.k8s\.pod\.network\.tx.long.time_series_metric: counter }
- is_false: fields.k8s\.pod\.network\.tx.long.non_searchable_indices
- is_false: fields.k8s\.pod\.network\.tx.long.non_aggregatable_indices
- is_false: fields.k8s\.pod\.network\.tx.long.indices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ static Map<String, IndexFieldCapabilities> retrieveFieldCaps(
boolean includeParentObjects = checkIncludeParents(filters);

Predicate<MappedFieldType> filter = buildFilter(indexFieldfilter, filters, types, context);
boolean isTimeSeriesIndex = context.getIndexSettings().getTimestampBounds() != null;
Map<String, IndexFieldCapabilities> responseMap = new HashMap<>();
for (String field : fieldNames) {
MappedFieldType ft = context.getFieldType(field);
Expand All @@ -123,8 +122,8 @@ static Map<String, IndexFieldCapabilities> retrieveFieldCaps(
context.isMetadataField(field),
ft.isSearchable(),
ft.isAggregatable(),
isTimeSeriesIndex ? ft.isDimension() : false,
isTimeSeriesIndex ? ft.getMetricType() : null,
ft.isDimension(),
ft.getMetricType(),
ft.meta()
);
responseMap.put(field, fieldCap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ field caps on time series indices:
# Test field_caps on mixed standard and time-series (mix of raw and rollup) indices
field caps on all indices:
- skip:
version: " - 8.4.99"
reason: metric params only on time series indices introduced in 8.5.0
version: " - 8.7.99"
reason: field caps api was changed to include time series attributes in non tsdb indices

- do:
field_caps:
Expand All @@ -195,10 +195,10 @@ field caps on all indices:
- match: { fields.metric.double.searchable: true }
- match: { fields.metric.double.aggregatable: true }
- match: { fields.metric.double.indices: [ "test_non_time_series", "test_time_series" ] }
- match: { fields.metric.double.metric_conflicts_indices: [ "test_non_time_series", "test_time_series" ] }
- is_false: fields.metric.double.metric_conflicts_indices
- is_false: fields.metric.double.non_searchable_indices
- is_false: fields.metric.double.non_aggregatable_indices
- is_false: fields.metric.double.time_series_metric
- match: { fields.metric.double.time_series_metric: gauge }

- match: { fields.metric.aggregate_metric_double.type: aggregate_metric_double }
- match: { fields.metric.aggregate_metric_double.searchable: true }
Expand Down