-
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] Metric fields in the field caps API #88695
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ffe066c
Create tests for field caps
csoulios 6852c5a
Expose metric type as family type
csoulios 0a01775
Update docs/changelog/88695.yaml
csoulios 03a65f7
Merge branch 'master' into field-caps-metrics
csoulios af8ead8
Removed metric_type from family type
csoulios bfb4a0a
checkstyle
csoulios b3c4d4e
Merge branch 'main' into field-caps-metrics
csoulios 5757c0a
Merge branch 'main' into field-caps-metrics
csoulios b21c4a3
Bumped skipped versions for tests
csoulios 0b4128c
more tests
csoulios 56e1e17
Fix broken tests
csoulios d9e1629
spotless
csoulios 249d8bd
Fix test
csoulios 80eee2f
Fix test
csoulios 0aad530
Merge branch 'main' into field-caps-metrics
csoulios d6d9c2b
Fix docs
csoulios 5e9ffce
Update docs/reference/search/field-caps.asciidoc
csoulios db19856
Update docs/reference/search/field-caps.asciidoc
csoulios 511eb99
Update docs/reference/search/field-caps.asciidoc
csoulios 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 88695 | ||
summary: "[TSDB] Metric fields in the field caps API" | ||
area: TSDB | ||
type: enhancement | ||
issues: [] |
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
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
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
231 changes: 231 additions & 0 deletions
231
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/110_field_caps.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: " - 8.4.99" | ||
reason: metric params only on time series indexes introduced in 8.5.0 | ||
|
||
- do: | ||
indices.create: | ||
index: test_time_series | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mode: time_series | ||
routing_path: [ metricset, k8s.pod.uid ] | ||
time_series: | ||
start_time: 2021-04-28T00:00:00Z | ||
end_time: 2021-04-29T00:00:00Z | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
time_series_dimension: true | ||
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: long | ||
time_series_metric: gauge | ||
|
||
- do: | ||
indices.create: | ||
index: test_non_time_series | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
time_series_dimension: true | ||
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: long | ||
time_series_metric: gauge | ||
|
||
--- | ||
field caps on time_series indices: | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: metric params only on time series indexes introduced in 8.4.0 | ||
|
||
- do: | ||
field_caps: | ||
index: test_time_series | ||
fields: [ k8s.pod.uid, k8s.pod.network.rx, k8s.pod.network.tx, k8s.pod.ip, metricset, _tsid ] | ||
|
||
- match: { fields.k8s\.pod\.uid.keyword.type: keyword } | ||
- match: { fields.k8s\.pod\.uid.keyword.searchable: true } | ||
- match: { fields.k8s\.pod\.uid.keyword.aggregatable: true } | ||
- match: { fields.k8s\.pod\.uid.keyword.time_series_dimension: true } | ||
- is_false: fields.k8s\.pod\.uid.keyword.indices | ||
- is_false: fields.k8s\.pod\.uid.keyword.non_searchable_indices | ||
- is_false: fields.k8s\.pod\.uid.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.time_series_metric: gauge } | ||
- is_false: fields.k8s\.pod\.network\.tx.long.metric_conflicts_indices | ||
- is_false: fields.k8s\.pod\.network\.rx.long.indices | ||
- is_false: fields.k8s\.pod\.network\.rx.long.non_searchable_indices | ||
- is_false: fields.k8s\.pod\.network\.rx.long.non_aggregatable_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.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 | ||
- is_false: fields.k8s\.pod\.network\.tx.long.non_aggregatable_indices | ||
|
||
- match: { fields.k8s\.pod\.ip.ip.type: ip } | ||
- match: { fields.k8s\.pod\.ip.ip.searchable: true } | ||
- match: { fields.k8s\.pod\.ip.ip.aggregatable: true } | ||
- is_false: fields.k8s\.pod\.ip.ip.indices | ||
- is_false: fields.k8s\.pod\.ip.ip.non_searchable_indices | ||
- is_false: fields.k8s\.pod\.ip.ip.non_aggregatable_indices | ||
|
||
- match: { fields.metricset.keyword.type: keyword } | ||
- 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.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._tsid._tsid.metadata_field: true } | ||
- match: { fields._tsid._tsid.searchable: false } | ||
- match: { fields._tsid._tsid.aggregatable: true } | ||
- is_false: fields._tsid._tsid.indices | ||
- is_false: fields._tsid._tsid.non_searchable_indices | ||
- is_false: fields._tsid._tsid.non_aggregatable_indices | ||
|
||
|
||
--- | ||
field caps on standard indices: | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: metric params only on time series indexes introduced in 8.4.0 | ||
|
||
- do: | ||
field_caps: | ||
index: test_non_time_series | ||
fields: [ _tsid, metricset, k8s.pod.network.rx, k8s.pod.network.tx, k8s.pod.network.rx ] | ||
|
||
- 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 | ||
- 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 | ||
|
||
- is_false: fields._tsid # _tsid metadata field must not exist in non-time-series 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 | ||
- 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 | ||
- is_false: fields.k8s\.pod\.network\.rx.long.non_aggregatable_indices | ||
- is_false: fields.k8s\.pod\.network\.rx.gauge | ||
|
||
- 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 | ||
- 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 | ||
- is_false: fields.k8s\.pod\.network\.tx.long.non_aggregatable_indices | ||
- is_false: fields.k8s\.pod\.network\.tx.counter | ||
|
||
|
||
--- | ||
field caps on mixed indices: | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: metric params only on time series indexes introduced in 8.4.0 | ||
|
||
- do: | ||
field_caps: | ||
index: test_* | ||
fields: [ metricset, k8s.pod.availability_zone, k8s.pod.network.tx, k8s.pod.network.rx ] | ||
|
||
- 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" ] } | ||
- 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.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.non_searchable_indices | ||
- is_false: fields.k8s\.pod\.network\.tx.long.non_aggregatable_indices | ||
- is_false: fields.k8s\.pod\.network\.tx.long.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
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.
@kilfoyle Maybe you have a better take on the doc changes here.
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.
Looks good now! 👍