-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[TSDB] Add support for downsampling aggregate_metric_double
fields
#90029
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
Merged
Merged
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3af2f77
Use XContentBuilder for index mapping
csoulios 88ce0d2
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios 5bde2a6
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios 695da28
Added aggregate_metric_double field
csoulios 977eeb2
initial support for rollup of rollups
csoulios d582542
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios d2befc7
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios 146c924
Add fetcher support for aggregate_double_metric
csoulios c10fd78
Collect aggregate_metric_double fields
csoulios cebdc91
Cleanup
csoulios 6c4e297
Fix gradle dependencies
csoulios 07d02d2
Added testRollupOfRollups test
csoulios fde224f
Format test
csoulios 32927a3
javadoc
csoulios 548c96c
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios fc27e34
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios bf4ded9
Create fetcher only if mapped field
csoulios fe63511
Removed fuction that was not used
csoulios ee82647
Support aggregate_metric_double label fields
csoulios dd390af
cleanup
csoulios 253c88a
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios 5bc0cb4
Validate downsampling interval
csoulios 08c8fe5
Add tests for rollups of rollups
csoulios b39ee34
Use aggregate_metric field mapper as plugin
csoulios 113bf91
Merge branch 'main' into tsdb-rollup-of-rollups
csoulios 6c1597e
Removed unused dependency
csoulios 69664b0
Move FieldValueFetcher into server module
csoulios f52f2d0
Revert "Move FieldValueFetcher into server module"
csoulios 48e7bf9
Merge branch 'main' into tsdb-rollup-of-rollups
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -87,7 +87,7 @@ setup: | |
index.blocks.write: true | ||
|
||
--- | ||
"Rollup index": | ||
"Downsample index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "rollup renamed to downsample in 8.5.0" | ||
|
@@ -141,6 +141,24 @@ setup: | |
- match: { rollup-test.settings.index.number_of_shards: "1" } | ||
- match: { rollup-test.settings.index.number_of_replicas: "0" } | ||
|
||
# Assert rollup index mapping | ||
- do: | ||
indices.get_mapping: | ||
index: rollup-test | ||
|
||
- match: { [email protected]: date } | ||
- match: { [email protected]_interval: 1h } | ||
- match: { [email protected]_zone: UTC } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-gauge.type: aggregate_metric_double } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-gauge.metrics: [ "min", "max", "sum", "value_count" ] } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-gauge.default_metric: max } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-gauge.time_series_metric: gauge } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-counter.type: long } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.multi-counter.time_series_metric: counter } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.uid.type: keyword } | ||
- match: { rollup-test.mappings.properties.k8s.properties.pod.properties.uid.time_series_dimension: true } | ||
|
||
|
||
# Assert source index has not been deleted | ||
- do: | ||
indices.get: | ||
|
@@ -156,7 +174,7 @@ setup: | |
- match: { indices.rollup-test.shards.0.0.num_search_segments: 1} | ||
|
||
--- | ||
"Rollup non-existing index": | ||
"Downsample non-existing index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "rollup renamed to downsample in 8.5.0" | ||
|
@@ -172,7 +190,7 @@ setup: | |
} | ||
|
||
--- | ||
"Rollup to existing rollup index": | ||
"Downsample to existing index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "rollup renamed to downsample in 8.5.0" | ||
|
@@ -192,7 +210,7 @@ setup: | |
} | ||
|
||
--- | ||
"Rollup not time_series index": | ||
"Downsample not time_series index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "rollup renamed to downsample in 8.5.0" | ||
|
@@ -213,7 +231,7 @@ setup: | |
|
||
|
||
--- | ||
"Rollup no metric index": | ||
"Downsample no metric index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "rollup renamed to downsample in 8.5.0" | ||
|
@@ -254,3 +272,138 @@ setup: | |
{ | ||
"fixed_interval": "1h" | ||
} | ||
|
||
--- | ||
"Downsample a downsampled index": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "Rollup of rollups introduced in 8.5.0" | ||
|
||
- do: | ||
indices.downsample: | ||
index: test | ||
target_index: rollup-test | ||
body: > | ||
{ | ||
"fixed_interval": "1h" | ||
} | ||
- is_true: acknowledged | ||
|
||
- do: | ||
indices.downsample: | ||
index: rollup-test | ||
target_index: rollup-test-2 | ||
body: > | ||
{ | ||
"fixed_interval": "2h" | ||
} | ||
- is_true: acknowledged | ||
|
||
|
||
# Assert rollup index mapping | ||
- do: | ||
indices.get_mapping: | ||
index: rollup-test-2 | ||
|
||
- match: { [email protected]: date } | ||
- match: { [email protected]_interval: 2h } | ||
- match: { [email protected]_zone: UTC } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-gauge.type: aggregate_metric_double } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-gauge.metrics: [ "min", "max", "sum", "value_count" ] } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-gauge.default_metric: max } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-gauge.time_series_metric: gauge } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-counter.type: long } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.multi-counter.time_series_metric: counter } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.uid.type: keyword } | ||
- match: { rollup-test-2.mappings.properties.k8s.properties.pod.properties.uid.time_series_dimension: true } | ||
|
||
- do: | ||
search: | ||
index: rollup-test-2 | ||
body: | ||
sort: [ "_tsid", "@timestamp" ] | ||
|
||
- length: { hits.hits: 3 } | ||
- match: { hits.hits.0._source._doc_count: 2 } | ||
- match: { hits.hits.0._source.k8s\.pod\.uid: 947e4ced-1786-4e53-9e0c-5c447e959507 } | ||
- match: { hits.hits.0._source.metricset: pod } | ||
- match: { hits.hits.0._source.@timestamp: 2021-04-28T18:00:00.000Z } | ||
- match: { hits.hits.0._source.k8s\.pod\.multi-counter: 21 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.multi-gauge.min: 90 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.multi-gauge.max: 200 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.multi-gauge.sum: 726 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.multi-gauge.value_count: 6 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.network\.tx.min: 2001818691 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.network\.tx.max: 2005177954 } | ||
# - match: { hits.hits.0._source.k8s\.pod\.network\.tx.value_count: 2 } | ||
- match: { hits.hits.0._source.k8s\.pod\.ip: "10.10.55.26" } | ||
- match: { hits.hits.0._source.k8s\.pod\.created_at: "2021-04-28T19:35:00.000Z" } | ||
- match: { hits.hits.0._source.k8s\.pod\.number_of_containers: 2 } | ||
- match: { hits.hits.0._source.k8s\.pod\.tags: [ "backend", "prod", "us-west1" ] } | ||
- match: { hits.hits.0._source.k8s\.pod\.values: [ 1, 1, 3 ] } | ||
|
||
- match: { hits.hits.1._source.k8s\.pod\.uid: 947e4ced-1786-4e53-9e0c-5c447e959507 } | ||
- match: { hits.hits.1._source.metricset: pod } | ||
- match: { hits.hits.1._source.@timestamp: 2021-04-28T20:00:00.000Z } | ||
- match: { hits.hits.1._source._doc_count: 2 } | ||
|
||
- match: { hits.hits.2._source.k8s\.pod\.uid: df3145b3-0563-4d3b-a0f7-897eb2876ea9 } | ||
- match: { hits.hits.2._source.metricset: pod } | ||
- match: { hits.hits.2._source.@timestamp: 2021-04-28T18:00:00.000Z } | ||
- match: { hits.hits.2._source._doc_count: 4 } | ||
|
||
- do: | ||
indices.downsample: | ||
index: rollup-test | ||
target_index: rollup-test-3 | ||
body: > | ||
{ | ||
"fixed_interval": "180m" | ||
} | ||
- is_true: acknowledged | ||
|
||
--- | ||
"Downsample a downsampled index with wrong intervals": | ||
- skip: | ||
version: " - 8.4.99" | ||
reason: "Rollup of rollups introduced in 8.5.0" | ||
|
||
- do: | ||
indices.downsample: | ||
index: test | ||
target_index: rollup-test | ||
body: > | ||
{ | ||
"fixed_interval": "1h" | ||
} | ||
- is_true: acknowledged | ||
|
||
- do: | ||
catch: /Downsampling interval \[1h\] must be greater than the the source index interval \[1h\]/ | ||
indices.downsample: | ||
index: rollup-test | ||
target_index: rollup-test-2 | ||
body: > | ||
{ | ||
"fixed_interval": "1h" | ||
} | ||
|
||
- do: | ||
catch: /Downsampling interval \[30m\] must be greater than the the source index interval \[1h\]/ | ||
indices.downsample: | ||
index: rollup-test | ||
target_index: rollup-test-2 | ||
body: > | ||
{ | ||
"fixed_interval": "30m" | ||
} | ||
|
||
- do: | ||
catch: /Downsampling interval \[90m\] must be a multiple of the source index interval \[1h\]/ | ||
indices.downsample: | ||
index: rollup-test | ||
target_index: rollup-test-2 | ||
body: > | ||
{ | ||
"fixed_interval": "90m" | ||
} |
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.