如何:配置指标并微调检测配置How to: Configure metrics and fine tune detecting configuration

利用本文开始使用 Web 门户配置指标顾问实例。Use this article to start configuring your Metrics Advisor instance using the web portal. 若要浏览特定数据馈送的指标,请转到“数据馈送”页,然后选择其中一个馈送。To browse the metrics for a specific data feed, go to the Data feeds page and select one of the feeds. 这将显示与之关联的指标列表。This will display a list of metrics associated with it.


单击其中一个指标名称可查看其详细信息。Click on one of the metric names to see its details. 在此详细视图中,可以使用屏幕右上角的下拉列表切换到同一数据馈送中的其他指标。In this detailed view, you can switch to another metric in the same data feed using the drop down list in the top right corner of the screen.

第一次查看指标的详细信息时,可以加载时序,方法是让指标顾问选择一个时序或为每个维度指定要包含的值。When you first view a metrics' details, you can load a time series by letting Metrics Advisor choose one for you, or by specifying values to be included for each dimension.

还可以选择时间范围,并更改页面的布局。You can also select time ranges, and change the layout of the page.


  • 开始时间为包含时间。The start time is inclusive.
  • 结束时间为非包含时间。The end time is exclusive.

可以单击“事件”选项卡查看异常,并找到事件中心的链接。You can click the Incidents tab to view anomalies, and find a link to the Incident hub.

优化检测配置Tune the detecting configuration

指标可以应用一个或多个检测配置。A metric can apply one or more detecting configurations. 每个指标都有一个默认配置,可以根据监视需求对其进行编辑或添加。There is a default configuration for each metric, which you can edit or add to, according to your monitoring needs.

优化当前指标中所有序列的配置Tune the configuration for all series in current metric

此配置将应用于此指标中的所有序列,具有单独配置的序列除外。This configuration will be applied to all the series in this metric, except for ones with a separate configuration. 默认情况下,在载入数据时应用指标级别配置,并显示在左侧面板上。A metric level configuration is applied by default when data is onboarded, and is shown on the left panel. 用户可以直接在指标页上编辑指标级别配置。Users can directly edit metric level config on metric page.

还有一些其他参数(如“方向”和“有效异常”)可以用于进一步优化配置 。There are additional parameters like Direction , and Valid anomaly that can be used to further tune the configuration. 你也可以组合不同的检测方法。You can combine different detection methods as well.


优化特定系列或组的配置Tune the configuration for a specific series or group

单击指标级别配置选项下方的“高级配置”,查看组级别配置。可以通过单击此窗口的 + 图标为各序列或序列组添加配置。Click Advanced configuration below the metric level configuration options to see the group level configuration.You can add a configuration for an individual series, or group of series by clicking the + icon in this window. 参数与指标级别配置参数类似,但你可能需要为组级别配置指定至少一个维度值才能标识一组序列。The parameters are similar to the metric-level configuration parameters, but you may need to specify at least one dimension value for a group-level configuration to identify a group of series. 指定序列级别配置的所有维度值以标识特定序列。And specify all dimension values for series-level configuration to identify a specific series.

此配置将应用于序列组或特定序列,而不是指标级别配置。This configuration will be applied to the group of series or specific series instead of the metric level configuration. 设置该组的条件后,将其保存。After setting the conditions for this group, save it.


异常情况检测方法Anomaly detection methods

指标顾问提供多种异常情况检测方法。Metrics Advisor offers multiple anomaly detection methods. 可以使用一个方法,或单击 + 按钮使用逻辑运算符来组合多个方法。You can use one or combine them using logical operators by clicking the + button.

智能检测Smart detection

智能检测由机器学习提供支持,它通过历史数据学习模式,并将其用于将来的检测。Smart detection is powered by machine learning that learns patterns from historical data, and uses them for future detection. 使用此方法时,“敏感度”是优化检测结果的最重要的参数。When using this method, the Sensitivity is the most important parameter for tuning the detection results. 可以将其拖动为更小或更大的值,以影响页面右侧的可视化效果。You can drag it to a smaller or larger value to affect the visualization on the right side of the page. 选择一个适合你的数据的值并将其保存。Choose one that fits your data and save it.

在智能检测模式下,敏感度和边界版本参数用于微调异常情况检测结果。In smart detection mode, the sensitivity and boundary version parameters are used to fine tune the anomaly detection result.

敏感度可以影响每个点的预期值范围的宽度。Sensitivity can affect the width of the expected value range of each point. 当敏感度增加时,预期的值范围将变窄,报告的异常情况将变多:When increased, the expected value range will be tighter, and more anomalies will be reported:


关闭敏感度后,预期的值范围将变宽,报告的异常情况将变少:When the sensitivity is turned down, the expected value range will be wider, and fewer anomalies will be reported:


变化阈值Change threshold

当指标数据一般保持在某个范围时,我们通常使用变化阈值。Change threshold is normally used when metric data generally stays around a certain range. 阈值根据“变化百分比”设置。The threshold is set according to Change percentage . “变化阈值”模式能够检测以下场景中的异常:The Change threshold mode is able to detect anomalies in the scenarios:

  • 数据通常稳定平滑。Your data is normally stable and smooth. 你需要在波动发生时获得通知。You want to be notified when there are fluctuations.
  • 数据通常非常不稳定,波动很大。Your data is normally quite unstable and fluctuates a lot. 你希望在数据变得过于平稳时收到通知。You want to be notified when it becomes too stable or flat.

使用以下步骤来使用此模式:Use the following steps to use this mode:

  1. 为指标或时序设置异常检测配置时,请选择“变化阈值”作为异常检测方法。Select Change threshold as your anomaly detection method when you set the anomaly detection configurations for your metrics or time series.


  2. 基于场景选择“超出范围”或“范围内”参数 。Select the out of the range or in the range parameter based on your scenario.

    如果要检测波动,请选择“超出范围”。If you want to detect fluctuations, select out of the range . 例如,使用下面的设置时,与前一个数据点相比,变化超过 10% 的任何数据点将被检测为离群值。For example, with the settings below, any data point that changes over 10% compared to the previous one will be detected as an outlier. “超出范围”参数

    如果要检测数据中的平整线,选择“范围内”。If you want to detect flat lines in your data, select in the range . 例如,使用下面的设置时,与前一个数据点相比,变化在 0.01% 内的任何数据点将被检测为离群值。For example, with the settings below, any data point that changes within 0.01% compared to the previous one will be detected as an outlier. 由于阈值太小 (0.01%),因此它将数据中的平整线检测为离群值。Because the threshold is so small (0.01%), it detects flat lines in the data as outliers.


  3. 设置将计为异常的变化的百分比,并设置将哪些以前捕获的数据点用于比较。Set the percentage of change that will count as an anomaly, and which previously captured data points will be used for comparison. 这种比较总是在当前数据点和在它之前 N 点的数据点之间进行。This comparison is always between the current data point, and a single data point N points before it.

    “方向”仅在使用“超出范围”模式时才有效 :Direction is only valid if you're using the out of the range mode:

    • Up 用于以下检测配置:仅当(当前数据点)-(比较数据点)> + 阈值百分比时检测异常。Up configures detection to only detect anomalies when (current data point) - (comparison data point) > + threshold percentage.
    • Down 用于以下检测配置:仅当(当前数据点)-(比较数据点)< - 阈值百分比时检测异常。Down configures detection to only detect anomalies when (current data point) - (comparing data point) < - threshold percentage.

硬阈值Hard threshold

硬阈值是异常检测的基本方法。Hard threshold is a basic method for anomaly detection. 可以设置上限和/或下限来确定预期的值范围。You can set an upper and/or lower bound to determine the expected value range. 边界外的任何点将被标识为异常。Any points fall out of the boundary will be identified as an anomaly.

预设事件Preset events

有时,预期的事件(如假日)可能生成异常数据。Sometimes, expected events and occurrences (such as holidays) can generate anomalous data. 使用预设事件,可以在指定的时间将标志添加到异常情况检测输出。Using preset events, you can add flags to the anomaly detection output, during specified times. 应在载入数据馈送后配置此功能。This feature should be configured after your data feed is onboarded. 每个指标只能有一个预设的事件配置。Each metric can only have one preset event configuration.


预设事件配置将在异常检测期间考虑假日,并可能更改结果。Preset event configuration will take holidays into consideration during anomaly detection, and may change your results. 保存配置后,它将应用于引入的数据点。It will be applied to the data points ingested after you save the configuration.

单击每个指标详细信息页上的指标下拉列表旁边的“配置预设事件”按钮。Click the Configure Preset Event button next to the metrics drop down list on each metric details page.


在显示的窗口中,根据使用情况配置选项。In the window that appears, configure the options according to your usage. 确保选择“启用假日事件”以使用此配置。Make sure Enable holiday event is selected to use the configuration.

“假日事件”部分帮助你取消在假日期间检测到的不必要的异常。The Holiday event section helps you suppress unnecessary anomalies detected during holidays. 可以应用“策略”选项的两个选项:There are two options for the Strategy option that you can apply:

  • 取消假日:取消假日期间异常情况检测结果中的所有异常和警报。Suppress holiday : Suppresses all anomalies and alerts in anomaly detection results during holiday period.
  • 假日作为周末:计算假日前几个相应周末的平均预期值,并基于这些值确定异常状态。Holiday as weekend : Calculates the average expected values of several corresponding weekends before the holiday, and bases the anomaly status off of these values.

可以配置一些其他值:There are several other values you can configure:

选项Option 说明Description
选择一个维度作为国家/地区Choose one dimension as country 选择一个包含国家/地区信息的维度。Choose a dimension that contains country information. 例如,国家/地区代码。For example a country code.
国家/地区代码映射Country code mapping 标准国家/地区代码与所选维度的国家/地区数据之间的映射。The mapping between a standard country code, and chosen dimension's country data.
假日选项Holiday options 考虑所有假日、只考虑 PTO(带薪休假)假日或只考虑非 PTO 假日。Whether to take into account all holidays, only PTO (Paid Time Off) holidays, or only Non-PTO holidays.
扩展的天数Days to expand 假期前后受影响的天数。The impacted days before and after a holiday.

在某些情况下,可以使用“循环事件”部分,通过使用数据中的循环模式来帮助减少不必要的警报。The Cycle event section can be used in some scenarios to help reduce unnecessary alerts by using cyclic patterns in the data. 例如: 。For example:

  • 具有多个模式或循环的指标,如每周和每月模式。Metrics that have multiple patterns or cycles, such as both a weekly and monthly pattern.
  • 没有清晰模式但数据可以进行年同比 (YoY)、月同比 (MoM)、周同比 (WoW) 或日同比 (DoD) 的指标。Metrics that do not have a clear pattern, but the data is comparable Year over Year (YoY), Month over Month (MoM), Week Over Week (WoW), or Day Over Day (DoD).

并非所有选项都可选择用于每个粒度。Not all options are selectable for every granularity. 每个粒度的可用选项如下所示:The available options per granularity are below:

粒度Granularity YoYYoY MoMMoM WoWWoW DoDDoD
每年Yearly XX XX XX XX
每月Monthly XX XX XX XX
每周Weekly XX XX XX
每天Daily XX
每分钟Minutely XX XX XX XX
每秒Secondly XX XX XX XX

X - 不可用。X - Unavailable.
✔ - 可用。✔ - Available.

* 如果使用自定义粒度(以秒为单位),则仅当指标超过一小时且小于一天时才可用。* When using a custom granularity in seconds, only available if the metric is longer than one hour and less than one day.

循环事件用于减少遵循循环模式的异常,但如果多个数据点不遵循模式,则将报告异常。Cycle event is used to reduce anomalies if they follow a cyclic pattern, but it will report an anomaly if multiple data points don't follow the pattern. 严格模式用于在即使只有一个数据点不遵循模式时启用异常报告。Strict mode is used to enable anomaly reporting if even one data point doesn't follow the pattern.


查看最近事件View recent incidents

指标顾问在所有时序数据引入时检测异常情况。Metrics Advisor detects anomalies on all your time series data as they're ingested. 但是,并不是所有异常都需要上报,因为它们可能不会产生很大的影响。However, not all anomalies need to be escalated, because they might not have a big impact. 聚合将针对异常执行,将相关事件分组为事件。Aggregation will be performed on anomalies to group related ones into incidents. 可以在指标详细信息页的“事件”选项卡中查看这些事件。You can view these incidents from the Incident tab in metrics details page.

单击事件可转到“事件分析”页,你可在其中查看更多相关详细信息。Click on an incident to go to the Incidents analysis page where you can see more details about it. 单击“在新事件中心中管理事件”,找到事件中心页,你可在其中找到特定指标下的所有事件。Click on Manage incidents in new Incident hub , to find the Incident hub page where you can find all incidents under the specific metric.

订阅异常以接收通知Subscribe anomalies for notification

如果希望在检测到异常时收到通知,可以使用挂钩订阅指标的警报。If you'd like to get notified whenever an anomaly is detected, you can subscribe to alerts for the metric, using a hook. 如需了解详细信息,请参阅使用挂钩配置警报并获得通知See Configure alerts and get notifications using a hook for more information.

后续步骤Next steps