Skip to content

[ML] Single metric viewer doesn't work if bucket span is a multiple of a week (or higher) unit #19720

@dolaru

Description

@dolaru

When accessing the Single metric viewer, an elasticsearch request with a date histogram aggregation is fired. The interval of that aggregation is set to the bucket span using the highest matching time unit.

According to the Date Histogram Aggregation documentation:

... note that time intervals larger than than days do not support arbitrary values but can only be one unit large (e.g. 1y is valid, 2y is not).

As a result, if the bucket span is a multiple of a unit higher than days, the Elasticsearch search request fails.

Example

Job with bucket span of 28d, when viewed in the Single Metric Viewer will try to fire an Elasticsearch search request with a date histogram aggregation which has an interval of 4w which is invalid.

Proposed solution

Limit used interval units to not be higher than days.

Metadata

Metadata

Assignees

Labels

:mlFeature:Anomaly DetectionML anomaly detectionbugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions