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

[ML] validate datafeed composite aggregation support in Single metric viewer #93610

Closed
benwtrent opened this issue Mar 4, 2021 · 2 comments
Closed
Assignees
Labels
enhancement New value added to drive a business result Feature:Anomaly Detection ML anomaly detection :ml v7.13.0

Comments

@benwtrent
Copy link
Member

Describe the feature:
Validations around if an aggregated datafeed can be shown in SMV should include composite aggregations.
Describe a specific use case for the feature:
With elastic/elasticsearch#69970 it will be possible for users to create datafeeds that use composite aggregations.

The current validations ASSUME a date_histogram parent aggregation. But, it is now possible that the top level agg is composite.

So, along with the typical sub-agg validations (nested terms, etc.), an additional validation needs to be done for composite.

The UI should make sure that the composite sources are terms and date_histogram only. While it is possible to execute a filter query for the other source types, that logic is not in kibana yet.

Here is a validate data feed:

{
  "job_id": "farequote-composite",
  "indices": [
    "farequote"
  ],
  "aggregations": {
    "buckets": {
      "composite": {
        "size": 1000,
        "sources": [
          {
            "time": {
              "date_histogram": {
                "field": "time",
                "fixed_interval": "360s",
                "time_zone": "UTC"
              }
            }
          },
          {
            "airline": {
              "terms": {
                "field": "airline"
              }
            }
          }
        ]
      },
      "aggregations": {
        "time": {
          "max": {
            "field": "time"
          }
        },
        "responsetime": {
          "avg": {
            "field": "responsetime"
          }
        }
      }
    }
  }
}

Here is one that wouldn't really be visible in SMV (based only on composite sources)

{
  "job_id": "farequote-composite",
  "indices": [
    "farequote"
  ],
  "aggregations": {
    "buckets": {
      "composite": {
        "size": 1000,
        "sources": [
          {
            "time": {
              "date_histogram": {
                "field": "time",
                "fixed_interval": "360s",
                "time_zone": "UTC"
              }
            }
          },
          {
            "airline": {
              "terms": {
                "field": "airline"
              }
            }
          },
          {
            "tile": {
              "geotile_grid": {
                "field": "destination.position"
              }
            }
          }
        ]
      },
      "aggregations": {
        "time": {
          "max": {
            "field": "time"
          }
        },
        "responsetime": {
          "avg": {
            "field": "responsetime"
          }
        }
      }
    }
  }
}

Note the additional sources entry of geotile_grid

@benwtrent benwtrent added enhancement New value added to drive a business result :ml Feature:Anomaly Detection ML anomaly detection labels Mar 4, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@qn895
Copy link
Member

qn895 commented Apr 13, 2021

This validation is added now in #96348

@qn895 qn895 closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Anomaly Detection ML anomaly detection :ml v7.13.0
Projects
None yet
Development

No branches or pull requests

4 participants