Introduction to ARMS enterprise-level scene is integrated scene introduction
Through this best practice content, you can see that ARMS OpenAPI can be flexibly integrated into customer link monitoring scenarios, and the monitoring information can be displayed visually and graphically.
1. Background information
Application Real-Time Monitoring Service (ARMS) is an application performance management product that can help you achieve full-stack performance monitoring and end-to-end full-link tracking and diagnosis, making application operation and maintenance more efficient.
This best practice is based on the form of calling ARMS OpenAPI to realize the visual graphic display of customer application scene link monitoring. The use environment is the ASCM console of ApsaraDB for V3.10. The ARMS OpenAPI interface is called for testing through the tool Postman. The second chapter introduces the test environment and test tools in detail. The third chapter describes the calling process through a query of all applications ARMS OpenAPI interface, and contains the interface list of the parameters that the interface needs to request. The last chapter will use the ARMSOpenAPI interface to obtain link monitoring information for a complex application scenario, and introduce each interface list field, calling process, and return result in detail.
Best practice value
By calling the use of ARMS OpenAPI in application scenarios, readers can intuitively understand the capabilities of ARMS products, and ARMS provides a set of OpenAPIs that can be easily integrated into customer applications to quickly realize complex microservice link monitoring capabilities, which are monitored by ARMS Service capabilities cover a wide range of capabilities, including browsers, applets, APPs, distributed applications and container environments, so complete monitoring capabilities, no need to integrate multiple open source components in the development process, making the development of microservice program monitoring functions simple , Make application operation and maintenance easy.
2. Environment
Before using ARMS, you need to check the current system environment according to the following content.
This best practice is based on the proprietary cloud enterprise version V3.10.0 version ARMS.
Description : The versions of ARMS OpenAPI have not changed much, and the usage methods are consistent. Therefore, this document is also applicable to public cloud products or private cloud V3.7.0 and above. The Proprietary Cloud V3.10.0 console is called ASCM, and the version before V3.10.0 is Apsara Stack.
1. Log in to the ASCM console.
product navigation bar at the top of the page, and click enterprise-level distributed application service EDAS .
Figure 1: ASCM
Description : Because ARMS monitors application data, it needs the cooperation of EDAS products. In this test, a standard Spring Boot application was deployed through EDAS, and ARMS monitoring was enabled and monitoring data was obtained.
Figure 2: EDAS console
Figure 3: ARMS console
3. Test tool inspection.
This practice will create a win64 virtual machine in a private cloud environment, and then install Postman in the virtual machine for testing.
Figure 4: Postman test
3. Use of Open API
Call URL confirmation
OpenAPI interfaces are all REST services, first confirm the URL of the service.
The domain name of each private cloud environment is different, which will lead to different URLs. Please modify the URL information according to the specific environment information, and the prefix and port remain unchanged.[http://arms.console.example.com:8099/](http://arms.console.example.com:8099/)
name | interface |
---|---|
Dataset API | /dataset/GeneralQuery.json |
Key application performance indicators | /metric/Metric.json |
Alarm information | none |
Application Monitoring-Application Topology | /trace/Dependecies.json |
Event set | /eventset/EventList.json |
Call example-view all applications:
API description
URL:[http://arms.console.example.com:8099/trace/Services.json](http://arms.console.example.com:8099/trace/Services.json)
parameter list
Field Name | Field Type | Field meaning | Is it mandatory | Remark |
---|---|---|---|---|
\_userId | String | User id | Yes | User name (e.g. arms\_admin) |
Return format example
{
"code": 200,
"data": {
"details": [
{
"pid": "string", //应用对应的pid
"regionId": "string",
"serviceName": "string" //应用名称
}
],
"services":[ //应用名称列表
"string",
"string"
]
},
"success": true
}
Postman call result
Parameter setting: \_userId= 121827433423****
Figure 5: Postman call result
4. Application description
The application topology data, graphs, and application monitoring index data obtained from ARMS will be displayed on the large screen DataV.
Figure 6: DataV display
5. Query the number of interface calls
Obtain application-related performance data through the /metric/Metric.json interface, and query the number of interface calls.
API description
- URL :
[http://arms.console.example.com:8099/metric/Metric.json](http://arms.console.example.com:8099/metric/Metric.json)
- Interface Description:
Field Name | Field Type | Field meaning | Is it mandatory | Remark |
---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | none |
endTime | Long | Deadline for querying data | Yes | none |
intervalInSec | Integer | time interval | no | Suggest to fill in |
metric | String | metric field | Yes | Fill in the reference parameters in detail and fill in the demonstration |
filters | List[String] | Filter field | Yes | Fill in the reference parameters in detail and fill in the demonstration |
measures | List[String] | index | Yes | Fill in the reference parameters in detail and fill in the demonstration |
dimensions | List[String] | Dimension | Yes | Fill in the reference parameters in detail and fill in the demonstration |
orderBy | String | Sort field | no | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) |
limit | Integer | Return number | no | none |
\_userId | String | User id | Yes | User name (e.g. arms\_admin) |
Call example
Query the number of interface calls of a specified application in the past 7 days
Demonstration of parameter filling:
Field Name | Field Type | Field meaning | required | Sample value | Value source |
---|---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | 1578199319898 | system time |
endTime | Long | Deadline for querying data | Yes | 1578804119898 | system time |
intervalInSec | Integer | time interval | no | The default is 3600 seconds, which is 1 hour | Manual setting |
metric | String | metric field, the metric to be queried | Yes | APPSTAT.DETAIL | Manual setting |
filters | List[String] | Filter field, strictly follow the format, otherwise call error | Yes | [{key=pid,value=1218274334230390@db61f75c2f******},{key=regionId,value=cn-******-d01}] | Pid and regionid come from a proprietary cloud environment |
measures | List[String] | index | Yes | [rt,count,error,errrate] | API documentation |
dimensions | List[String] | Dimension | Yes | [pid,rpcType,rootIp] | API documentation |
orderBy | String | Sort field | no | none | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) | none |
limit | Integer | Return number | no | none | none |
\_userId | String | User id | Yes | 121827433423**** | none |
search result
parameter settings:
Figure 7: Parameter settings
Result description:
- The returned result is a JSON data set.
- The data set will indicate the query status, and it will return 200 if it succeeds. If it fails, it will return the corresponding error code and error reason. Typical errors include missing necessary parameters, identity authentication errors, etc. (because the filters parameter is not written in accordance with the format requirements).
- The organization of the result set returned by OpenAPI is related to the start time, end time, and data interval of the query data. This query is for the past 7 days, and the data interval is set to 24 hours, so 7 sets of "data" are returned in this result set.
- Each data includes the queries specified in "measure" and "dimension". Taking this result set as an example, it includes: Count:0.0
PID:
rpcDesc: HTTP entry
rpcType:0 (HTTP call) - Adjusting the start, end, and interval time of the query will affect the number of data items, and adjusting the interface query parameters will affect the data in each data item.
- If you need to calculate some aggregate values, such as the total number of HTTP calls in the past 7 days, you need to calculate and add multiple pieces of data yourself to get the result.
6. Query the number of exceptions
Obtain application-related performance data through the /metric/Metric.json interface and query the number of abnormalities.
API description
- URL :
[http://arms.console.example.com:8099/metric/Metric.json](http://arms.console.example.com:8099/metric/Metric.json)
- Interface Description:
Field Name | Field Type | Field meaning | Is it mandatory | Remark |
---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | none |
endTime | Long | Deadline for querying data | Yes | none |
intervalInSec | Integer | time interval | no | Suggest to fill in |
metric | String | metric field | Yes | For details, please refer to the following |
filters | List[String] | Filter field | Yes | For details, please refer to the following |
measures | List[String] | index | Yes | For details, please refer to the following |
dimensions | List[String] | Dimension | Yes | For details, please refer to the following |
orderBy | String | Sort field | no | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) |
limit | Integer | Return number | no | none |
\_userId | String | User id | Yes | User name (e.g. arms\_admin) |
Call example
Query the number of interface calls of the specified application in the past 7 days.
Demonstration of parameter filling:
Field Name | Field Type | Field meaning | required | Sample value | Value source |
---|---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | 1577980826988 | system time |
endTime | Long | Deadline for querying data | Yes | 1578585626989 | system time |
intervalInSec | Integer | time interval | no | The default is 3600 seconds, which is 1 hour | Manual setting |
metric | String | metric field, the metric to be queried | Yes | APPSTAT.EXCEPTION | Manual setting |
filters | List[String] | Filter fields, strictly in accordance with the format, otherwise the call will make an error. | Yes | [{key=pid,value=1218274334230390@db61f75c2f******},{key=regionId,value=cn-******-d01}] | Pid and regionid come from a proprietary cloud environment |
measures | List[String] | index | Yes | [count] | API documentation |
dimensions | List[String] | Dimension | Yes | [pid,rpc,endpoint,exceptionInfo] | API documentation |
orderBy | String | Sort field | no | none | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) | none |
limit | Integer | Return number | no | none | none |
\_userId | String | User id | Yes | 1218274334230390 | none |
search result
parameter settings:
Figure 8: Parameter settings
search result:
Figure 9: Query results
Result description:
- The returned result is a JSON data set.
- The data set will indicate the query status, and it will return 200 if it succeeds. If it fails, it will return the corresponding error code and error reason. Typical errors include missing necessary parameters, identity authentication errors, etc. (because the filters parameter is not written in accordance with the format requirements).
- No relevant data was found in this query, so the number of exceptions is 0.
7. Query the number of current application instances
Obtain application-related performance data through the /metric/Metric.json interface, and query the number of current application instances.
API description
- URL :
[http://arms.console.example.com:8099/metric/Metric.json](http://arms.console.example.com:8099/metric/Metric.json)
- Interface Description:
Field Name | Field Type | Field meaning | Is it mandatory | Remark |
---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | none |
endTime | Long | Deadline for querying data | Yes | none |
intervalInSec | Integer | time interval | no | Suggest to fill in |
metric | String | metric field | Yes | For details, please refer to the following |
filters | List[String] | Filter field | Yes | For details, please refer to the following |
measures | List[String] | index | Yes | For details, please refer to the following |
dimensions | List[String] | Dimension | Yes | For details, please refer to the following |
orderBy | String | Sort field | no | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) |
limit | Integer | Return number | no | none |
\_userId | String | User id | Yes | User name (e.g. arms\_admin) |
Call example
Query the number of interface calls of the specified application in the past 7 days.
Demonstration of parameter filling:
Field Name | Field Type | Field meaning | required | Sample value | Value source |
---|---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | 1577980826988 | system time |
endTime | Long | Deadline for querying data | Yes | 1578585626989 | system time |
intervalInSec | Integer | time interval | no | The default is 3600 seconds, which is 1 hour | Manual setting |
metric | String | metric field, the metric to be queried | Yes | APPSTAT.DETAIL | Manual setting |
filters | List[String] | Filter fields, strictly in accordance with the format, otherwise the call will make an error. | Yes | [{key=pid,value=1218274334230390@db61f75c2f28609},{key=regionId,value=******}] | Pid and regionid come from a proprietary cloud environment |
measures | List[String] | index | Yes | [count] | API documentation |
dimensions | List[String] | Dimension | Yes | [pid,rootIp] | API documentation |
orderBy | String | Sort field | no | none | none |
sortOrder | String | Sort | no | No sorting by default (ASC or DESC) | none |
limit | Integer | Return number | no | none | none |
\_userId | String | User id | Yes | 12182743342****** | none |
search result
parameter settings:
Figure 10: Parameter setting
search result:
Figure 11: Query results
Result description:
- The returned result is a JSON data set.
- The data set will indicate the query status, and it will return 200 if it succeeds. If it fails, it will return the corresponding error code and error reason. Typical errors such as missing necessary parameters, authentication errors, etc. (because the filters parameter is not written in accordance with the format requirements).
- The organization of the result set returned by Openapi is related to the start time, end time, and data interval of the query data. This query is for the past 7 days, and the data interval is set to 24 hours, so 7 sets of "data" are returned in this result set.
- Each data includes measure and dimension . Taking this result set as an example, it includes: Count:0.0
RootIP - The requirement of this query depends on how many instances of this application are deployed, so by calculating the different IPs in the result, you can calculate the total number of instances. Another method is to set the value of intervalInSec and let it wait for the query interval, so that the number of data collections is the value of the number of instances, because each IP will have a piece of data.
8. Query the current application topology
Obtain application topology related data through the /trace/Dependecies.json interface.
API description
- URL :
[http://arms.console.example.com:8099/trace/Dependecies.json](http://arms.console.example.com:8099/trace/Dependecies.json)
- Interface Description:
Field Name | Field Type | Field meaning | Is it mandatory | Remark |
---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | none |
endTime | Long | Deadline for querying data | Yes | none |
\_userId | String | User id | Yes | User name (such as arms\_admin) |
type | String | Query type | Yes | Use ALL for querying all relationships; use APP for relationships of a single application |
pid | String | Application corresponding pid | no | Required when type=APP |
Call example
Query the number of interface calls of the specified application in the past 7 days.
Demonstration of parameter filling:
This test was conducted on January 12, and the data for the past 7 days was queried.
Field Name | Field Type | Field meaning | required | Sample value |
---|---|---|---|---|
startTime | Long | Start time for querying data | Yes | 1578199319898 (January 5) |
endTime | Long | Deadline for querying data | Yes | 1578804119898 (January 12) |
\_userId | String | User id | Yes | 1218274334****** |
type | String | Query type | Yes | APP |
pid | String | Application corresponding pid | no | 1218274334230390@db61f75c****** |
search result
parameter settings:
Figure 12: Parameter settings
search result:
{
"code": 200,
"data": {
"link": [{
"code": 200,
"data": {
"link": [
{
"callCount": 26997.0,
"child": "Demo-Service",
"childNodeId": 731107445,
"childPid": "1218274334230390@db61f75c2******",
"elapsed": 16.2328,
"errorCount": 16.0,
"parent": "USER",
"parentNodeId": 812148234,
"parentPid": "1218274334230390@db61f75c2******",
"protocol": "HTTP"
},
{
"callCount": 8.0,
"child": "pdsa_lhh_rocketmq",
"childNodeId": -1762019072,
"childPid": "pdsa_lhh_rocketmq",
"elapsed": 11190.5,
"errorCount": 8.0,
"parent": "Demo-Service",
"parentNodeId": 731107445,
"parentPid": "1218274334230390@db61f75c2******",
"protocol": "AliWareMQ"
}
],
"nodes": [
{
"elapsed": 0.0,
"errorCount": 0.0,
"id": 812148234,
"name": "USER",
"pid": "1218274334230390@db61f75c2******",
"requestCount": 0.0,
"type": "USER"
},
{
"elapsed": 0.0,
"errorCount": 0.0,
"id": 731107445,
"name": "Demo-Service",
"pid": "1218274334230390@db61f75c2******",
"requestCount": 0.0,
"type": "MQ_PRODUCER"
},
{
"elapsed": 0.0,
"errorCount": 0.0,
"id": -1762019072,
"name": "pdsa_****_rocketmq",
"pid": "pdsa_****_rocketmq",
"requestCount": 0.0,
"type": "METAQ"
}
]
},
"success": true
}
The actual topology map effect is as follows:
Figure 13: Topology diagram
Result description:
- The returned result is a JSON data set.
- The data set will indicate the query status, and it will return 200 if it succeeds. If it fails, it will return the corresponding error code and error reason. Typical errors include missing necessary parameters, identity authentication errors, etc. (because the filters parameter is not written in accordance with the format requirements).
- The query result is the node data and connection data of a dot-line graph, and the user needs to assemble the corresponding data according to the graph control.
We are the Alibaba Cloud Intelligent Global Technical Service-SRE team. We are committed to becoming a technology-based, service-oriented, and high-availability engineer team of business systems; providing professional and systematic SRE services to help customers make better use of the cloud 、Build a more stable and reliable business system based on the cloud to improve business stability. We hope to share more technologies that help enterprise customers go to the cloud, make good use of the cloud, and make their business operations on the cloud more stable and reliable. You can scan the QR code below to join the Alibaba Cloud SRE Technical Institute Dingding circle, and more The multi-cloud master communicates about those things about the cloud platform.
Copyright Statement: content of this article is contributed spontaneously by Alibaba Cloud real-name registered users. The copyright belongs to the original author. The Alibaba Cloud Developer Community does not own its copyright and does not assume corresponding legal responsibilities. For specific rules, please refer to the "Alibaba Cloud Developer Community User Service Agreement" and the "Alibaba Cloud Developer Community Intellectual Property Protection Guidelines". If you find suspected plagiarism in this community, fill in the infringement complaint form to report it. Once verified, the community will immediately delete the suspected infringing content.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。