作者|董福銘(吾銘)、黃俊(豆豆)
編輯|橙子君
出品|阿里巴巴新零售淘系技術
指標監控關乎穩定性,但隨著數據量的增加、指標的複雜週期性和模式變化的動態性,基於閾值/同比環比的規則難以適用,而且複雜的領域知識導致為每條指標配置相應的規則費時費力,無法應用在大規模數據監控上。在監控的有效性方面,傳統的規則報警無法智能識別季節性,也經常受到噪聲/抖動數據的干擾而導致誤報,固定的規則以及閾值更無法進行提前預警。
前言
在上面的背景下,淘系技術質量團隊打造了一款基於AI算法的異常檢測平臺,Holmes是一款智能化、輕量級、易接入、可擴展的異常檢測平臺,使用基於AI的異常檢測算法,替代傳統的規則監控方案。解決規則告警系統準確率低、時效性低、規則配置複雜與耗費人力等諸多問題。
Holmes目前已經在阿里內進行開放,覆蓋淘寶、千牛、優酷、釘釘、淘寶直播等多個應用,核心指標量200+,整體準確率在90%以上,算法調用量高達1000萬餘次,有效進行故障的提前預警20餘次。
▐ 平臺理念
Holmes通過AI算法對業務指標進行檢測和預測,從而實現智能化報警,彌補了規則監控的不足,減少誤報和漏報情況。提供一站式的異常檢測服務,滿足時序數據的實時檢測,提供多種接入方式,利用機器學習和深度學習方式,定製化學習模型,有效提升報警覆蓋率,以智能化方式進行穩定性的監控和保障。
特點:
- 學習歷史數據,分析當前指標曲線趨勢是否異常
- 基於以往數據,進行預測未來指標走勢
優勢:
- 算法檢測代替規則檢測
- 告警準確率高
- 更早發現異常情況
- 可適應業務發展帶來的趨勢變化
解決的異常場景:
▐ 系統架構
配置化流程
通過4步簡單配置進行指標的接入和算法選擇,輕鬆開啟智能異常檢測。
▐ 算法概覽
Holmes融合了多種檢測、預測的時序算法,檢測異常響應速度快,預測數據走勢準,二者的完美結合,奠定了異常檢測的基礎能力,同時平臺也支持擴展算法的能力,以適應新增場景的特殊需求。
檢測算法:
✎ Statistic
In statistics, the 68-95-99.7 rule is a shorthand used to remember the percentage of valuesthat lie within a band around the mean in a normal distribution with a width of two, four andsix standard deviations, respectively; more accurately, 68.27%, 95.45% and 99.73% of the valueslie within one, two and three standard deviations of the mean, respectively.
✎ Ewma
In statistical quality control, the EWMA chart (or exponentially weighted moving average chart)is a type of control chart used to monitor either variables or attributes-type data using the monitored businessor industrial process's entire history of output. While other control charts treat rational subgroups of samplesindividually, the EWMA chart tracks the exponentially-weighted moving average of all prior sample means.
✎ Polynomial
In statistics, polynomial regression is a form of regression analysis in which the relationshipbetween the independent variable x and the dependent variable y is modelled as an nth degree polynomial in x.
✎ IsolationForest
The IsolationForest 'isolates' observations by randomly selecting a feature and thenrandomly selecting a split value between the maximum and minimum values of the selected feature.
✎ XGBoost
XGBoost is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable. It implements machine learning algorithms under the Gradient Boosting framework. XGBoost provides a parallel tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way. The same code runs on major distributed environment (Hadoop, SGE, MPI) and can solve problems beyond billions of examples.
預測算法:
✎ Tensorflow-LSTM
Long Short-Term Memory layer - Hochreiter 1997.預測效果圖:
✎ Facebook-prophet
Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.
實踐效果
目前Holmes異常檢測平臺已經在集團內部開放接入和運行,支持集團內常用數據源。平臺運行幾個月以來,幫助接入業務方的開發測試同學構建智能監控體系,減少繁瑣的規則配置,有效提高了線上質量監控的覆蓋率。今年618大促期間,Holmes的準確性方面也進一步得到驗證,有效保障了大促的穩定性質量。
覆蓋應用:淘寶、千牛、優酷、釘釘、淘寶直播、鹹魚等
接入指標:核心業務指標 200+
提前預警:有效提前預警線上問題 20+
算法調用量:累計1000萬+
報警示例
實踐案例1:
A客戶端新版本放量期間, 由於客戶端請求傳參問題導致服務端返回大量空返回錯誤,Holmes 進行了有效檢測到異常,相關同學收到報警及時中止放量並修復問題。然而傳統規則監控因未達到閾值沒有預警。
實踐案例2:
在618大促壓測期間,由於B業務訂單數據量持續下降(緩慢下跌),Holmes檢測到持續異常信息,預測數據下跌風險,早於傳統規則監控90分鐘提前報警,有效避免了線上故障。
算法檢測效果
未來展望
Holmes異常檢測平臺是淘系技術質量團隊打造,在智能化測試領域的一次實踐,未來我們希望利用AI算法實現業務全方位智能化監控和問題定位。覆蓋更多的數據類型、打造通用的算法模型、更優越的算法指標。同時我們也在全鏈路監控排查、智能輿情處理等多方面進行探索,期待後續跟大家分享。
淘系技術質量團隊
負責保障整個手淘、天貓主戰的業務質量,這裡有豐富業務場景和技術挑戰,我們將持續建設及完善這個那個淘系穩定性、提升用戶體驗。
如果您有興趣可講簡歷發至:[email protected],期待您的加入!
關注「淘系技術」微信公眾號,一個有溫度有內容的技術社區~