### Limit and Offset Pagination for httpMetrics Source: https://context7.com/aziontech/azion-queries/llms.txt Implements pagination to manage large result sets by limiting the number of returned rows and skipping a specified number of initial rows. The 'limit' parameter controls the maximum results per page, while 'offset' determines the starting point for the next set of results. ```graphql # Limit: restrict number of results (default 10, max 10,000) query GeolocCountryNameLimit50 { httpMetrics( offset: 0 limit: 50 # Retrieve rows 0 to 50 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } ) { ts host geolocCountryName } } # Offset: skip initial rows for pagination query GeolocCountryNameOffset100 { httpMetrics( offset: 100 # Skip first 100 rows limit: 50 # Retrieve rows 100 to 150 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } ) { ts host geolocCountryName } } ``` -------------------------------- ### GraphQL Query for Wildcard String Matching (LIKE Filter) Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query demonstrates pattern matching using the 'Like' filter for country, region, and scheme fields. It retrieves HTTP metrics where the country name starts with 'Braz', the region name ends with 'ao Paulo', and the scheme contains 'ttp'. Includes time range filter and timestamp ordering. ```graphql query GeolocCountryNameAndRegionNameLike { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} geolocCountryNameLike: "Braz%" # Starts with "Braz" geolocRegionNameLike: "%ao Paulo" # Ends with "ao Paulo" schemeLike: "%ttp%" # Contains "ttp" } orderBy: [ts_ASC] ) { ts host status geolocRegionName geolocCountryName scheme } } ``` -------------------------------- ### Sorting Results in Ascending Order Source: https://context7.com/aziontech/azion-queries/llms.txt Sorts query results based on specified fields in ascending order. This example demonstrates sorting by 'geolocRegionName' and 'geolocCountryName'. It's crucial for organizing data chronologically or alphabetically. ```graphql query GeolocRegionNameAndCountryNameASC { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } orderBy: [geolocRegionName_ASC, geolocCountryName_ASC] ) { ts host status geolocRegionName geolocCountryName } } ``` -------------------------------- ### Edge Pulse - Real User Monitoring Source: https://context7.com/aziontech/azion-queries/llms.txt Collects real user experience metrics such as page load time, network latency, and browser performance. ```APIDOC ## Edge Pulse - Real User Monitoring ### Description Collects real user experience metrics including client-side performance, network conditions, and browser details. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **tsRange_begin** (DateTime!) - Required - The start of the time range for the query. - **tsRange_end** (DateTime!) - Required - The end of the time range for the query. #### Request Body ```json { "query": "query EdgePulse($tsRange_begin: DateTime!, $tsRange_end: DateTime!) { edgePulseEvents (limit: 1000, orderBy: [ts_DESC], filter: { tsRange: { begin: $tsRange_begin, end: $tsRange_end } }) { ts clientId scriptid platform referrer locationhref useragent browser rtt downlink effectivetype ttfb pageloadtime rendertime dns tcp ssl networkduration } }", "variables": { "tsRange_begin": "YYYY-MM-DDTHH:MM:SS", "tsRange_end": "YYYY-MM-DDTHH:MM:SS" } } ``` ### Response #### Success Response (200) - **data.edgePulseEvents** (Array) - An array of edge pulse events, each containing metrics like timestamp, client ID, browser, RTT, TTFB, and page load time. #### Response Example ```json { "data": { "edgePulseEvents": [ { "ts": "2025-04-11T14:51:11Z", "platform": "Linux armv8l", "browser": "Chrome", "rtt": 0, "ttfb": 1, "pageloadtime": 130 } ] } } ``` ``` -------------------------------- ### WAF Match Analysis Source: https://context7.com/aziontech/azion-queries/llms.txt Analyzes Web Application Firewall (WAF) rule matches to aid in tuning WAF configurations. ```APIDOC ## WAF Match Analysis ### Description Analyzes Web Application Firewall (WAF) rule matches, grouping them by the matched rule and providing a count for each match, useful for tuning WAF configurations. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **tsRange_begin** (DateTime) - The start of the time range for the query. - **tsRange_end** (DateTime) - The end of the time range for the query. - **hostIn** (Array) - A list of hosts to filter events by. #### Request Body ```json { "query": "query WafEventsTunning { hits: httpEvents( limit: 10000, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\" } hostIn: [ \"sso.azion.com\" ] }, aggregate:{count:rows} groupBy: [wafMatch] ) { match: wafMatch value : count } }" } ``` ### Response #### Success Response (200) - **data.hits** (Array) - An array of WAF match details. - **match** (String) - The WAF rule that was matched. - **value** (Integer) - The count of occurrences for this WAF match. #### Response Example ```json { "data": { "hits": [ {"match": "SQL Injection Attempt", "value": 500}, {"match": "Cross-Site Scripting", "value": 350} ] } } ``` ``` -------------------------------- ### Combined Attack Metrics Source: https://context7.com/aziontech/azion-queries/llms.txt Correlates Web Application Firewall (WAF) threats with bandwidth usage per host. ```APIDOC ## Combined Attack Metrics ### Description Correlates Web Application Firewall (WAF) threats with total bytes sent for each host, providing insights into the impact of attacks on bandwidth consumption. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **tsRange_begin** (DateTime) - The start of the time range for the query. - **tsRange_end** (DateTime) - The end of the time range for the query. #### Request Body ```json { "query": "query TotalAttacksWAFAndTotalBytesSentByHost { httpMetrics( limit: 5, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"} }, aggregate: {sum: bytesSent}, groupBy: [host] orderBy: [wafRequestsThreat_DESC] ) { host wafRequestsThreat bytes: sum } }" } ``` ### Response #### Success Response (200) - **data.httpMetrics** (Array) - An array of hosts with their WAF threat counts and total bytes sent. - **host** (String) - The hostname. - **wafRequestsThreat** (Integer) - The number of WAF threat requests. - **bytes** (Integer) - The total sum of bytes sent. #### Response Example ```json { "data": { "httpMetrics": [ {"host": "api.example.com", "wafRequestsThreat": 9093896, "bytes": 118562658876}, {"host": "shop.example.com", "wafRequestsThreat": 7676210, "bytes": 27744691371} ] } } ``` ``` -------------------------------- ### Analyze WAF Rule Matches for Tuning with GraphQL Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query analyzes Web Application Firewall (WAF) rule matches for tuning purposes. It filters HTTP events for a specified host within a given time range and groups the results by WAF match, providing counts for each match. This helps in identifying and refining WAF rules. ```graphql query WafEventsTunning { hits: httpEvents( limit: 10000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} hostIn: [ "sso.azion.com" ] } aggregate:{count:rows} groupBy: [wafMatch] ) { match: wafMatch value : count } } ``` -------------------------------- ### Query Azion GraphQL API Endpoints using cURL Source: https://context7.com/aziontech/azion-queries/llms.txt Demonstrates how to interact with Azion's various GraphQL API endpoints (Metrics, Events, Billing, Accounting, Consumption) using cURL. Requires an API token for authentication and specifies the query payload for data retrieval. Useful for initial testing and scripting. ```bash curl -X POST https://api.azion.com/v4/metrics/graphql \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { httpMetrics(limit: 10, filter: {tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host status } }" }' ``` ```bash curl -X POST https://api.azion.com/v4/events/graphql \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "query { httpEvents(limit: 10, filter: {tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host remoteAddress } }" }' ``` ```bash curl -X POST https://api.azion.com/v4/billing/graphql \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` ```bash curl -X POST https://api.azion.com/v4/accounting/graphql \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` ```bash curl -X POST https://api.azion.com/v4/consumption/graphql \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### WAF Threat Analysis Source: https://context7.com/aziontech/azion-queries/llms.txt Identifies top hosts under attack by analyzing Web Application Firewall (WAF) events. ```APIDOC ## WAF Threat Analysis ### Description Identifies the top hosts that are under attack by analyzing Web Application Firewall (WAF) events, specifically focusing on learning and blocked events. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **tsRange_begin** (DateTime) - The start of the time range for the query. - **tsRange_end** (DateTime) - The end of the time range for the query. - **wafLearningEq** (String) - Filter for WAF learning status (e.g., "1"). - **wafBlockEq** (String) - Filter for WAF block status (e.g., "1"). #### Request Body ```json { "query": "query Top10HostsThreats { httpEvents( limit: 5, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"} wafLearningEq: \"1\" wafBlockEq: \"1\" }, aggregate: {count: rows}, groupBy: [host], orderBy: [count_DESC] ) { host count } }" } ``` ### Response #### Success Response (200) - **data.httpEvents** (Array) - An array of hosts and their associated threat counts. - **host** (String) - The hostname. - **count** (Integer) - The number of WAF-related events for the host. #### Response Example ```json { "data": { "httpEvents": [ {"host": "api.example.com", "count": 813400}, {"host": "shop.example.com", "count": 242916} ] } } ``` ``` -------------------------------- ### Pagination API Source: https://context7.com/aziontech/azion-queries/llms.txt Supports pagination of results using `limit` and `offset` parameters to navigate through large datasets. ```APIDOC ## Pagination ### Description Paginate through large result sets using limit and offset. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query { httpMetrics( offset: Int # Number of rows to skip limit: Int # Maximum number of results to return (default 10, max 10,000) filter: { tsRange: {begin: String, end: String} } ) { # Fields to return } } ``` ### Request Example ```json { "query": "# Retrieve rows 0 to 50\nquery GeolocCountryNameLimit50 { httpMetrics(offset: 0, limit: 50, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host geolocCountryName } }" } ``` ```json { "query": "# Retrieve rows 100 to 150\nquery GeolocCountryNameOffset100 { httpMetrics(offset: 100, limit: 50, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host geolocCountryName } }" } ``` ### Response #### Success Response (200) - Returns a subset of results based on the `limit` and `offset` parameters. #### Response Example (Response structure depends on the fields requested in the query) ``` -------------------------------- ### Collect Real User Experience Metrics with EdgePulse GraphQL Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query collects real user experience metrics from the EdgePulse events. It requires a time range (begin and end timestamps) as input and returns various performance indicators like RTT, TTFB, page load time, and more. It's useful for understanding end-user performance across the globe. ```graphql query EdgePulse( $tsRange_begin: DateTime! $tsRange_end: DateTime! ) { edgePulseEvents ( limit: 1000 orderBy: [ts_DESC] filter: { tsRange: { begin: $tsRange_begin, end: $tsRange_end } } ) { ts clientId scriptid platform referrer locationhref useragent type browser rtt downlink effectivetype ttfb pageloadtime rendertime dns tcp ssl networkduration } } # Variables: # {"tsRange_begin":"2025-04-11T14:46:23","tsRange_end":"2025-04-11T14:51:11"} # Example Response: # { # "data": { # "edgePulseEvents": [ # { # "ts": "2025-04-11T14:51:11Z", # "platform": "Linux armv8l", # "browser": "Chrome", # "rtt": 0, # "ttfb": 1, # "pageloadtime": 130 # } # ] # } # } ``` -------------------------------- ### Correlate WAF Threats with Bandwidth by Host using GraphQL Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query correlates WAF threats with bandwidth usage by host. It aggregates the total bytes sent for HTTP metrics within a specified time range, groups the results by host, and orders them by the count of WAF threats in descending order. This query is useful for understanding the impact of attacks on network resources. ```graphql query TotalAttacksWAFAndTotalBytesSentByHost { httpMetrics( limit: 5 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } aggregate: {sum: bytesSent}, groupBy: [host] orderBy: [wafRequestsThreat_DESC] ) { host wafRequestsThreat bytes: sum } } # Example Response: # { # "data": { # "httpMetrics": [ # {"host": "api.example.com", "wafRequestsThreat": 9093896, "bytes": 118562658876}, # {"host": "shop.example.com", "wafRequestsThreat": 7676210, "bytes": 27744691371} # ] # } # } ``` -------------------------------- ### Edge Applications - Bandwidth Monitoring API Source: https://context7.com/aziontech/azion-queries/llms.txt Monitors total bandwidth consumption for Edge Applications over a specified period. ```APIDOC ## Edge Applications - Bandwidth Monitoring ### Description Track total bandwidth consumption for Edge Applications. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query HttpCalculatedBandwidthTotalData { httpMetrics( limit: Int filter: { tsRange: {begin: String, end: String} } groupBy: [ts] orderBy: [ts_ASC] ) { ts bandwidthTotal } } ``` ### Request Example ```json { "query": "query HttpCalculatedBandwidthTotalData { httpMetrics(limit: 1000, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}, groupBy: [ts], orderBy: [ts_ASC] ) { ts bandwidthTotal } }" } ``` ### Response #### Success Response (200) - **ts** (Int) - Timestamp. - **bandwidthTotal** (Int) - Total bandwidth consumed. #### Response Example ```json { "data": { "httpMetrics": [ {"ts": 1679510400, "bandwidthTotal": 5000000}, {"ts": 1679510460, "bandwidthTotal": 5500000} ] } } ``` ``` -------------------------------- ### Edge Applications Bandwidth Monitoring Source: https://context7.com/aziontech/azion-queries/llms.txt Monitors total bandwidth consumption for Edge Applications. This query aggregates bandwidth data over time, allowing for analysis of data transfer volumes. It groups results by timestamp and orders them chronologically. ```graphql query HttpCalculatedBandwidthTotalData { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } groupBy: [ts] orderBy: [ts_ASC] ) { ts bandwidthTotal } } ``` -------------------------------- ### Filtering Operations - Like Filter Source: https://context7.com/aziontech/azion-queries/llms.txt Demonstrates case-sensitive pattern matching for string fields using wildcards like '%' with the 'Like' operator. ```APIDOC ## Filtering - Like Filter (Case-Sensitive) ### Description Performs case-sensitive pattern matching on string fields using SQL-like wildcards. '%' matches zero or more characters. This example filters for country names starting with 'Braz', regions ending with 'ao Paulo', and schemes containing 'ttp'. ### Method POST ### Endpoint /v4/metrics/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```graphql query GeolocCountryNameAndRegionNameLike { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} geolocCountryNameLike: "Braz%" # Starts with "Braz" geolocRegionNameLike: "%ao Paulo" # Ends with "ao Paulo" schemeLike: "%ttp%" # Contains "ttp" } orderBy: [ts_ASC] ) { ts host status geolocRegionName geolocCountryName scheme } } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing filtered http metrics. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "httpMetrics": [ { "ts": "2023-03-22T17:15:00Z", "host": "example.com", "status": 200, "geolocRegionName": "Sao Paulo", "geolocCountryName": "Brazil", "scheme": "http" } ] } } ``` ``` -------------------------------- ### Consumption API Source: https://context7.com/aziontech/azion-queries/llms.txt Endpoint for retrieving resource consumption metrics from the Azion Edge Platform. ```APIDOC ## POST /v4/consumption/graphql ### Description Retrieves resource consumption metrics for Azion services. ### Method POST ### Endpoint /v4/consumption/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```json { "query": "query { resourceConsumption { resourceType consumedAmount } }" } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing consumption metrics. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "resourceConsumption": [ { "resourceType": "cpu", "consumedAmount": 75.5 } ] } } ``` ``` -------------------------------- ### Image Processor - Processing Metrics API Source: https://context7.com/aziontech/azion-queries/llms.txt Tracks image optimization requests, including counts and status codes within a time range. ```APIDOC ## Image Processor - Processing Metrics ### Description Track image optimization requests. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query totalImagesProcessedRequests { imagesProcessedMetrics( limit: Int filter: { tsRange: {begin: String, end: String} or: { status: Int statusRange: {begin: Int, end: Int} } } aggregate:{ sum: requests } groupBy:[ts] orderBy:[ts_ASC] ) { ts sum } } ``` ### Request Example ```json { "query": "query totalImagesProcessedRequests { imagesProcessedMetrics(limit: 100, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}, or: { status:304, statusRange: {begin: 199, end: 299 }}}, aggregate:{ sum: requests }, groupBy:[ts], orderBy:[ts_ASC] ) { ts sum } }" } ``` ### Response #### Success Response (200) - **ts** (Int) - Timestamp. - **sum** (Int) - The total number of image processing requests matching the criteria. #### Response Example ```json { "data": { "imagesProcessedMetrics": [ {"ts": 1679510400, "sum": 5000}, {"ts": 1679510460, "sum": 5200} ] } } ``` ``` -------------------------------- ### Identify Top Hosts Under WAF Attack with GraphQL Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query identifies the top hosts that are under WAF attack by filtering HTTP events where WAF learning and blocking are enabled. It aggregates the count of such events grouped by host and orders them in descending order. This is useful for prioritizing security efforts. ```graphql query Top10HostsThreats { httpEvents( limit: 5 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} wafLearningEq: "1" wafBlockEq: "1" } aggregate: {count: rows} groupBy: [host] orderBy: [count_DESC] ) { host count } } # Example Response: # { # "data": { # "httpEvents": [ # {"host": "api.example.com", "count": 813400}, # {"host": "shop.example.com", "count": 242916} # ] # } # } ``` -------------------------------- ### Filtering Operations - Logical AND Filter Source: https://context7.com/aziontech/azion-queries/llms.txt Demonstrates combining multiple filter conditions using the logical 'AND' operator. ```APIDOC ## Filtering - Logical AND Filter ### Description Combines multiple filter conditions using the logical 'AND' operator, ensuring all specified conditions must be met. This example filters for http metrics where the status is exactly 200 AND the status code falls within the 300-399 range (this specific combination would likely yield no results but demonstrates syntax). ### Method POST ### Endpoint /v4/metrics/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```graphql query Status200AndStatusRange300To399 { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} and: { status: 200 statusRange: {begin: 300, end: 399} } } orderBy: [ts_ASC] ) { ts host status geolocRegionName geolocCountryName } } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing filtered http metrics. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "httpMetrics": [] } } ``` ``` -------------------------------- ### Billing API Source: https://context7.com/aziontech/azion-queries/llms.txt Endpoint for retrieving cost and invoice data from the Azion Edge Platform. ```APIDOC ## POST /v4/billing/graphql ### Description Retrieves cost and invoice data for Azion services. ### Method POST ### Endpoint /v4/billing/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```json { "query": "query { billingData { invoiceId amount } }" } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing billing information. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "billingData": [ { "invoiceId": "INV-12345", "amount": 100.50 } ] } } ``` ``` -------------------------------- ### Edge DNS - Query Volume API Source: https://context7.com/aziontech/azion-queries/llms.txt Analyzes DNS query patterns by calculating the sum of requests over time. ```APIDOC ## Edge DNS - Query Volume ### Description Analyze DNS query patterns. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query IdnsTotalQueries { idnsQueriesMetrics( limit: Int filter: { tsRange: {begin: String, end: String} } aggregate: { sum: requests } groupBy: [ts] orderBy: [ts_ASC] ) { ts sum } } ``` ### Request Example ```json { "query": "query IdnsTotalQueries { idnsQueriesMetrics(limit: 1000, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}, aggregate: { sum: requests }, groupBy: [ts], orderBy: [ts_ASC] ) { ts sum } }" } ``` ### Response #### Success Response (200) - **ts** (Int) - Timestamp. - **sum** (Int) - The total number of DNS requests. #### Response Example ```json { "data": { "idnsQueriesMetrics": [ {"ts": 1679510400, "sum": 100000}, {"ts": 1679510460, "sum": 110000} ] } } ``` ``` -------------------------------- ### Data Stream - Data Volume Tracking API Source: https://context7.com/aziontech/azion-queries/llms.txt Monitors the volume of data streamed over time. ```APIDOC ## Data Stream - Data Volume Tracking ### Description Monitor streamed data volumes. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query DataStreamed { dataStreamedMetrics( limit: Int filter: { tsRange: {begin: String, end: String} } aggregate: { sum: dataStreamed } groupBy: [ts] orderBy: [ts_ASC] ) { ts sum } } ``` ### Request Example ```json { "query": "query DataStreamed { dataStreamedMetrics(limit: 1000, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}, aggregate: { sum: dataStreamed }, groupBy: [ts], orderBy: [ts_ASC] ) { ts sum } }" } ``` ### Response #### Success Response (200) - **ts** (Int) - Timestamp. - **sum** (Int) - The total volume of data streamed. #### Response Example ```json { "data": { "dataStreamedMetrics": [ {"ts": 1679510400, "sum": 1000000000}, {"ts": 1679510460, "sum": 1100000000} ] } } ``` ``` -------------------------------- ### Edge DNS Query Volume Analysis Source: https://context7.com/aziontech/azion-queries/llms.txt Analyzes DNS query patterns by summing the total number of requests over a given time period. This query helps in understanding DNS traffic volume and trends for Edge DNS services. Results are grouped by timestamp and ordered chronologically. ```graphql query IdnsTotalQueries { idnsQueriesMetrics( limit: 1000, filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } aggregate: { sum: requests } groupBy: [ts] orderBy: [ts_ASC] ) { ts sum } } ``` -------------------------------- ### Image Processor Processing Metrics Source: https://context7.com/aziontech/azion-queries/llms.txt Tracks image optimization requests processed by the Image Processor. This query sums the requests within a specified time range, with options to filter by status codes. It's useful for monitoring the volume and success rate of image processing tasks. ```graphql query totalImagesProcessedRequests { imagesProcessedMetrics( limit: 100 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} or: { status:304 statusRange: {begin: 199, end: 299} } } aggregate:{ sum: requests } groupBy:[ts] orderBy:[ts_ASC] ) { ts sum } } ``` -------------------------------- ### Metrics API Source: https://context7.com/aziontech/azion-queries/llms.txt Endpoint for retrieving time-series performance data from the Azion Edge Platform. ```APIDOC ## POST /v4/metrics/graphql ### Description Retrieves time-series performance data for Azion services. Supports filtering by timestamp range, host, status, geolocation, and scheme. ### Method POST ### Endpoint /v4/metrics/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```json { "query": "query { httpMetrics(limit: 10, filter: {tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host status } }" } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing the queried metrics. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "httpMetrics": [ { "ts": "2023-03-22T17:03:00Z", "host": "example.com", "status": 200 } ] } } ``` ``` -------------------------------- ### Events API Source: https://context7.com/aziontech/azion-queries/llms.txt Endpoint for retrieving detailed request logs and security events from the Azion Edge Platform. ```APIDOC ## POST /v4/events/graphql ### Description Retrieves detailed request logs and security events. Supports filtering by timestamp range, host, and client IP address. ### Method POST ### Endpoint /v4/events/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```json { "query": "query { httpEvents(limit: 10, filter: {tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}) { ts host remoteAddress } }" } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing the queried events. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "httpEvents": [ { "ts": "2023-03-22T17:03:00Z", "host": "example.com", "remoteAddress": "192.168.1.1" } ] } } ``` ``` -------------------------------- ### Edge Functions - Invocation Tracking API Source: https://context7.com/aziontech/azion-queries/llms.txt Monitors the invocation counts for Edge Functions, differentiating between edge application and edge firewall invocations. ```APIDOC ## Edge Functions - Invocation Tracking ### Description Monitor edge function execution counts. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query EdgeFunctionsTotalInvocations { edgeFunctionsMetrics( limit: Int filter: { tsRange: {begin: String, end: String} } groupBy: [ts] orderBy: [ts_ASC] ) { ts edgeApplicationInvocations edgeFirewallInvocations } } ``` ### Request Example ```json { "query": "query EdgeFunctionsTotalInvocations { edgeFunctionsMetrics(limit: 1000, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}, groupBy: [ts], orderBy: [ts_ASC] ) { ts edgeApplicationInvocations edgeFirewallInvocations } }" } ``` ### Response #### Success Response (200) - **ts** (Int) - Timestamp. - **edgeApplicationInvocations** (Int) - Number of invocations for edge applications. - **edgeFirewallInvocations** (Int) - Number of invocations for edge firewall. #### Response Example ```json { "data": { "edgeFunctionsMetrics": [ {"ts": 1679510400, "edgeApplicationInvocations": 500, "edgeFirewallInvocations": 100}, {"ts": 1679510460, "edgeApplicationInvocations": 520, "edgeFirewallInvocations": 110} ] } } ``` ``` -------------------------------- ### Accounting API Source: https://context7.com/aziontech/azion-queries/llms.txt Endpoint for retrieving usage accounting records from the Azion Edge Platform. ```APIDOC ## POST /v4/accounting/graphql ### Description Retrieves usage accounting records for Azion services. ### Method POST ### Endpoint /v4/accounting/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```json { "query": "query { usageRecords { recordId usageType } }" } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing accounting records. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "usageRecords": [ { "recordId": "REC-67890", "usageType": "bandwidth" } ] } } ``` ``` -------------------------------- ### Data Stream Data Volume Tracking Source: https://context7.com/aziontech/azion-queries/llms.txt Monitors the volume of data streamed through Data Stream services. This query sums the 'dataStreamed' metric over a specified time range, providing insights into data throughput. Results are grouped by timestamp and ordered chronologically. ```graphql query DataStreamed { dataStreamedMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } aggregate: { sum: dataStreamed } groupBy: [ts] orderBy: [ts_ASC] ) { ts sum } } ``` -------------------------------- ### Time Series Resampling API Source: https://context7.com/aziontech/azion-queries/llms.txt Downsamples time-series data to a target number of points, aggregating values using a specified function. ```APIDOC ## Time Series Resampling ### Description Downsample time-series data to reduce points. ### Method POST (Implicitly via GraphQL query) ### Endpoint /metrics/graphql ### Parameters #### Query Parameters None #### Request Body ##### GraphQL Query Structure ```graphql query { httpMetrics( limit: Int resample: { function: String # Options: sum, mean, max, min points: Int # Target number of points to return } filter: { tsRange: {begin: String, end: String} } groupBy: [ts] # Required for resampling orderBy: [ts_ASC] ) { # Fields to return, e.g., ts, dataTransferredIn } } ``` ### Request Example ```json { "query": "query HttpWithResample { httpMetrics(limit: 10000, resample: { function: sum, points: 250 }, filter: { tsRange: {begin:\"2023-03-22T17:03:00\", end:\"2023-03-22T18:05:00\"}}, groupBy: [ts], orderBy: [ts_ASC] ) { ts dataTransferredIn dataTransferredOut dataTransferredTotal } }" } ``` ### Response #### Success Response (200) - Returns resampled time-series data. #### Response Example ```json { "data": { "httpMetrics": [ {"ts": 1679510400, "dataTransferredIn": 10000, "dataTransferredOut": 20000, "dataTransferredTotal": 30000}, {"ts": 1679510460, "dataTransferredIn": 12000, "dataTransferredOut": 22000, "dataTransferredTotal": 34000} // ... more resampled points ] } } ``` ``` -------------------------------- ### Filtering Operations - Range Filter Source: https://context7.com/aziontech/azion-queries/llms.txt Demonstrates how to filter records within a specified numeric range (inclusive) using GraphQL queries. ```APIDOC ## Filtering - Range Filter ### Description Filters records where a numeric field falls within a specified range (inclusive). This example filters `httpMetrics` for status codes between 200 and 300. ### Method POST ### Endpoint /v4/metrics/graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. ### Request Example ```graphql query StatusRange300 { httpMetrics( limit: 1000 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} statusRange: {begin:200, end:300} } orderBy: [ts_ASC] ) { ts host status geolocRegionName geolocCountryName } } ``` ### Response #### Success Response (200) - **data** (object) - The response data containing filtered http metrics. - **errors** (array) - An array of errors if the query failed. #### Response Example ```json { "data": { "httpMetrics": [ { "ts": "2023-03-22T17:05:00Z", "host": "example.com", "status": 200, "geolocRegionName": "Sao Paulo", "geolocCountryName": "Brazil" } ] } } ``` ``` -------------------------------- ### Identify Top Active Client IP Addresses with GraphQL Source: https://context7.com/aziontech/azion-queries/llms.txt This GraphQL query identifies the most active client IP addresses by counting HTTP events grouped by the remote address within a specified time range. The results are ordered by the count in descending order, helping to pinpoint the most frequent sources of traffic. ```graphql query Top10IPs { httpEvents( limit: 5 filter: { tsRange: {begin:"2023-03-22T17:03:00", end:"2023-03-22T18:05:00"} } aggregate: {count: remoteAddress} groupBy: [remoteAddress] orderBy: [count_DESC] ) { remoteAddress count } } # Example Response: # { # "data": { # "httpEvents": [ # {"remoteAddress": "170.0.0.1", "count": 45762561}, # {"remoteAddress": "170.0.0.2", "count": 6009760} # ] # } # } ```