Skip to content

Configuration Manual for the "Volcengine-CDN" Collector

Before reading this article, please read:

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

The Content Delivery Network (CDN) collector does not require configuration of geographic parameters

Configuring Filters (Optional)

This collector script supports user-defined filters, allowing users to filter target resources based on object properties. The filter function returns True or False.

  • True: The target resource needs to be collected.
  • False: The target resource does not need to be collected.

Supported object properties for filtering:

Property Description
CacheShared Indicates the role of the accelerated domain in shared cache configurations
target_host: indicates that there is a shared cache configuration
cache_shared_on: indicates that there are shared cache configurations
"": This parameter value is empty, indicating that the accelerated domain does not belong to any shared cache configuration.
CacheSharedTargetHost If CacheShared is cache_shared_on, it represents the target domain sharing the cache with the accelerated domain.
If CacheShared is target_host or an empty value ("") , this parameter value is also empty ("").
Cname The CNAME address of the domain, automatically assigned when adding a domain.
Domain Accelerated domain
HTTPS Indicates whether the accelerated domain has enabled HTTPS functionality.
IPv6 Indicates whether the accelerated domain supports access via IPv6 addresses.
ServiceRegion Domain acceleration region, currently only supports acceleration within mainland China.
Status Indicates whether the domain is locked. This parameter has the following values:
on: indicates that the domain is locked.
off: indicates that the domain is not locked.
ServiceType Specifies a type of domain service for querying:
web: webpage/small file acceleration;
download: large file download acceleration;
video: audio/video on-demand acceleration.
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Example: Enable the filter to filter instances based on InstanceId and name properties, configuration format as follows:
def filter_instance(instance):
    '''
    Collect instances where instance_id is xxxxx or instance_name is xxxxx 
    '''
    # return True
    instance_id = instance['Domain']
    status = instance['Status']
    if instance_id in ['xxxxx'] or status in ['xxxxx']:
        return True
    return False


###### Do not modify the following contents #####
from guance_integration__runner import Runner
import guance_volcengine_cdn__main as main


@DFF.API('Volcengine-CDN Collection', timeout=3600, fixed_crontab='*/15 * * * *')
def run():
    Runner(main.DataCollector(account, filters=[filter_instance])).run()

1. Data Reporting Format

After data synchronization, you can view the data in the {{( brand_name )}}'s "Infrastructure - Resource Catalog".

Example of reported data:

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
{
  "measurement": "volcengine_cdn",
  "tags": {
    "CacheShared": "",
    "CacheSharedTargetHost": "",
    "Cname": "test-aaa.volcgslb.com",
    "Domain": "test.cn",
    "HTTPS": "False",
    "IPv6": "False",
    "IsConflictDomain": "False",
    "OriginProtocol": "http",
    "Project": "default",
    "ServiceRegion": "chinese_mainland",
    "ServiceType": "web",
    "Status": "online",
    "name": "test.cn"
  },
  "fields": {
    "CreateTime": 1712543155,
    "BackupOrigin": "[represents the backup origin list of the accelerated domain]",
    "DomainLock": "{represents the lock status of the accelerated domain}",
    "PrimaryOrigin": "[specifies one primary origin for filtering the accelerated domain]",
    "ResourceTags": "[details of the domain tag group]",
    "UpdateTime": 1712543155,
    "message": "{instance JSON data}"
  }
}

Fields in tags and fields may change with subsequent updates

The value of tags.name is the instance ID, serving as a unique identifier. fields.message, fields.BackupOrigin, fields.DomainLock, fields.PrimaryOrigin, and fields.ResourceTags are all JSON serialized strings.

X. Appendix

Please refer to the official Volcengine documentation: