|
| 1 | +setup: |
| 2 | + - skip: |
| 3 | + version: " - 8.4.99" |
| 4 | + reason: "rollup renamed to downsample in 8.5.0" |
| 5 | + |
| 6 | + - do: |
| 7 | + indices.create: |
| 8 | + index: test |
| 9 | + body: |
| 10 | + settings: |
| 11 | + number_of_shards: 1 |
| 12 | + index: |
| 13 | + mode: time_series |
| 14 | + routing_path: [metricset, k8s.pod.uid] |
| 15 | + time_series: |
| 16 | + start_time: 2021-04-28T00:00:00Z |
| 17 | + end_time: 2021-04-29T00:00:00Z |
| 18 | + mappings: |
| 19 | + properties: |
| 20 | + "@timestamp": |
| 21 | + type: date |
| 22 | + metricset: |
| 23 | + type: keyword |
| 24 | + time_series_dimension: true |
| 25 | + k8s: |
| 26 | + properties: |
| 27 | + pod: |
| 28 | + properties: |
| 29 | + uid: |
| 30 | + type: keyword |
| 31 | + time_series_dimension: true |
| 32 | + name: |
| 33 | + type: keyword |
| 34 | + created_at: |
| 35 | + type: date_nanos |
| 36 | + running: |
| 37 | + type: boolean |
| 38 | + number_of_containers: |
| 39 | + type: integer |
| 40 | + ip: |
| 41 | + type: ip |
| 42 | + tags: |
| 43 | + type: keyword |
| 44 | + values: |
| 45 | + type: integer |
| 46 | + multi-counter: |
| 47 | + type: long |
| 48 | + time_series_metric: counter |
| 49 | + scaled-counter: |
| 50 | + type: scaled_float |
| 51 | + scaling_factor: 100 |
| 52 | + time_series_metric: counter |
| 53 | + multi-gauge: |
| 54 | + type: integer |
| 55 | + time_series_metric: gauge |
| 56 | + scaled-gauge: |
| 57 | + type: scaled_float |
| 58 | + scaling_factor: 100 |
| 59 | + time_series_metric: gauge |
| 60 | + network: |
| 61 | + properties: |
| 62 | + tx: |
| 63 | + type: long |
| 64 | + time_series_metric: gauge |
| 65 | + rx: |
| 66 | + type: long |
| 67 | + time_series_metric: gauge |
| 68 | + - do: |
| 69 | + bulk: |
| 70 | + refresh: true |
| 71 | + index: test |
| 72 | + body: |
| 73 | + - '{"index": {}}' |
| 74 | + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "multi-counter" : [10, 11, 12], "scaled-counter": 10.0, "multi-gauge": [100, 200, 150], "scaled-gauge": 100.0, "network": {"tx": 2001818691, "rx": 802133794}, "created_at": "2021-04-28T19:34:00.000Z", "running": false, "number_of_containers": 2, "tags": ["backend", "prod"], "values": [2, 3, 6]}}}' |
| 75 | + - '{"index": {}}' |
| 76 | + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.26", "multi-counter" : [21, 22, 23], "scaled-counter": 20.0, "multi-gauge": [90, 91, 95], "scaled-gauge": 90.0, "network": {"tx": 2005177954, "rx": 801479970}, "created_at": "2021-04-28T19:35:00.000Z", "running": true, "number_of_containers": 2, "tags": ["backend", "prod", "us-west1"], "values": [1, 1, 3]}}}' |
| 77 | + - '{"index": {}}' |
| 78 | + - '{"@timestamp": "2021-04-28T20:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.41", "multi-counter" : [1, 5, 10], "scaled-counter": 1.0, "multi-gauge": [103, 110, 109], "scaled-gauge": 104.0, "network": {"tx": 2006223737, "rx": 802337279}, "created_at": "2021-04-28T19:36:00.000Z", "running": true, "number_of_containers": 2, "tags": ["backend", "prod", "us-west2"], "values": [4, 1, 2]}}}' |
| 79 | + - '{"index": {}}' |
| 80 | + - '{"@timestamp": "2021-04-28T20:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.22", "multi-counter" : [101, 102, 105], "scaled-counter": 100.0, "multi-gauge": [100, 100, 100], "scaled-gauge": 102.0, "network": {"tx": 2012916202, "rx": 803685721}, "created_at": "2021-04-28T19:37:00.000Z", "running": true, "number_of_containers": 2, "tags": ["backend", "prod"], "values": [2, 3, 1]}}}' |
| 81 | + - '{"index": {}}' |
| 82 | + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.33", "multi-counter" : [7, 11, 44], "scaled-counter": 7.0, "multi-gauge": [100, 100, 102], "scaled-gauge": 100.0, "network": {"tx": 1434521831, "rx": 530575198}, "created_at": "2021-04-28T19:42:00.000Z", "running": false, "number_of_containers": 1, "tags": ["backend", "test"], "values": [2, 3, 4]}}}' |
| 83 | + - '{"index": {}}' |
| 84 | + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.56", "multi-counter" : [0, 0, 1], "scaled-counter": 0.0, "multi-gauge": [101, 102, 102], "scaled-gauge": 101.0, "network": {"tx": 1434577921, "rx": 530600088}, "created_at": "2021-04-28T19:43:00.000Z", "running": false, "number_of_containers": 1, "tags": ["backend", "test", "us-west2"], "values": [2, 1, 1]}}}' |
| 85 | + - '{"index": {}}' |
| 86 | + - '{"@timestamp": "2021-04-28T19:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.37", "multi-counter" : [1000, 1001, 1002], "scaled-counter": 1000.0, "multi-gauge": [99, 100, 110], "scaled-gauge": 99.0, "network": {"tx": 1434587694, "rx": 530604797}, "created_at": "2021-04-28T19:44:00.000Z", "running": true, "number_of_containers": 1, "tags": ["backend", "test", "us-west1"], "values": [4, 5, 2]}}}' |
| 87 | + - '{"index": {}}' |
| 88 | + - '{"@timestamp": "2021-04-28T19:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.120", "multi-counter" : [76, 77, 78], "scaled-counter": 70.0, "multi-gauge": [95, 98, 100], "scaled-gauge": 95.0, "network": {"tx": 1434595272, "rx": 530605511}, "created_at": "2021-04-28T19:45:00.000Z", "running": true, "number_of_containers": 1, "tags": ["backend", "test", "us-west1"], "values": [3, 2, 1]}}}' |
| 89 | + |
| 90 | + - do: |
| 91 | + indices.put_settings: |
| 92 | + index: test |
| 93 | + body: |
| 94 | + index.blocks.write: true |
| 95 | + |
| 96 | +--- |
| 97 | +"Downsample index": |
| 98 | + |
| 99 | + - do: |
| 100 | + indices.downsample: |
| 101 | + index: test |
| 102 | + target_index: test-downsample |
| 103 | + body: > |
| 104 | + { |
| 105 | + "fixed_interval": "1h" |
| 106 | + } |
| 107 | + - is_true: acknowledged |
| 108 | + |
| 109 | + - do: |
| 110 | + search: |
| 111 | + index: test-downsample |
| 112 | + body: |
| 113 | + sort: [ "@timestamp" ] |
| 114 | + |
| 115 | + - length: { hits.hits: 4 } |
| 116 | + - match: { hits.hits.0._source._doc_count: 2 } |
| 117 | + - match: { hits.hits.0._source.metricset: pod } |
| 118 | + |
| 119 | + # Assert rollup index settings |
| 120 | + - do: |
| 121 | + indices.get_settings: |
| 122 | + index: test-downsample |
| 123 | + |
| 124 | + - match: { test-downsample.settings.index.mode: time_series } |
| 125 | + - match: { test-downsample.settings.index.time_series.end_time: 2021-04-29T00:00:00Z } |
| 126 | + - match: { test-downsample.settings.index.time_series.start_time: 2021-04-28T00:00:00Z } |
| 127 | + - match: { test-downsample.settings.index.routing_path: [ "metricset", "k8s.pod.uid"] } |
| 128 | + - match: { test-downsample.settings.index.downsample.source.name: test } |
| 129 | + |
| 130 | + # Assert rollup index mapping |
| 131 | + - do: |
| 132 | + indices.get_mapping: |
| 133 | + index: test-downsample |
| 134 | + |
| 135 | + - match: { [email protected]: date } |
| 136 | + - match: { [email protected]_interval: 1h } |
| 137 | + - match: { [email protected]_zone: UTC } |
| 138 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.type: aggregate_metric_double } |
| 139 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.metrics: [ "min", "max", "sum", "value_count" ] } |
| 140 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.default_metric: max } |
| 141 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-gauge.time_series_metric: gauge } |
| 142 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-counter.type: long } |
| 143 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.multi-counter.time_series_metric: counter } |
| 144 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-counter.type: scaled_float } |
| 145 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-counter.scaling_factor: 100 } |
| 146 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-counter.time_series_metric: counter } |
| 147 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-gauge.type: aggregate_metric_double } |
| 148 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-gauge.metrics: [ "min", "max", "sum", "value_count" ] } |
| 149 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-gauge.default_metric: max } |
| 150 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.scaled-gauge.time_series_metric: gauge } |
| 151 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.uid.type: keyword } |
| 152 | + - match: { test-downsample.mappings.properties.k8s.properties.pod.properties.uid.time_series_dimension: true } |
0 commit comments