opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.69k stars 893 forks source link

[BUG] count and value_count Metric aggregation types misclassified and missing #2240

Open ashwin-pc opened 2 years ago

ashwin-pc commented 2 years ago

Describe the bug

In OpenSearch Dashboards, we have count defined as a metric aggregation. There is however no metric aggregation of type count in OpenSearch Core and it seems to use the bucket.doc_count metadata field as its value.

Similarly value_count is in fact a valid metric aggregation type in OpenSearch Core but is missing in the list of metric aggregation types in OpenSearch Dashboards.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/opensearch-project/OpenSearch-Dashboards/blob/2.2/src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts to see the listed aggregation types

Expected behavior

There should not be a discrepancy between the different aggregation types and their classifications between OpenSearch Core and OpenSearch Dashboards and what they do.

OpenSearch Version 2.2

Dashboards Version 2.2

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context

Add any other context about the problem here.

kavilla commented 2 years ago

[Triage]:

  1. There is a difference we need to research why the difference.
    • Note: There is a difference in total count and return result count that could be the difference but we don't explicitly know why there is a non-mapping of 1 to 1 based on what is in OpenSearch Dashboards vs OpenSearch.
      1. If there is a difference are we okay with that since we want to encourage the split? Or do we want to revisit that think about it should be disable if OpenSearch is not the data source.
      2. We should document any findings about the functionality about this metric agg.