mvg
(Martijn Van Groningen)
December 19, 2023, 2:25pm
17
Apologies @jerrac , somehow the notifications were not sent to my email.
We found the cause of the issue that you are encountering here and filed a bug for this:
opened 02:03PM - 19 Dec 23 UTC
>bug
Team:Analytics
:Analytics/Downsampling
Downsampling an index with a counter field of type `scaled_float` always fails.
…
Reproduction:
```
PUT cpu_metrics
{
"settings": {
"index": {
"mode": "time_series",
"number_of_replicas": 0,
"time_series": {
"start_time": "2000-01-01T00:00:00Z",
"end_time": "2099-12-31T23:59:59Z"
},
"routing_path": [
"hostname"
]
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"hostname": {
"type": "keyword",
"time_series_dimension": "true"
},
"cumulative_usage_user": {
"type": "scaled_float",
"scaling_factor": 100,
"time_series_metric": "counter"
},
"cumulative_usage_system": {
"type": "scaled_float",
"scaling_factor": 100,
"time_series_metric": "counter"
},
"cumulative_usage_idle": {
"type": "scaled_float",
"scaling_factor": 100,
"time_series_metric": "counter"
},
"cumulative_usage_nice": {
"type": "scaled_float",
"scaling_factor": 100,
"time_series_metric": "counter"
},
"@timestamp": {
"type": "date"
}
}
}
}
POST /cpu_metrics/_doc
{
"hostname": "my-host",
"@timestamp": "2000-01-01T00:00:00Z",
"cumulative_usage_user": 0,
"cumulative_usage_system": 0,
"cumulative_usage_idle": 0,
"cumulative_usage_nice": 0
}
PUT /cpu_metrics/_settings
{
"index.blocks.write": true
}
POST cpu_metrics/_downsample/cpu_metrics-downsampled-1h
{
"fixed_interval": "1h"
}
```
Response:
```
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping: Field [scaling_factor] is required"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping: Field [scaling_factor] is required",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Field [scaling_factor] is required"
}
},
"status": 400
}
```
The end result is that the downsampling process doesn't start and the downsampled index isn't even created.
Note that `scaling_factor` is defined in the mappings of the source index, but the downsample operation fails to included it into the mapping of the downsampled index.
2 Likes