Skip to content
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

Certain Aggregation functions not supported when TSDB datastream is used. #93539

Closed
agithomas opened this issue Feb 7, 2023 · 13 comments · May be fixed by #93884
Closed

Certain Aggregation functions not supported when TSDB datastream is used. #93539

agithomas opened this issue Feb 7, 2023 · 13 comments · May be fixed by #93884
Assignees
Labels
:StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@agithomas
Copy link

agithomas commented Feb 7, 2023

ElasticSearch Version : elasticsearch:8.7.0-SNAPSHOT (Snapshot downloaded on 6th Feb 2023)

Problem:

The below error occur when using datastream having TSDB enabled.

Imapact

This breaks the Lens visualisation that are having aggregation function on data streams that are TSDB enabled. This is validated using the Oracle Integration TSDB migration activity.

When a problem is seen, visualisation appear as below

image

Details of error is mentioned below.

image

Related PR :
When this problem was initially reported, below mentioned PR was created to resolve the problem.
#93311

Initial Impression:

It appears that some of the aggregation functions works with TSDB (Max Value, Last Value) but certain functions do not such as

  • Count
  • Percentile

Mapping Details

{
  "mappings": {
    "_meta": {
      "managed_by": "fleet",
      "managed": true,
      "package": {
        "name": "oracle"
      }
    },
    "_data_stream_timestamp": {
      "enabled": true
    },
    "dynamic_templates": [
      {
        "strings_as_keyword": {
          "match_mapping_type": "string",
          "mapping": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }
    ],
    "date_detection": false,
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "agent": {
        "properties": {
          "ephemeral_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "cloud": {
        "properties": {
          "account": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "availability_zone": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "instance": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "machine": {
            "properties": {
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "project": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "provider": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "service": {
            "properties": {
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          }
        }
      },
      "data_stream": {
        "properties": {
          "dataset": {
            "type": "constant_keyword",
            "value": "oracle.system_statistics"
          },
          "namespace": {
            "type": "constant_keyword",
            "value": "default"
          },
          "type": {
            "type": "constant_keyword",
            "value": "metrics"
          }
        }
      },
      "ecs": {
        "properties": {
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "elastic_agent": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "snapshot": {
            "type": "boolean"
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "event": {
        "properties": {
          "agent_id_status": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "dataset": {
            "type": "constant_keyword",
            "value": "oracle.system_statistics"
          },
          "duration": {
            "type": "long"
          },
          "ingested": {
            "type": "date",
            "format": "strict_date_time_no_millis||strict_date_optional_time||epoch_millis"
          },
          "module": {
            "type": "constant_keyword",
            "value": "sql"
          }
        }
      },
      "host": {
        "properties": {
          "architecture": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "containerized": {
            "type": "boolean"
          },
          "hostname": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ip": {
            "type": "ip"
          },
          "mac": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "os": {
            "properties": {
              "codename": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "family": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "kernel": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "platform": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "version": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          }
        }
      },
      "metricset": {
        "properties": {
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "period": {
            "type": "long"
          }
        }
      },
      "oracle": {
        "properties": {
          "system_statistics": {
            "properties": {
              "bytes_received_via_sqlnet_from_client": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "bytes_received_via_sqlnet_from_dblink": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "bytes_sent_via_sqlnet_to_client": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "bytes_sent_via_sqlnet_to_dblink": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "cpu_used_by_this_session": {
                "type": "double",
                "meta": {
                  "unit": "ms"
                },
                "time_series_metric": "counter"
              },
              "db_block_changes": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "db_block_gets_from_cache": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "db_time": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "dbwr_checkpoint_buffers_written": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "dbwr_checkpoints": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "dml_statements_parallelized": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_conversions": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_deadlocks": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_releases": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_timeouts": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "enqueue_waits": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "exchange_deadlocks": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "execute_count": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "gc_current_block_receive_time": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "index_fast_full_scans_direct_read": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "index_fast_full_scans_full": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "index_fast_full_scans_rowid_ranges": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "java_call_heap_live_size": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "java_call_heap_total_size": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "java_call_heap_used_size": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "lob_reads": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "lob_writes": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "logons_current": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "opened_cursors_current": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "os_system_time_used": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "os_user_time_used": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "parallel_operations_not_downgraded": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "parse_count_hard": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "parse_count_total": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "parse_time_cpu": {
                "type": "double",
                "meta": {
                  "unit": "ms"
                },
                "time_series_metric": "counter"
              },
              "parse_time_elapsed": {
                "type": "double",
                "meta": {
                  "unit": "ms"
                },
                "time_series_metric": "counter"
              },
              "physical_read_bytes": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "physical_read_io_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_read_total_bytes": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "physical_read_total_io_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_reads": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_write_bytes": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "physical_write_io_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_write_total_bytes": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "physical_write_total_io_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_writes": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_writes_direct": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "physical_writes_from_cache": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "process_last_non_idle_time": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "queries_parallelized": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "recovery_blocks_read": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "recursive_calls": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "recursive_cpu_usage": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "redo_blocks_written": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "redo_buffer_allocation_retries": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "redo_log_space_requests": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "redo_log_space_wait_time": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "redo_size": {
                "type": "double",
                "meta": {
                  "unit": "byte"
                },
                "time_series_metric": "counter"
              },
              "redo_synch_time": {
                "type": "double",
                "meta": {
                  "unit": "ms"
                },
                "time_series_metric": "counter"
              },
              "redo_write_time": {
                "type": "double",
                "meta": {
                  "unit": "micros"
                },
                "time_series_metric": "counter"
              },
              "redo_writes": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "session_cursor_cache_count": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "session_cursor_cache_hits": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "session_logical_reads": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "session_stored_procedure_space": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "smon_posted_for_instance_recovery": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "smon_posted_for_txn_recovery_for_other_instances": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "sorts_disk": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "sorts_memory": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "sorts_rows": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "table_scan_rows_gotten": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "table_scans_direct_read": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "table_scans_long_tables": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "table_scans_rowid_ranges": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "transaction_rollbacks": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "user_calls": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "user_commits": {
                "type": "double",
                "time_series_metric": "counter"
              },
              "user_rollbacks": {
                "type": "double",
                "time_series_metric": "counter"
              }
            }
          }
        }
      },
      "service": {
        "properties": {
          "address": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      }
    }
  }
}

Stack Trace

Request

GET .ds-metrics-oracle.system_statistics-default-2023.02.06-000001/_search?error_trace=true
{
  "aggs": {
    "0": {
      "date_histogram": {
        "field": "@timestamp",
        "calendar_interval": "1m",
        "time_zone": "Asia/Calcutta",
        "extended_bounds": {
          "min": 1675753854979,
          "max": 1675757454979
        }
      },
      "aggs": {
        "1": {
          "value_count": {
            "field": "oracle.system_statistics.sorts_memory"
          }
        }
      }
    }
  },
  "size": 0,
  "fields": [
    {
      "field": "@timestamp",
      "format": "date_time"
    },
    {
      "field": "event.ingested",
      "format": "date_time"
    },
    {
      "field": "process.cpu.start_time",
      "format": "date_time"
    },
    {
      "field": "system.process.cpu.start_time",
      "format": "date_time"
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "*"
  ],
  "runtime_mappings": {},
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_phrase": {
            "data_stream.dataset": "oracle.system_statistics"
          }
        },
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2023-02-07T07:10:54.979Z",
              "lte": "2023-02-07T08:10:54.979Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

Response

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]",
        "stack_trace": """org.elasticsearch.ElasticsearchException$1: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:640)
	at [email protected]/org.elasticsearch.action.search.SearchPhaseExecutionException.guessRootCauses(SearchPhaseExecutionException.java:150)
	at [email protected]/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:622)
	at [email protected]/org.elasticsearch.ElasticsearchException.generateFailureXContent(ElasticsearchException.java:568)
	at [email protected]/org.elasticsearch.rest.RestResponse.build(RestResponse.java:175)
	at [email protected]/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:123)
	at [email protected]/org.elasticsearch.rest.RestResponse.<init>(RestResponse.java:102)
	at [email protected]/org.elasticsearch.rest.action.RestActionListener.onFailure(RestActionListener.java:55)
	at [email protected]/org.elasticsearch.rest.action.RestCancellableNodeClient$1.onFailure(RestCancellableNodeClient.java:96)
	at [email protected]/org.elasticsearch.client.internal.node.NodeClient$SafelyWrappedActionListener.onFailure(NodeClient.java:170)
	at [email protected]/org.elasticsearch.tasks.TaskManager$1.onFailure(TaskManager.java:220)
	at [email protected]/org.elasticsearch.action.support.ContextPreservingActionListener.onFailure(ContextPreservingActionListener.java:38)
	at [email protected]/org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:97)
	at [email protected]/org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:97)
	at [email protected]/org.elasticsearch.action.ActionListener$RunAfterActionListener.onFailure(ActionListener.java:401)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.raisePhaseFailure(AbstractSearchAsyncAction.java:751)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:728)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:418)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:760)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:512)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:349)
	at [email protected]/org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:97)
	at [email protected]/org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:48)
	at [email protected]/org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:644)
	at [email protected]/org.elasticsearch.transport.TransportService$UnregisterChildTransportResponseHandler.handleException(TransportService.java:1651)
	at [email protected]/org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1377)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1513)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1488)
	at [email protected]/org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:50)
	at [email protected]/org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:44)
	at [email protected]/org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:92)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:28)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	... 6 more
"""
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": ".ds-metrics-oracle.system_statistics-default-2023.02.06-000001",
        "node": "kAAlBPtHSTekb4p2okauAQ",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]",
          "stack_trace": """java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
"""
        }
      }
    ],
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]",
        "stack_trace": """java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
"""
      },
      "stack_trace": """org.elasticsearch.ElasticsearchException$1: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:640)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:416)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:760)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:512)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:349)
	at [email protected]/org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:97)
	at [email protected]/org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:48)
	at [email protected]/org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:644)
	at [email protected]/org.elasticsearch.transport.TransportService$UnregisterChildTransportResponseHandler.handleException(TransportService.java:1651)
	at [email protected]/org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1377)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1513)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1488)
	at [email protected]/org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:50)
	at [email protected]/org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:44)
	at [email protected]/org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:92)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:28)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	... 6 more
"""
    },
    "stack_trace": """Failed to execute phase [query], all shards failed; shardFailures {[kAAlBPtHSTekb4p2okauAQ][.ds-metrics-oracle.system_statistics-default-2023.02.06-000001][0]: org.elasticsearch.transport.RemoteTransportException: [d6b078442dc7][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
}
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:728)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:418)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:760)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:512)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:349)
	at [email protected]/org.elasticsearch.action.ActionListener$Delegating.onFailure(ActionListener.java:97)
	at [email protected]/org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:48)
	at [email protected]/org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:644)
	at [email protected]/org.elasticsearch.transport.TransportService$UnregisterChildTransportResponseHandler.handleException(TransportService.java:1651)
	at [email protected]/org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1377)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1513)
	at [email protected]/org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1488)
	at [email protected]/org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:50)
	at [email protected]/org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:44)
	at [email protected]/org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:92)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:28)
	at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: org.elasticsearch.ElasticsearchException$1: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:640)
	at [email protected]/org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:416)
	... 20 more
Caused by: java.lang.IllegalArgumentException: Field [oracle.system_statistics.sorts_memory] of type [double] is not supported for aggregation [value_count]
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceType.getUnregisteredException(ValuesSourceType.java:103)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.getAggregator(ValuesSourceRegistry.java:173)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:100)
	at [email protected]/org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder.innerBuild(ValueCountAggregationBuilder.java:29)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder$LeafOnly.doBuild(ValuesSourceAggregationBuilder.java:112)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactory.<init>(AggregatorFactory.java:46)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.<init>(ValuesSourceAggregatorFactory.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregatorFactory.<init>(DateHistogramAggregatorFactory.java:110)
	at [email protected]/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder.innerBuild(DateHistogramAggregationBuilder.java:483)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:419)
	at [email protected]/org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:31)
	at [email protected]/org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:129)
	at [email protected]/org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:397)
	at [email protected]/org.elasticsearch.search.SearchService.parseSource(SearchService.java:1243)
	at [email protected]/org.elasticsearch.search.SearchService.createContext(SearchService.java:986)
	at [email protected]/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:630)
	at [email protected]/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:495)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
	at [email protected]/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
	at [email protected]/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
	at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	... 6 more
"""
  },
  "status": 400
}
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Feb 7, 2023
@agithomas
Copy link
Author

Impact Analysis

This issue may become significant enough to become as a blocker for TSDB migration of Integration Packages.

@agithomas agithomas changed the title Aggregation functions not supported when TSDB datastream is used. Certain Aggregation functions not supported when TSDB datastream is used. Feb 7, 2023
@martijnvg martijnvg added the :StorageEngine/TSDB You know, for Metrics label Feb 7, 2023
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed needs:triage Requires assignment of a team area label labels Feb 7, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@agithomas
Copy link
Author

agithomas commented Feb 7, 2023

It appears that some of the aggregation functions are not defined when time_series_metric is counter.

For example: sum() and average() functions is not defined when time_series_metric is counter.

In Lens visualisation, there exist no validation to restrict user from selecting aggregation functions that are not defined or supported. This would create error as mentioned in the screenshot below.

image

It is recommended to limit the selection of such unsupported / undefined aggregate functions in Lens visualisation when time_series_metric is counter or gauge.

@martijnvg , would you be able to help on the supported aggregate functions for

  • when time_series_metric is counter
  • when time_series_metric is gauge

I shall create a Lens Visualisation enhancement in Kibana once your input is available.

martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 7, 2023
A number of aggregations don't support counter fields,
because its computation doesn't make sense on these fields.
For example computing an average on a counter doesn't make
sense.

Relates to elastic#93539
@martijnvg
Copy link
Member

Current there are no restrictions on gauge fields. All aggregations support fields with time_series_metric set to gauge.

Fields with time_series_metric set to counter only support the following aggregations: rate, histogram, range,
min, max, top_metrics and variable_width_histogram.

@martijnvg
Copy link
Member

I'm going to update the docs to reflect this (^) and make a change to improve the error message.

@martijnvg
Copy link
Member

This error is returned much more often than we had anticipated. The problem is that ES' field capabilities API says the a counter is aggregatable. But in reality ES will only allow a few aggregations to be run on these counter fields. This misinform Lens and many users will run into these unexpected (for users) errors.

Whether is makes sense to run aggregations like avg and sum on a counter field should maybe be done elsewhere. Technically these aggregations will work on counter fields, but the results will not make sense. The field capability api does include time_series_metric attribute in the response, so Lens and other systems can make the decision whether an aggregation like avg makes sense.

We will work on a change that will ensure all aggregations will (technically) work on numeric fields with time_series_metric set to counter.

@mattkime
Copy link

mattkime commented Feb 7, 2023

@martijnvg I'm new to TSDB - can you explain to me why avg and sum don't make sense in some cases? Do we have a complete description of which aggregations are supported for TSDB fields?

Unfortunately addressing this on the Kibana side looks like it would be a lot of work as it would touch any code that might do aggregations. The code is prepared to handle true or false but nothing more fine grained than that.

This also seems like a collaboration issue between ES and Kibana. It would be good to figure out how we got here so we can prevent it in the future.

At this point I think our best way forward would be for ES aggregations even when they don't make sense. Its certainly not ideal but we don't have a lot of options for how to move forward.

@martijnvg
Copy link
Member

@mattkime The avg and sum aggregations work on counter fields. No errors, the aggregations do what is expected. But logically computing a sum or average of a counter doesn't make much sense. A counter for a time series just monotonically increases over time (and sometimes resets to 0), so what does it mean if for example to compute a sum is computed over such a field? (For example a metric like bytes sent and received from a network device over time)

Because we introduced the time_series_metric attribute on field mappings, we thought it would be a good idea to be a bit more stricter regarding what aggregations should run on a counter field. To only allow aggregations that logically make sense. What was forgotten is that there is no good way that we can relay that information to Kibana and any other system that builds aggregations. The field caps api currently isn't fine grained enough to indicate what aggregations can run on on specific fields. Like I mention in my previous comment, we're going to no longer enforce what aggregation can use a counter field.

This also seems like a collaboration issue between ES and Kibana. It would be good to figure out how we got here so we can prevent it in the future.

Agreed. I should have reached out.

At this point I think our best way forward would be for ES aggregations even when they don't make sense. Its certainly not ideal but we don't have a lot of options for how to move forward.

Yes, and I think just executing the aggregations is the best way forward now.

martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 8, 2023
No longer offer limited aggregation support counter fields.
This extends the counter field support to all aggregation.

Closes elastic#93539
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 13, 2023
…e defined on non tsdb indices. The field caps only reports both attributes on tsdb indices. This change alters the field caps api to also return these attributes when specified on non tsdb indices.

Relates to elastic#93539
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 14, 2023
Fields that have the `time_series_metric` attribute set to `counter` in non tsdb indices should use number value source type instead of counter value source type. Essentially not handling these fields as counters at search time.

Relates to elastic#93539
mattkime added a commit to elastic/kibana that referenced this issue Feb 15, 2023
## Summary

Part of elastic/elasticsearch#93539

Currently, field caps reports time series counter fields as aggregatable
as they support several aggs. Unfortunately, they don't support ALL aggs
so its possible create an unsupported agg in Kibana which results in an
ES error. In order to prevent this, the data view field list will report
all time series counter fields as non-aggregatable until support for
specific aggs can be provided throughout Kibana.

To test - Create a TSDS with a time series counter field and verify that
its not aggregatable in data view management. Also check other apps to
make sure the field isn't available for aggregations.
https://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kibanamachine pushed a commit to elastic/kibana that referenced this issue Feb 15, 2023
## Summary

Part of elastic/elasticsearch#93539

Currently, field caps reports time series counter fields as aggregatable
as they support several aggs. Unfortunately, they don't support ALL aggs
so its possible create an unsupported agg in Kibana which results in an
ES error. In order to prevent this, the data view field list will report
all time series counter fields as non-aggregatable until support for
specific aggs can be provided throughout Kibana.

To test - Create a TSDS with a time series counter field and verify that
its not aggregatable in data view management. Also check other apps to
make sure the field isn't available for aggregations.
https://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 410f019)
kibanamachine referenced this issue in elastic/kibana Feb 15, 2023
…150954) (#151240)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[data views] Time series counter fields are not aggregatable
(#150954)](#150954)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-15T00:38:23Z","message":"[data
views] Time series counter fields are not aggregatable (#150954)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/elasticsearch/issues/93539\r\n\r\nCurrently,
field caps reports time series counter fields as aggregatable\r\nas they
support several aggs. Unfortunately, they don't support ALL aggs\r\nso
its possible create an unsupported agg in Kibana which results in
an\r\nES error. In order to prevent this, the data view field list will
report\r\nall time series counter fields as non-aggregatable until
support for\r\nspecific aggs can be provided throughout
Kibana.\r\n\r\nTo test - Create a TSDS with a time series counter field
and verify that\r\nits not aggregatable in data view management. Also
check other apps to\r\nmake sure the field isn't available for
aggregations.\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"410f0199408b2c55389ed7d6dfd3170cdede2c84","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","auto-backport","v8.7.0","v8.8.0","Feature:
TSDS"],"number":150954,"url":"https://github.com/elastic/kibana/pull/150954","mergeCommit":{"message":"[data
views] Time series counter fields are not aggregatable (#150954)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/elasticsearch/issues/93539\r\n\r\nCurrently,
field caps reports time series counter fields as aggregatable\r\nas they
support several aggs. Unfortunately, they don't support ALL aggs\r\nso
its possible create an unsupported agg in Kibana which results in
an\r\nES error. In order to prevent this, the data view field list will
report\r\nall time series counter fields as non-aggregatable until
support for\r\nspecific aggs can be provided throughout
Kibana.\r\n\r\nTo test - Create a TSDS with a time series counter field
and verify that\r\nits not aggregatable in data view management. Also
check other apps to\r\nmake sure the field isn't available for
aggregations.\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"410f0199408b2c55389ed7d6dfd3170cdede2c84"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150954","number":150954,"mergeCommit":{"message":"[data
views] Time series counter fields are not aggregatable (#150954)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/elasticsearch/issues/93539\r\n\r\nCurrently,
field caps reports time series counter fields as aggregatable\r\nas they
support several aggs. Unfortunately, they don't support ALL aggs\r\nso
its possible create an unsupported agg in Kibana which results in
an\r\nES error. In order to prevent this, the data view field list will
report\r\nall time series counter fields as non-aggregatable until
support for\r\nspecific aggs can be provided throughout
Kibana.\r\n\r\nTo test - Create a TSDS with a time series counter field
and verify that\r\nits not aggregatable in data view management. Also
check other apps to\r\nmake sure the field isn't available for
aggregations.\r\nhttps://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"410f0199408b2c55389ed7d6dfd3170cdede2c84"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <[email protected]>
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 18, 2023
Improve field caps api to include what aggregations are supported on a per field bases.
For fields that are aggregatable, a list of supported aggregations is included.

Closes elastic#93539
martijnvg added a commit that referenced this issue Feb 20, 2023
Fields that have the time_series_metric attribute set to counter in non tsdb indices should use number value source type instead of counter value source type. Essentially not handling these fields as counters at search time.

Relates to #93539
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Feb 20, 2023
…3800)

Fields that have the time_series_metric attribute set to counter in non tsdb indices should use number value source type instead of counter value source type. Essentially not handling these fields as counters at search time.

Relates to elastic#93539
martijnvg added a commit that referenced this issue Feb 20, 2023
Backporting #93800 to 8.7 branch.

Fields that have the time_series_metric attribute set to counter in non tsdb indices should use number value source type instead of counter value source type. Essentially not handling these fields as counters at search time.

Relates to #93539
@martijnvg
Copy link
Member

A small update to this issue. Field defined as counters in non tsdb indices are no longer treated as counters #93800, this should avoid integration issues, because in that case the field caps api doesn't return the time_series_metric attribute.

I started to work on an change that allows the field caps api to return what aggregations are supported for a specific field: #93884

carlosdelest pushed a commit to carlosdelest/elasticsearch that referenced this issue Feb 21, 2023
…3800)

Fields that have the time_series_metric attribute set to counter in non tsdb indices should use number value source type instead of counter value source type. Essentially not handling these fields as counters at search time.

Relates to elastic#93539
justinkambic pushed a commit to justinkambic/kibana that referenced this issue Feb 23, 2023
…#150954)

## Summary

Part of elastic/elasticsearch#93539

Currently, field caps reports time series counter fields as aggregatable
as they support several aggs. Unfortunately, they don't support ALL aggs
so its possible create an unsupported agg in Kibana which results in an
ES error. In order to prevent this, the data view field list will report
all time series counter fields as non-aggregatable until support for
specific aggs can be provided throughout Kibana.

To test - Create a TSDS with a time series counter field and verify that
its not aggregatable in data view management. Also check other apps to
make sure the field isn't available for aggregations.
https://www.elastic.co/guide/en/elasticsearch/reference/master/set-up-tsds.html

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
@emalzer
Copy link

emalzer commented Feb 25, 2023

Hi!
I also use TSDS and already have working visualizations under 8.5.x. After upgrading to 8.6 I now get a similar error for my visualizations where I mostly user counter_rate in Lens of unsigned_long fields. This is a blocking issue to me.

Field [interface.telemetry.in_errors] of type [unsigned_long] is not supported for aggregation [max].

Is there a info in what version this will get fixed?

@agithomas
Copy link
Author

Closing the issue as the fix is available.

@agithomas
Copy link
Author

I observed the problem using Median function on counter type field, when using 8.7 issue. Reopening the issue

Also, please do note that, Median is the default aggregation type that is loaded when the user clicks the Visualize button (appears when the user hover over the field in the Discover view.

There are two options here

  1. Either Median() function and all other aggregation functions must be supported for counter type (or)
    2.Modify the default aggregation function as "Maximum" if the metric_type is counter.

@agithomas agithomas reopened this Apr 6, 2023
@martijnvg
Copy link
Member

I don't know what aggregation the median function is using under the hood. But I don't think supporting median makes sense, for the same reason why avg aggregation isn't supported.

elasticsearchmachine pushed a commit that referenced this issue Apr 11, 2023
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Apr 11, 2023
elasticsearchmachine pushed a commit that referenced this issue Apr 11, 2023
martijnvg added a commit that referenced this issue Jun 29, 2023
…93545)

A number of aggregations don't support counter fields,
because its computation doesn't make sense on these fields.
For example computing an average on a counter doesn't make
sense.

Relates to #93539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
5 participants