ARMS enterprise-level scenarios are introduced by integrated scenarios

阿里云开发者
中文
Introduction to ARMS enterprise-level scene is integrated scene introduction

56f5ded39bcc4efc94ff1398a9db9782.png

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 .

1.jpg

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.

2.jpg

Figure 2: EDAS console

3.jpg

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.

4.jpg

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/)

nameinterface
Dataset API/dataset/GeneralQuery.json
Key application performance indicators/metric/Metric.json
Alarm informationnone
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 NameField TypeField meaningIs it mandatoryRemark
\_userIdStringUser idYesUser 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****

5.jpg

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.

6.jpg

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 NameField TypeField meaningIs it mandatoryRemark
startTimeLongStart time for querying dataYesnone
endTimeLongDeadline for querying dataYesnone
intervalInSecIntegertime intervalnoSuggest to fill in
metricStringmetric fieldYesFill in the reference parameters in detail and fill in the demonstration
filtersList[String]Filter fieldYesFill in the reference parameters in detail and fill in the demonstration
measuresList[String]indexYesFill in the reference parameters in detail and fill in the demonstration
dimensionsList[String]DimensionYesFill in the reference parameters in detail and fill in the demonstration
orderByStringSort fieldnonone
sortOrderStringSortnoNo sorting by default (ASC or DESC)
limitIntegerReturn numbernonone
\_userIdStringUser idYesUser 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 NameField TypeField meaningrequiredSample valueValue source
startTimeLongStart time for querying dataYes1578199319898system time
endTimeLongDeadline for querying dataYes1578804119898system time
intervalInSecIntegertime intervalnoThe default is 3600 seconds, which is 1 hourManual setting
metricStringmetric field, the metric to be queriedYesAPPSTAT.DETAILManual setting
filtersList[String]Filter field, strictly follow the format, otherwise call errorYes[{key=pid,value=1218274334230390@db61f75c2f******},{key=regionId,value=cn-******-d01}]Pid and regionid come from a proprietary cloud environment
measuresList[String]indexYes[rt,count,error,errrate]API documentation
dimensionsList[String]DimensionYes[pid,rpcType,rootIp]API documentation
orderByStringSort fieldnononenone
sortOrderStringSortnoNo sorting by default (ASC or DESC)none
limitIntegerReturn numbernononenone
\_userIdStringUser idYes121827433423****none

search result

parameter settings:

7.jpg

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 NameField TypeField meaningIs it mandatoryRemark
startTimeLongStart time for querying dataYesnone
endTimeLongDeadline for querying dataYesnone
intervalInSecIntegertime intervalnoSuggest to fill in
metricStringmetric fieldYesFor details, please refer to the following
filtersList[String]Filter fieldYesFor details, please refer to the following
measuresList[String]indexYesFor details, please refer to the following
dimensionsList[String]DimensionYesFor details, please refer to the following
orderByStringSort fieldnonone
sortOrderStringSortnoNo sorting by default (ASC or DESC)
limitIntegerReturn numbernonone
\_userIdStringUser idYesUser 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 NameField TypeField meaningrequiredSample valueValue source
startTimeLongStart time for querying dataYes1577980826988system time
endTimeLongDeadline for querying dataYes1578585626989system time
intervalInSecIntegertime intervalnoThe default is 3600 seconds, which is 1 hourManual setting
metricStringmetric field, the metric to be queriedYesAPPSTAT.EXCEPTIONManual setting
filtersList[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
measuresList[String]indexYes[count]API documentation
dimensionsList[String]DimensionYes[pid,rpc,endpoint,exceptionInfo]API documentation
orderByStringSort fieldnononenone
sortOrderStringSortnoNo sorting by default (ASC or DESC)none
limitIntegerReturn numbernononenone
\_userIdStringUser idYes1218274334230390none

search result

parameter settings:

8.jpg

Figure 8: Parameter settings

search result:

9.jpg

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 NameField TypeField meaningIs it mandatoryRemark
startTimeLongStart time for querying dataYesnone
endTimeLongDeadline for querying dataYesnone
intervalInSecIntegertime intervalnoSuggest to fill in
metricStringmetric fieldYesFor details, please refer to the following
filtersList[String]Filter fieldYesFor details, please refer to the following
measuresList[String]indexYesFor details, please refer to the following
dimensionsList[String]DimensionYesFor details, please refer to the following
orderByStringSort fieldnonone
sortOrderStringSortnoNo sorting by default (ASC or DESC)
limitIntegerReturn numbernonone
\_userIdStringUser idYesUser 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 NameField TypeField meaningrequiredSample valueValue source
startTimeLongStart time for querying dataYes1577980826988system time
endTimeLongDeadline for querying dataYes1578585626989system time
intervalInSecIntegertime intervalnoThe default is 3600 seconds, which is 1 hourManual setting
metricStringmetric field, the metric to be queriedYesAPPSTAT.DETAILManual setting
filtersList[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
measuresList[String]indexYes[count]API documentation
dimensionsList[String]DimensionYes[pid,rootIp]API documentation
orderByStringSort fieldnononenone
sortOrderStringSortnoNo sorting by default (ASC or DESC)none
limitIntegerReturn numbernononenone
\_userIdStringUser idYes12182743342******none

search result

parameter settings:

10.jpg

Figure 10: Parameter setting

search result:

11.jpg

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 NameField TypeField meaningIs it mandatoryRemark
startTimeLongStart time for querying dataYesnone
endTimeLongDeadline for querying dataYesnone
\_userIdStringUser idYesUser name (such as arms\_admin)
typeStringQuery typeYesUse ALL for querying all relationships; use APP for relationships of a single application
pidStringApplication corresponding pidnoRequired 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 NameField TypeField meaningrequiredSample value
startTimeLongStart time for querying dataYes1578199319898 (January 5)
endTimeLongDeadline for querying dataYes1578804119898 (January 12)
\_userIdStringUser idYes1218274334******
typeStringQuery typeYesAPP
pidStringApplication corresponding pidno1218274334230390@db61f75c******

search result

parameter settings:

12.jpg

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:

13.jpg

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.
阅读 356

阿里巴巴官方技术号,关于阿里巴巴经济体的技术创新、实战经验、技术人的成长心得均呈现于此。

2.8k 声望
6.1k 粉丝
0 条评论
你知道吗?

阿里巴巴官方技术号,关于阿里巴巴经济体的技术创新、实战经验、技术人的成长心得均呈现于此。

2.8k 声望
6.1k 粉丝
宣传栏