Metric Exporter
Metric Exporter simplifies domain data collection and analysis, providing actionable insights into performance, behavior, and errors. It automatically processes logs and generates metrics for graphing and reporting in Grafana, Prometheus, and Splunk. The data is exported in Plain Text format.
Monitoring domain metrics differs from sending logs. Logs require more storage due to their large size, while metrics are structured and lighter. Logs are better suited for troubleshooting and analyzing detailed events, while metrics are ideal for monitoring, alerting, and analyzing patterns and trends.
Submitted metrics
Using Metric Exporter, you can monitor Upstream Error Metrics, DNS Metrics, HTTP Access Metrics, and Event Metrics for your domains.
Access Metrics
Access Metrics | Description | Type | Label |
---|---|---|---|
http_top_requests_ip | 10 IPs with the most requests | Counter | hostname, ip: user IP |
http_top_requests_server_code | 10 Server Codes with the Most Requests | Counter | hostname, server_code: CDN server number |
http_top_requests_asn | 10 ASNs with the most requests | Counter | hostname, asn: the asn number from which the request was sent to the upstream server |
http_requests_total | Total number of requests | Counter | hostname, method: HTTP request method, content_type: Content type of the request, status: HTTP status code received from the CDN |
http_bytes_sent_total | Total number of bytes sent in HTTP responses | Counter | hostname, method: HTTP request method, content_type: Type of content sent by the request |
http_bytes_received_total | Total number of bytes received in HTTP requests | Counter | hostname, method: HTTP request method, content_type: Type of content sent by the request |
http_cache_hit_rate | Cache Hit Ratio to Total Requests | Gauge | hostname, cache: cache status which can have values of Hit, Miss, Bypass and Updating |
http_server_port_usage | Number of times server ports are used | Gauge | hostname, server_port: port of the upstream server where requests arrive |
http_request_latest_upstream_time | Processing time of the last request from Upstream (milliseconds) | Gauge | hostname |
http_requests_country_total | Number of requests by country | Counter | hostname, country: name of the country from which the request was received by the upstream server |
DNS Metrics
DNS Metrics | Description | Type | Label |
---|---|---|---|
dns_record_popularity | Request rate by record type | Counter | hostname, type: DNS record type such as A, AAAA, etc. |
dns_response_code_count | Number of DNS status codes | Counter | hostname, response_code: DNS status codes |
dns_top_query_count_by_asn | Top 10 ASNs with the most queries (resets over time) | Counter | hostname, asn: the asn number from which the request was sent |
dns_query_count_by_country | Total DNS requests by country | Counter | hostname, country: name of the country from which the request was sent |
dns_query_count_by_record | Total DNS requests by record type | Counter | hostname, record: DNS record type such as A, AAAA, etc. |
Upstream Error
Upstream Error Metrics | Description | Type | Label |
---|---|---|---|
per_pop_site_error_count | Number of errors per CDN popsites | Counter | hostname, pop: CDN popsite name |
per_upstream_address_error_count | Number of errors per upstream | Counter | hostname, upstream_ip: IP of the upstream server from which the error was received |
per_domain_name_error_count | Number of errors per domain name | Counter | hostname, domain_name: domain name from which the error was received |
per_uri_top_error_count | Top 10 URIs with the most errors (resets over time) | Counter | hostname, uri: path from which the error was received |
Event Metrics
Event metrics | Description | Type | Label |
---|---|---|---|
top_request_tlsfingerprint | 10 JA3 Fingerprints with the most HTTP requests | Counter | hostname, tls_fingerprint: fingerprint value sent from the user to the upstream server |
rate_limit_rule_matched_count | Number of requests matched with Rate Limit rules | Counter | hostname, rlimit_matched: ID of the Rate Limit rule that was matched |
rate_limit_action_count | Number of Rate Limit actions applied to requests | Counter | hostname, rlimit_action: Rate Limit action type such as Block, Allow, Challenge, Ignore |
firewall_rule_matched_count | Number of requests matched against firewall rules | Counter | hostname, firewall_matched: ID of the firewall rule that was matched |
firewall_action_count | Number of firewall actions applied to requests | Counter | hostname, firewall_action: firewall action type such as Allow, Bypass, Deny, and Challenge |
pagerule_matched_count | Number of requests matched against page rules | Counter | hostname, pagerule_matched: ID of the page rule that was matched |
ddos_challenge_action_count | Number of DDoS challenge actions applied to requests | Counter | hostname, ddos_challenge_action: DDoS challenge action type such as Ignored, Passed, Issued, Preflight |
ddos_challenge_decision_count | Number of final decisions on DDoS challenges | Counter | hostname, ddos_challenge_decision: decision type such as Ignored, Passed, Issued, Preflight |
waf_rule_matched_count | Number of requests matched by WAF rules | Counter | hostname, waf_rule_matched: ID of the WAF rule that was matched |
Metric Exporter in Panel
From the Arvancloud user panel, navigate to the “CDN” section and choose “Metric Exporters”
Click the "New Monitoring" button.
Set the collection interval and click the “Save” button.
From now on, you can manage the monitoring settings by enabling or disabling it, editing it, or deleting it.
Metric Exporter via API
To interact with the Domain Metrics Monitoring API, refer to its comprehensive API documentation. Before making API calls, ensure you have an access key. You can obtain this by creating and retrieving the access key, and subsequently creating an access rule with a minimum level of “Content Distribution Network Viewer.”
Save the access key you receive at this stage in a safe place.
Create Metric Exporter with API
To create Metric Exporter via API, you can use the following sample request:
curl --location 'https://napi.arvancloud.ir/cdn/4.0/domains/[domain]/metric-exporters' \
--header 'Content-Type: application/json' \
--header 'Authorization:[apikey]' \
--data '{"name": "hello", "type": "access", "interval": 10, "status": true }'
Note that you need to replace [domain] and [apikey] with your domain name and API key.
Get a List of Metric Exporters
To get a list of Metric Exporters via API, you can use the following sample request:
curl --location 'https://napi.arvancloud.ir/cdn/4.0/metric-exporters' \
--header 'Authorization:[apikey]'
Note that you need to replace [apikey] with your API key.
The response to this request will be as follows:
"data": [
{
"id": "string",
"type": "string",
"interval": 0,
"name": "string",
"status": true
}
],
Display Metric Exporter
To get details of a Metric Exporter via the API, you can use the following sample request:
curl \
--location 'https://napi.arvancloud.ir/cdn/4.0/domains/[domain]/metric-exporters/[metricExporterId]' \
--header 'Authorization:[apikey]'
Note that you need to replace [domain] and [apikey] with your domain name and API key. You can also remove the [metricExporterId] parameter from the id field in the output of the Metric Exporter list.
Edit Metric Exporter
To edit a Metric Exporter via the API, you can use the following sample request:
curl --location --request PUT 'https://napi.arvancloud.ir/cdn/4.0/domains/[domain]/metric-exporters/[metricExporterId]' \
--header 'Authorization:[apikey]' \
--header 'Content-Type: application/json' \
--data '{"name": "hello", "type": "access", "interval": 10, "status": true}'
Note that you need to replace [domain] and [apikey] with your domain name and API key. You can also remove the [metricExporterId] parameter from the id field in the output of the Metric Exporter list.
Delete Metric Exporter
To remove a Metric Exporter via the API, you can use the following sample request:
curl --location --request DELETE 'https://napi.arvancloud.ir/cdn/4.0/domains/[domain]/metric-exporters/[metricExporterId]' \
--header 'Authorization:[apikey]'
Note that you need to replace [domain] and [apikey] with your domain name and API key. You can also remove the [metricExporterId] parameter from the id field in the output of the Metric Exporter list.