本文介绍应用实时监控作为事件源发布到事件总线EventBridge的事件类型。

事件类型

应用实时监控支持发布到事件总线EventBridge的事件类型如下所示。

事件类型 type参数值
agent启动 arms:Agent:AgentStart
死锁 arms:Agent:DeadLock
磁盘满 arms:Agent:DiskFull
应用下线 arms:Agent:OffLine
内存溢出 arms:Agent:OutofMermory
0-1报警 arms:Alert:0-1Alert
应用监控报警 arms:Alert:ApplicationAlert
应用监控默认报警 arms:Alert:ApplicationDefaultAlert
自定义报警 arms:Alert:CustomAlert
前端监控报警 arms:Alert:FrontEndAlert
前端监控默认报警 arms:Alert:FrontEndDefaultAlert
微服务报警 arms:Alert:MSEAlert
Promethus报警 arms:Alert:PromethusAlert
系统报警 arms:Alert:SystemAlert
XTrace报警 arms:Alert:XtraceAlert

CloudEvents规范中定义的参数解释,请参见事件概述

agent启动

当agent启动时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "dims":{
            "ip":"10.96.XX.XX"
        },
        "info":{
            "timestamp":"1605854706272"
        }
    },
    "datacontenttype":"application/json",
    "type":"arms:Agent:AgentStart",
    "id":"d3598ce6-09d7-4264-9ba3-5b13c387****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
dims Struct 维度。
ip String 10.96.XX.XX agent启动的服务器IP地址。
info Struct 事件的说明。
timestamp Timestamp 1605854706272 完成agent启动的时间戳。

死锁

当应用死锁时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "dims":{
            "ip":"172.16.XX.XX"
        },
        "threshold":0,
        "info":"[ARMS] Found deadlock:\n\"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2\" Id=73 BLOCKED on com.mysql.jdbc.JDBC4Connection@490cd2c9 owned by \"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1\" Id=72\n\tat com.mysql.jdbc.ConnectionImpl.getCharacterSetMetadata(ConnectionImpl.java:2798)\n\t-  blocked on com.mysql.jdbc.JDBC4Connection@490cd2c9\n\tat com.mysql.jdbc.Field.getStringFromBytes(Field.java:710)\n\tat com.mysql.jdbc.Field.getOriginalName(Field.java:652)\n\tat com.mysql.jdbc.ResultSetImpl.buildIndexMapping(ResultSetImpl.java:749)\n\tat com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1108)\n\tat com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:5030)\n\tat com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:51)\n\tat com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4962)\n\tat com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)\n\tat com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)\n\tat com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)\n\tat com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)\n\tat com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)\n\n\"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1\" Id=72 BLOCKED on com.mysql.jdbc.JDBC4ResultSet@17a62e0e owned by \"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2\" Id=73\n\tat com.mysql.jdbc.ResultSetImpl.realClose(ResultSetImpl.java:7477)\n\t-  blocked on com.mysql.jdbc.JDBC4ResultSet@17a62e0e\n\tat com.mysql.jdbc.ResultSetImpl.close(ResultSetImpl.java:907)\n\tat com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2478)\n\tat com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1584)\n\tat com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4364)\n\tat com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1556)\n\tat com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:474)\n\tat com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)\n\tat com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)\n\tat com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)\n\n"
    },
    "datacontenttype":"application/json",
    "type":"arms:Agent:DeadLock",
    "id":"8fef5584-8de0-4e07-b891-4b6d10f2****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
dims Struct 维度。
ip String 172.16.XX.XX 死锁的服务器IP地址。
info String
[ARMS] Found deadlock:\n\"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2\" Id=73 BLOCKED on com.mysql.jdbc.JDBC4Connection@490cd2c9 owned by \"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1\" Id=72\n\tat com.mysql.jdbc.ConnectionImpl.getCharacterSetMetadata(ConnectionImpl.java:2798)\n\t-  blocked on com.mysql.jdbc.JDBC4Connection@490cd2c9\n\tat com.mysql.jdbc.Field.getStringFromBytes(Field.java:710)\n\tat com.mysql.jdbc.Field.getOriginalName(Field.java:652)\n\tat com.mysql.jdbc.ResultSetImpl.buildIndexMapping(ResultSetImpl.java:749)\n\tat com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1108)\n\tat com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:5030)\n\tat com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:51)\n\tat com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4962)\n\tat com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)\n\tat com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)\n\tat com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)\n\tat com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)\n\tat com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)\n\n\"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1\" Id=72 BLOCKED on com.mysql.jdbc.JDBC4ResultSet@17a62e0e owned by \"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2\" Id=73\n\tat com.mysql.jdbc.ResultSetImpl.realClose(ResultSetImpl.java:7477)\n\t-  blocked on com.mysql.jdbc.JDBC4ResultSet@17a62e0e\n\tat com.mysql.jdbc.ResultSetImpl.close(ResultSetImpl.java:907)\n\tat com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2478)\n\tat com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1584)\n\tat com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4364)\n\tat com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1556)\n\tat com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:474)\n\tat com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)\n\tat com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)\n\tat com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)\n\tat com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)\n\n
事件的说明。

内存溢出

当应用内存溢出时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "dims":{
            "ip":"172.30.XX.XX"
        },
        "info":"java.lang.OutOfMemoryError at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:68)\\n at java.lang.StringBuilder.<init>(StringBuilder.java:101)"
    },
    "datacontenttype":"application/json",
    "type":"arms:Agent:OutofMermory",
    "id":"8fef5584-8de0-4e07-b891-4b6d10f2****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
dims Struct 维度。
ip String 172.30.XX.XX 内存溢出的服务器IP地址。
info String
java.lang.OutOfMemoryError at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:68) at java.lang.StringBuilder.<init>(StringBuilder.java:101)
事件的说明。

应用监控默认报警

当应用监控默认报警时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "msgs":{
            "0":{
                "msg":"JVM监控节点机IP:172.27.XX.XX最近1分钟线程数平均值与上一小时同比下跌未超过50.0%",
                "metric":"{\"alertId\":1712964,\"alertType\":7,\"appGroupId\":\"DEFAULT\",\"appId\":\"564575\",\"metricType\":1,\"pid\":\"9870ca99-8105-4da7-a3a4-d72dd1b1****\",\"regionId\":\"cn-hangzhou\",\"type\":\"JVM\"}",
                "isTrigger":false,
                "snapshot":{
                    "curVal0":0,
                    "curPoint":95,
                    "vpN0":95,
                    "vpP0":95,
                    "timestamp":1596615600000
                },
                "msgLink":"http://arms.console.aliyun.com/apm?startTime=1596611880000&endTime=1596615810704®ionId=cn-hangzhou&pid=9870ca99-8105-4da7-a3a4-d72dd1b1****#/9870ca99-8105-4da7-a3a4-d72dd1b1****/apps/%7B%22ip%22%3A%22172.27.0.25%22%2C%22tabs%22%3A%22jvm%22%7D",
                "tags":{
                    "rootIp":"172.27.XX.XX"
                }
            },
            "1":{
                "msg":"JVM监控节点机IP:172.27.XX.XX最近1分钟线程数平均值与上一小时同比下跌未超过50.0%",
                "metric":"{\"alertId\":1712964,\"alertType\":7,\"appGroupId\":\"DEFAULT\",\"appId\":\"564575\",\"metricType\":1,\"pid\":\"9870ca99-8105-4da7-a3a4-d72dd1b1****\",\"regionId\":\"cn-hangzhou\",\"type\":\"JVM\"}",
                "isTrigger":false,
                "snapshot":{
                    "curVal0":0,
                    "curPoint":95,
                    "vpN0":95,
                    "vpP0":95,
                    "timestamp":1596615600000
                },
                "msgLink":"http://arms.console.aliyun.com/apm?startTime=1596611880000&endTime=1596615810705®ionId=cn-hangzhou&pid=9870ca99-8105-4da7-a3a4-d72dd1b1****#/9870ca99-8105-4da7-a3a4-d72dd1b1****/apps/%7B%22ip%22%3A%22172.27.0.80%22%2C%22tabs%22%3A%22jvm%22%7D",
                "tags":{
                    "rootIp":"172.27.XX.XX"
                }
            }
        },
        "triggered":false,
        "extra":"9870ca99-8105-4da7-a3a4-d72dd1b1****",
        "ruleId":"1712964"
    },
    "datacontenttype":"application/json",
    "type":"arms:Alert:ApplicationDefaultAlert",
    "id":"15828433-3115-44ed-8518-67caa9ad****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
msgs Struct 多个message的集合。
0 Struct 报警规则触发的第一个message数据。
msg String JVM监控节点机IP:172.27.XX.XX最近1分钟线程数平均值与上一小时同比下跌未超过50.0% 报警规则的详情。
metric String
{\"alertId\":1712964,\"alertType\":7,\"appGroupId\":\"DEFAULT\",\"appId\":\"564575\",\"metricType\":1,\"pid\":\"9870ca99-8105-4da7-a3a4-d72dd1b1****\",\"regionId\":\"cn-hangzhou\",\"type\":\"JVM\"}
报警信息详情。
isTrigger Boolean false 报警规则是否触发。
snapshot Struct 计算报警规则的数据的快照。
curVal0 Integer 0 报警规则计算的结果。
curPoint Integer 95 当前时刻的值。
vpN0 Integer 95 当前时刻同比的值。
vpP0 Integer 95 当前时刻环比的值。
timestamp TimeStamp 1596615600000 生成快照的时间戳。
msgLink String http://arms.console.aliyun.com/apm?startTime=1596611880000&endTime=1596615810704®ionId=cn-hangzhou&pid=9870ca99-8105-4da7-a3a4-d72dd1b1****#/9870ca99-8105-4da7-a3a4-d72dd1b1****/apps/%7B%22ip%22%3A%22172.27.0.25%22%2C%22tabs%22%3A%22jvm%22%7D 报警规则所在链接。
tags Struct 维度。
rootIp String 172.27.XX.XX 以IP地址为维度的值。
triggered Boolean false 报警规则是否触发。
参数msgs下每个message中参数isTrigger的或逻辑的运算结果。
  • 如果message 0中isTrigger设置为false,message 1中isTrigger设置为false,那么triggeredfalse
  • 如果message 0中isTrigger设置为true,不管message 1中isTrigger设置为true还是false,那么triggeredtrue
extra String 9870ca99-8105-4da7-a3a4-d72dd1b1**** 应用ID。
ruleId String 1712964 报警规则的ID。

前端监控报警

当前端监控报警时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "msgs":{
            "0":{
                "msg":" 页面访问量最近10分钟平均值 >= 0.0, 当前值0.0000",
                "metric":"{\"alertId\":1531820,\"alertType\":4,\"metricType\":1,\"pid\":\"b590lhguqs@8cc3f63543d****\",\"regionId\":\"cn-hangzhou\",\"type\":\"RETCODE\"}",
                "isTrigger":true,
                "snapshot":{
                    "curVal0":0,
                    "vpN0":0,
                    "vpP0":0,
                    "timestamp":1596615420000
                },
                "msgLink":"http://arms.console.aliyun.com/retcode?pid=b590lhguqs%408cc3f63543d****#/url?&begin=1596611160000&end=1596615525123",
                "tags":{

                }
            }
        },
        "triggered":true,
        "extra":"b590lhguqs@8cc3f63543d****",
        "ruleId":"1531820"
    },
    "datacontenttype":"application/json",
    "type":"arms:Alert:FrontEndAlert",
    "id":"fdcd44d0-9a64-4e88-a9b7-a3e26bfd****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
msgs Struct 多个message的集合。
0 Struct 报警规则触发的第一个message数据。
msg String 页面访问量最近10分钟平均值大于等于0.0, 当前值0.0000 报警规则的详情。
metric String
{\"alertId\":1531820,\"alertType\":4,\"metricType\":1,\"pid\":\"b590lhguqs@8cc3f63543d****\",\"regionId\":\"cn-hangzhou\",\"type\":\"RETCODE\"}
报警信息详情。
isTrigger Boolean true 报警规则是否触发。
snapshot Struct 计算报警规则的数据的快照。
curVal0 Integer 0 报警规则计算的结果。
vpN0 Integer 0 当前时刻同比的值。
vpP0 Integer 0 当前时刻环比的值。
timestamp TimeStamp 1596615420000 生成快照的时间戳。
msgLink String http://arms.console.aliyun.com/retcode?pid=b590lhguqs%408cc3f63543d****#/url?&begin=1596611160000&end=1596615525123 报警规则所在链接。
tags Struct 维度。
triggered Boolean true 报警规则是否触发。
参数msgs下每个message中参数isTrigger的或逻辑的运算结果。
  • 如果message 0中isTrigger设置为false,message 1中isTrigger设置为false,那么triggeredfalse
  • 如果message 0中isTrigger设置为true,不管message 1中isTrigger设置为true还是false,那么triggeredtrue
extra String b590lhguqs@8cc3f63543d**** 应用ID。
ruleId String 1531820 报警规则的ID。

Promethus报警

当Promethus报警时,事件总线EventBridge接收到的事件示例如下所示。

{
    "specversion":"1.0",
    "subject":"",
    "source":"acs.arms",
    "data":{
        "msgs":{
            "0":{
                "msg":"最近1分钟线程数平均值小于5.0, 当前值3.0000",
                "metric":"{\"alertId\":1224848,\"alertType\":101,\"metricType\":3,\"regionId\":\"cn-hangzhou\"}",
                "isTrigger":false,
                "snapshot":{
                    "curVal0":3,
                    "curPoint":3,
                    "vpN0":3,
                    "vpP0":3,
                    "timestamp":1596615360000
                },
                "tags":{
                    "":"{}"
                }
            }
        },
        "triggered":false,
        "ruleId":"1224848"
    },
    "datacontenttype":"application/json",
    "type":"arms:Alert:PrometheusAlert",
    "id":"f6c63e8b-1566-4441-9a43-88d59667****",
    "time":"2020-11-19T21:04:41+08:00",
    "aliyunaccountid":"123456789098****",
    "aliyunpublishtime":"2020-11-19T21:04:42.179PRC",
    "aliyuneventbusname":"default",
    "aliyunregionid":"cn-hangzhou",
    "aliyunpublishaddr":"172.25.XX.XX"
}

data字段包含的参数解释如下表所示。

参数 类型 示例值 描述
msgs Struct 多个message的集合。
0 Struct 报警规则触发的第一个message数据。
msg String 最近1分钟线程数平均值小于5.0, 当前值3.0000 报警规则的详情。
metric String
{\"alertId\":1224848,\"alertType\":101,\"metricType\":3,\"regionId\":\"cn-hangzhou\"}
报警信息详情。
isTrigger Boolean false 报警规则是否触发。
snapshot Struct 计算报警规则的数据的快照。
curVal0 Integer 3 报警规则计算的结果。
curPoint Integer 3 当前时刻的值。
vpN0 Integer 3 当前时刻同比的值。
vpP0 Integer 3 当前时刻环比的值。
timestamp TimeStamp 1596615360000 生成快照的时间戳。
tags Struct 维度。
triggered Boolean false 报警规则是否触发。
参数msgs下每个message中参数isTrigger的或逻辑的运算结果。
  • 如果message 0中isTrigger设置为false,message 1中isTrigger设置为false,那么triggeredfalse
  • 如果message 0中isTrigger设置为true,不管message 1中isTrigger设置为true还是false,那么triggeredtrue
ruleId String 1224848 报警规则的ID。