Skip to content

Add anomaly chart component

What does this MR do?

This MR defines a new component monitor-anomaly-chart to highlight abnormal data in metrics.

The component:

  • displays a main metric line, and a "boundary band" which shows the limits of usual behavior of the metric
  • highlights data in the metric which is considered and "anomaly".
  • has a similar props interface as TimeSeries.vue component
  • requires exactly 3 queries/metrics to work properly: to display a metric, lower and upper series.

Screenshots (with mock data)

Example: Business as usual case 😒

An example of a normal behavior

2019-09-05_17.11.54

Example: Oops! case 🤦

A new commit introduced a performance issue, that has caused a spike in memory/disk usage, this allows the team to immediately see the issue:

2019-09-05_17.13.56

Example: A savior commit 🚀

A new commit introduced a performance issue, but was quickly fixed by a second commit or revert, which puts things back to normal:

2019-09-05_17.19.34

Look and feel

The default shows some anomalous data points, and some parts can be customized:

  • metric line color
  • metric line width
  • opacity of area
default look and feel customized
image image

Background

The implementation of this chart is heavily inspired by the talk given by @andrewn, which explains that given a metric with a normal distribution, it is possible to create a (visual) boundary of based on the average and standard deviation of said metric over a longer period of time.

https://about.gitlab.com/2019/07/23/anomaly-detection-using-prometheus/

An example chart was created to show the how this can visualized.

image

Current status in monitor

Currently, inside monitor there is an approach to create a similar data source, information in the following MR:

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14972/diffs

Mock data

You may apply this diff to see the chart in our dashboard directly: https://gitlab.com/gitlab-org/gitlab-ce/snippets/1890744

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

MR follow up issues and dicussions

This MR is quite large, and it uncovered a few issues and discussions that will be left as follow-up:

Related to https://gitlab.com/gitlab-org/gitlab-ee/issues/5366

Edited by 🤖 GitLab Bot 🤖

Merge request reports