-
Notifications
You must be signed in to change notification settings - Fork 25k
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
TSDB: Add time series information to field caps #78790
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
58bc365
Add time series information to field caps
imotov e0da632
Fix tests
imotov 3a3b535
Address review comments
imotov 66ed887
Merge remote-tracking branch 'elastic/master' into tsdb-add-field-cap…
imotov 9ef464a
Fix javadoc
imotov ffdb382
Fix serialization
imotov 91afda5
Fix mertric_conflicts_indices generation after refactoring and add te…
imotov 155e64f
Address the second round of review comments
imotov 22abdeb
Improve docs
imotov e788a01
Merge remote-tracking branch 'elastic/master' into tsdb-add-field-cap…
imotov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,12 @@ field types are all described as the `keyword` type family. | |
`aggregatable`:: | ||
Whether this field can be aggregated on all indices. | ||
|
||
`time_series_dimension`:: | ||
Whether this field is used as a time series dimension. | ||
|
||
`time_series_metric`:: | ||
Contains metric type if this fields is used as a time series metrics, null if the field is not used as metric. | ||
|
||
`indices`:: | ||
The list of indices where this field has the same type family, or null if all indices | ||
have the same type family for the field. | ||
|
@@ -123,6 +129,14 @@ field types are all described as the `keyword` type family. | |
The list of indices where this field is not aggregatable, or null if all | ||
indices have the same definition for the field. | ||
|
||
`non_dimension_indices`:: | ||
The list of indices where this field is not marked as a dimension field, or null if all | ||
indices have the same definition for the field. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a more obvious way of saying this could be "If this is present in response then some indices have the field marked as a dimension and other indices, the ones in this list, do not." |
||
|
||
`metric_conflicts_indices`:: | ||
The list of indices where this field is present if these indices don't have the same `time_series_metric` value for | ||
this field. | ||
|
||
`meta`:: | ||
Merged metadata across all indices as a map of string keys to arrays of values. | ||
A value length of 1 indicates that all indices had the same value for this key, | ||
|
@@ -179,7 +193,6 @@ The API returns the following response: | |
"metadata_field": false, | ||
"searchable": true, | ||
"aggregatable": false | ||
|
||
} | ||
} | ||
} | ||
|
231 changes: 231 additions & 0 deletions
231
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/field_caps/40_time_series.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
--- | ||
setup: | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 | ||
|
||
- do: | ||
indices.create: | ||
index: tsdb_index1 | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
time_series_dimension: true | ||
non_tsdb_field: | ||
type: keyword | ||
k8s: | ||
properties: | ||
pod: | ||
properties: | ||
availability_zone: | ||
type: short | ||
time_series_dimension: true | ||
uid: | ||
type: keyword | ||
time_series_dimension: true | ||
name: | ||
type: keyword | ||
ip: | ||
type: ip | ||
time_series_dimension: true | ||
network: | ||
properties: | ||
tx: | ||
type: long | ||
time_series_metric: counter | ||
rx: | ||
type: integer | ||
time_series_metric: gauge | ||
packets_dropped: | ||
type: long | ||
time_series_metric: gauge | ||
latency: | ||
type: double | ||
time_series_metric: gauge | ||
|
||
- do: | ||
indices.create: | ||
index: tsdb_index2 | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
non_tsdb_field: | ||
type: keyword | ||
k8s: | ||
properties: | ||
pod: | ||
properties: | ||
availability_zone: | ||
type: short | ||
time_series_dimension: true | ||
uid: | ||
type: keyword | ||
time_series_dimension: true | ||
name: | ||
type: keyword | ||
ip: | ||
type: ip | ||
time_series_dimension: true | ||
network: | ||
properties: | ||
tx: | ||
type: long | ||
time_series_metric: gauge | ||
rx: | ||
type: integer | ||
packets_dropped: | ||
type: long | ||
time_series_metric: gauge | ||
latency: | ||
type: double | ||
time_series_metric: gauge | ||
|
||
--- | ||
"Get simple time series field caps": | ||
|
||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 | ||
|
||
- do: | ||
field_caps: | ||
index: 'tsdb_index1' | ||
fields: [ "metricset", "non_tsdb_field", "k8s.pod.*" ] | ||
|
||
- match: {fields.metricset.keyword.searchable: true} | ||
- match: {fields.metricset.keyword.aggregatable: true} | ||
- match: {fields.metricset.keyword.time_series_dimension: true} | ||
- is_false: fields.metricset.keyword.time_series_metric | ||
- is_false: fields.metricset.keyword.indices | ||
- is_false: fields.metricset.keyword.non_searchable_indices | ||
- is_false: fields.metricset.keyword.non_aggregatable_indices | ||
- is_false: fields.metricset.keyword.non_dimension_indices | ||
|
||
- match: {fields.non_tsdb_field.keyword.searchable: true} | ||
- match: {fields.non_tsdb_field.keyword.aggregatable: true} | ||
- is_false: fields.non_tsdb_field.keyword.time_series_dimension | ||
- is_false: fields.non_tsdb_field.keyword.time_series_metric | ||
- is_false: fields.non_tsdb_field.keyword.indices | ||
- is_false: fields.non_tsdb_field.keyword.non_searchable_indices | ||
- is_false: fields.non_tsdb_field.keyword.non_aggregatable_indices | ||
- is_false: fields.non_tsdb_field.keyword.non_dimension_indices | ||
|
||
- match: {fields.k8s\.pod\.availability_zone.short.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.availability_zone.short.time_series_metric | ||
- is_false: fields.k8s\.pod\.availability_zone.short.non_dimension_indices | ||
|
||
- match: {fields.k8s\.pod\.uid.keyword.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.uid.keyword.time_series_metric | ||
- is_false: fields.k8s\.pod\.uid.keyword.non_dimension_indices | ||
|
||
- is_false: fields.k8s\.pod\.name.keyword.time_series_dimension | ||
- is_false: fields.k8s\.pod\.name.keyword.time_series_metric | ||
- is_false: fields.k8s\.pod\.name.keyword.non_dimension_indices | ||
|
||
- match: {fields.k8s\.pod\.ip.ip.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.ip.ip.time_series_metric | ||
- is_false: fields.k8s\.pod\.ip.ip.non_dimension_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.tx.long.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.tx.long.time_series_metric: counter} | ||
- is_false: fields.k8s\.pod\.network\.tx.long.non_dimension_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.rx.integer.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.rx.integer.time_series_metric: gauge} | ||
- is_false: fields.k8s\.pod\.network\.rx.integer.non_dimension_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.packets_dropped.long.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.packets_dropped.long.time_series_metric: gauge} | ||
- is_false: fields.k8s\.pod\.network\.packets_dropped.long.non_dimension_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.latency.double.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.latency.double.time_series_metric: gauge} | ||
- is_false: fields.k8s\.pod\.network\.latency.double.non_dimension_indices | ||
|
||
--- | ||
"Get time series field caps with conflicts": | ||
|
||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 | ||
|
||
- do: | ||
field_caps: | ||
index: tsdb_index1,tsdb_index2 | ||
fields: [ "metricset", "non_tsdb_field", "k8s.pod.*" ] | ||
|
||
- match: {fields.metricset.keyword.searchable: true} | ||
- match: {fields.metricset.keyword.aggregatable: true} | ||
- is_false: fields.metricset.keyword.time_series_dimension | ||
- is_false: fields.metricset.keyword.time_series_metric | ||
- is_false: fields.metricset.keyword.indices | ||
- is_false: fields.metricset.keyword.non_searchable_indices | ||
- is_false: fields.metricset.keyword.non_aggregatable_indices | ||
- match: {fields.metricset.keyword.non_dimension_indices: ["tsdb_index2"]} | ||
- is_false: fields.metricset.keyword.mertric_conflicts_indices | ||
|
||
- match: {fields.non_tsdb_field.keyword.searchable: true} | ||
- match: {fields.non_tsdb_field.keyword.aggregatable: true} | ||
- is_false: fields.non_tsdb_field.keyword.time_series_dimension | ||
- is_false: fields.non_tsdb_field.keyword.time_series_metric | ||
- is_false: fields.non_tsdb_field.keyword.indices | ||
- is_false: fields.non_tsdb_field.keyword.non_searchable_indices | ||
- is_false: fields.non_tsdb_field.keyword.non_aggregatable_indices | ||
- is_false: fields.non_tsdb_field.keyword.non_dimension_indices | ||
- is_false: fields.non_tsdb_field.keyword.mertric_conflicts_indices | ||
|
||
- match: {fields.k8s\.pod\.availability_zone.short.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.availability_zone.short.time_series_metric | ||
- is_false: fields.k8s\.pod\.availability_zone.short.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.availability_zone.short.mertric_conflicts_indices | ||
|
||
- match: {fields.k8s\.pod\.uid.keyword.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.uid.keyword.time_series_metric | ||
- is_false: fields.k8s\.pod\.uid.keyword.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.uid.keyword.mertric_conflicts_indices | ||
|
||
- is_false: fields.k8s\.pod\.name.keyword.time_series_dimension | ||
- is_false: fields.k8s\.pod\.name.keyword.time_series_metric | ||
- is_false: fields.k8s\.pod\.name.keyword.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.name.keyword.mertric_conflicts_indices | ||
|
||
- match: {fields.k8s\.pod\.ip.ip.time_series_dimension: true} | ||
- is_false: fields.k8s\.pod\.ip.ip.time_series_metric | ||
- is_false: fields.k8s\.pod\.ip.ip.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.ip.ip.mertric_conflicts_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.tx.long.time_series_dimension | ||
- is_false: fields.k8s\.pod\.network\.tx.long.time_series_metric | ||
- is_false: fields.k8s\.pod\.network\.tx.long.non_dimension_indices | ||
- match: {fields.k8s\.pod\.network\.tx.long.mertric_conflicts_indices: ["tsdb_index1", "tsdb_index2"]} | ||
|
||
- is_false: fields.k8s\.pod\.network\.rx.integer.time_series_dimension | ||
- is_false: fields.k8s\.pod\.network\.rx.integer.time_series_metric | ||
- is_false: fields.k8s\.pod\.network\.rx.integer.non_dimension_indices | ||
- match: {fields.k8s\.pod\.network\.rx.integer.mertric_conflicts_indices: ["tsdb_index1", "tsdb_index2"]} | ||
|
||
- is_false: fields.k8s\.pod\.network\.packets_dropped.long.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.packets_dropped.long.time_series_metric: gauge} | ||
- is_false: fields.k8s\.pod\.network\.packets_dropped.long.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.network\.packets_dropped.long.mertric_conflicts_indices | ||
|
||
- is_false: fields.k8s\.pod\.network\.latency.double.time_series_dimension | ||
- match: {fields.k8s\.pod\.network\.latency.double.time_series_metric: gauge} | ||
- is_false: fields.k8s\.pod\.network\.latency.double.non_dimension_indices | ||
- is_false: fields.k8s\.pod\.network\.latency.double.mertric_conflicts_indices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is absent if the field is not a metric.