Skip to main content

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 MetricsDescriptionTypeLabel
http_top_requests_ip10 IPs with the most requestsCounterhostname, ip: user IP
http_top_requests_server_code10 Server Codes with the Most RequestsCounterhostname, server_code: CDN server number
http_top_requests_asn10 ASNs with the most requestsCounterhostname, asn: the asn number from which the request was sent to the upstream server
http_requests_totalTotal number of requestsCounterhostname, method: HTTP request method, content_type: Content type of the request, status: HTTP status code received from the CDN
http_bytes_sent_totalTotal number of bytes sent in HTTP responsesCounterhostname, method: HTTP request method, content_type: Type of content sent by the request
http_bytes_received_totalTotal number of bytes received in HTTP requestsCounterhostname, method: HTTP request method, content_type: Type of content sent by the request
http_cache_hit_rateCache Hit Ratio to Total RequestsGaugehostname, cache: cache status which can have values of Hit, Miss, Bypass and Updating
http_server_port_usageNumber of times server ports are usedGaugehostname, server_port: port of the upstream server where requests arrive
http_request_latest_upstream_timeProcessing time of the last request from Upstream (milliseconds)Gaugehostname
http_requests_country_totalNumber of requests by countryCounterhostname, country: name of the country from which the request was received by the upstream server

DNS Metrics

DNS MetricsDescriptionTypeLabel
dns_record_popularityRequest rate by record typeCounterhostname, type: DNS record type such as A, AAAA, etc.
dns_response_code_countNumber of DNS status codesCounterhostname, response_code: DNS status codes
dns_top_query_count_by_asnTop 10 ASNs with the most queries (resets over time)Counterhostname, asn: the asn number from which the request was sent
dns_query_count_by_countryTotal DNS requests by countryCounterhostname, country: name of the country from which the request was sent
dns_query_count_by_recordTotal DNS requests by record typeCounterhostname, record: DNS record type such as A, AAAA, etc.

Upstream Error

Upstream Error MetricsDescriptionTypeLabel
per_pop_site_error_countNumber of errors per CDN popsitesCounterhostname, pop: CDN popsite name
per_upstream_address_error_countNumber of errors per upstreamCounterhostname, upstream_ip: IP of the upstream server from which the error was received
per_domain_name_error_countNumber of errors per domain nameCounterhostname, domain_name: domain name from which the error was received
per_uri_top_error_countTop 10 URIs with the most errors (resets over time)Counterhostname, uri: path from which the error was received

Event Metrics

Event metricsDescriptionTypeLabel
top_request_tlsfingerprint10 JA3 Fingerprints with the most HTTP requestsCounterhostname, tls_fingerprint: fingerprint value sent from the user to the upstream server
rate_limit_rule_matched_countNumber of requests matched with Rate Limit rulesCounterhostname, rlimit_matched: ID of the Rate Limit rule that was matched
rate_limit_action_countNumber of Rate Limit actions applied to requestsCounterhostname, rlimit_action: Rate Limit action type such as Block, Allow, Challenge, Ignore
firewall_rule_matched_countNumber of requests matched against firewall rulesCounterhostname, firewall_matched: ID of the firewall rule that was matched
firewall_action_countNumber of firewall actions applied to requestsCounterhostname, firewall_action: firewall action type such as Allow, Bypass, Deny, and Challenge
pagerule_matched_countNumber of requests matched against page rulesCounterhostname, pagerule_matched: ID of the page rule that was matched
ddos_challenge_action_countNumber of DDoS challenge actions applied to requestsCounterhostname, ddos_challenge_action: DDoS challenge action type such as Ignored, Passed, Issued, Preflight
ddos_challenge_decision_countNumber of final decisions on DDoS challengesCounterhostname, ddos_challenge_decision: decision type such as Ignored, Passed, Issued, Preflight
waf_rule_matched_countNumber of requests matched by WAF rulesCounterhostname, 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.