Consumption fields
Look up each field of the workloadConsumptionMetrics dataset, its value formats, the product IDs and metric names, and the regions.
The workloadConsumptionMetrics dataset of the GraphQL API holds the usage Azion accounted for each workload, product, and metric, one record per hour. Send queries for it to https://api.azion.com/v4/consumption/graphql, with the window to read in the tsRange filter. Azion keeps consumption data for up to 24 months, and a group or reseller account can query the consumption of every client account under it.
workloadConsumptionMetrics
The workloadConsumptionMetrics dataset returns the fields below. The arguments it accepts, such as filter, groupBy, and limit, are on Datasets and query arguments.
| Field | Type | Description |
|---|---|---|
accounted | Decimal | Total amount of product usage accounted for the client. A row read without aggregate returns the value as a string, such as "3578". With sum: accounted, the sum comes back as a number, such as 442444116.0. |
clientId | String | Unique identifier of the client on Azion. Example: 1234u. |
countryCode | String | Code of the country where Azion processed the usage, not the country the user accessed the service from. Example: BR. |
metricName | String | Name of the measured metric. Example: data_transferred_total. |
modulesBitwise | Int | An integer returned on every usage record. Example: 8. |
productId | Int | Unique identifier of the product the usage belongs to. Example: 1441740010. |
region | String | Region where Azion processed the usage, not the region the user accessed the service from. Example: United States. |
ts | CustomDateTime | Timestamp of the usage record, in UTC. The dataset holds one record per hour, so the value falls on the hour. Example: 2026-10-03T03:00:00Z. |
workloadId | Int | Identifier of the workload associated with the usage. Example: 1234567904. |
The dataset also returns the aggregate outputs count, sum, max, min, avg, and rate, each one selected through the aggregate argument. Only workloadConsumptionMetrics and imagesProcessedMetrics return rate.
Example query
This query reads every field of the three latest usage records in a seven-day window of workloadConsumptionMetrics:
The response holds one object per usage record. The accounted value of each record comes back as a string:
Product IDs and metric names
A workloadConsumptionMetrics record names its product in productId and its metric in metricName. Filter by both to read the usage of one product and metric:
| Product | Product ID | Metric name | What the metric counts |
|---|---|---|---|
| Data Stream | 1498670028 | data_streamed | Total volume of data streamed through Data Stream. |
| Data Stream | 1498670028 | requests | Total number of requests Data Stream processed. |
| Applications | 1441740010 | data_transferred_total | Total amount of data transferred through Applications. |
| Applications | 1441740010 | requests | Total number of requests Applications received. |
| Applications | 1441740010 | waf_requests | Total number of requests WAF inspected. |
| Functions | 1531930033 | compute_time | Total execution time of Functions, in milliseconds. |
| Functions | 1531930033 | invocations | Total number of times a function ran. |
| Image Processor | 1441110021 | images_processed | Total number of images Image Processor processed. |
| Tiered Cache | 1564082375 | data_transferred_total | Total amount of data transferred through Tiered Cache. |
| Tiered Cache | 1564082375 | requests | Total number of cache requests Tiered Cache processed. |
Each product has a guide with a complete usage query. For more information, refer to Query Data Stream usage data, Query usage data from Applications, Query usage data from Functions, Query usage data from Image Processor, and Query usage data from Tiered Cache.
Regions and countries
The countryCode and region fields of workloadConsumptionMetrics name the place where Azion processed the usage. Network architecture and routing determine that place, so it can differ from the location the user accessed the service from and from the origin of the data.
workloadConsumptionMetrics groups countries into these regions:
| Region | Countries |
|---|---|
| All Other Regions | Angola, South Africa |
| Brazil | Brazil |
| Canada | Canada |
| Europe | Deutschland, Spain, France, Great Britain, Italy, Netherlands, United Kingdom |
| Latam | Argentina, Bolivia, Chile, Colombia, Ecuador, Mexico, Peru, Paraguay, Uruguay, Venezuela |
| No Region | No Region |
| North America | Canada, United States |
| United States | United States |