Skip to content

Configuration Manual for "Alibaba Cloud - Site Monitoring - Metric Collection" Collector

Before reading this article, please read the following first:

Before using this collector, you must install the 'Integration Core Package' and its associated third-party dependency packages

Before collecting site monitoring metric data, you must configure the 'Alibaba Cloud - Site Monitoring Task Collection' custom object collector

This collector supports multi-threading by default (with five threads enabled). If you need to change the thread pool size, you can set the environment variable COLLECTOR_THREAD_POOL_SIZE

1. Configuration Structure

Site monitoring metric collection requires no additional configuration.

2. Metric Data Format

After data synchronization is successful, you can view the data in the 'Metrics' section of TrueWatch.

Data example as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "fields": {
    "HTTPConnectTime": 33.0,
    "HTTPDNSTime": 9.0,
    "HTTPDownloadSize": 56172.0,
    "HTTPDownloadSpeed": 8582605.0,
    "HTTPDownloadTime": 6.0,
    "HTTPResponseCode": 200.0,
    "SSLConnectTime": 42.0,
    "TotalTime": 227.0,
    "curlConnectTime": 15.0,
    "curlPretransferTime": 42.0,
    "curlStarttransferTime": 143.0,
    "errorCode": 0.0,
    "redirectCount": 1.0,
    "redirectTime": 77.0,
    "tcpConnectTime": 15.0
  },
  "measurement": "aliyun_site_monitor",
  "tags": {
    "TaskId": "693a16b9-xxxx",
    "areaCN": "East China",
    "areaEN": "HuaDong",
    "cityCN": "Shanghai",
    "cityEN": "Shanghai",
    "countryCN": "China",
    "countryEN": "China",
    "ispCN": "Alibaba",
    "ispEN": "Alibaba",
    "provinceCN": "Shanghai",
    "provinceEN": "Shanghai"
  },
  "timestamp": 1715050378317
}

All metric values will be reported as float types

3. Coordination with Custom Object Collectors

When the 'Alibaba Cloud - Site Monitoring Task Collection' custom object collector runs within the same DataFlux Func, this collector will automatically attempt to match the tags.TaskId field with the tags.name field of custom objects.

Since it is necessary to know the custom object information before coordination can occur within cloud monitoring collectors, it is generally recommended to place the cloud monitoring collector at the end of the list, for example:

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Create a collector
import guance_aliyun_site_monitor_task__main as main
import guance_aliyun_site_monitor_metric__main as monitor_main

@DFF.API('AlibabaCloud-Site-Monitor Collection', timeout=3600, fixed_crontab='* * * * *')
def run():
  collectors = [
      main.DataCollector(account),
      monitor_main.DataCollector(account) # Cloud monitoring collectors are usually placed at the end
  ]

When a successful match occurs, fields from the matched custom object tags will be added to the tags of the monitoring data, thereby enabling effects such as filtering cloud monitoring metric data using instance names.

The final reported data is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "fields": {
    "HTTPConnectTime": 33.0,
    "HTTPDNSTime": 9.0,
    "HTTPDownloadSize": 56172.0,
    "HTTPDownloadSpeed": 8582605.0,
    "HTTPDownloadTime": 6.0,
    "HTTPResponseCode": 200.0,
    "SSLConnectTime": 42.0,
    "TotalTime": 227.0,
    "curlConnectTime": 15.0,
    "curlPretransferTime": 42.0,
    "curlStarttransferTime": 143.0,
    "errorCode": 0.0,
    "redirectCount": 1.0,
    "redirectTime": 77.0,
    "tcpConnectTime": 15.0
  },
  "measurement": "aliyun_site_monitor",
  "tags": {
    "Address": "www.guance.com",
    "AgentGroup": "PC",
    "Interval": "60000",
    "TaskId": "693a16b9-xxxx",
    "TaskName": "Guance Main Station",
    "TaskState": "1",
    "TaskType": "HTTP",
    "areaCN": "East China",
    "areaEN": "HuaDong",
    "cityCN": "Shanghai",
    "cityEN": "Shanghai",
    "countryCN": "China",
    "countryEN": "China",
    "ispCN": "Alibaba",
    "ispEN": "Alibaba",
    "name": "693a16b9-xxxx",
    "provinceCN": "Shanghai",
    "provinceEN": "Shanghai"
  },
  "timestamp": 1715052030667
}

5. Explanation of Cloud Monitoring API Call Counts

Currently, there is no fee description provided for this interface in the documentation.

X. Appendix

Please refer to the official Alibaba Cloud documentation: