Real-Time Metrics quickstart
Read the request and data-transfer totals of your applications in Azion Console or with one GraphQL query, then narrow them to 24 hours and one host.
This guide instructs you through reading your first traffic numbers in Real-Time Metrics, in Azion Console or with the GraphQL API.
- Read the total requests and the total data transferred of your applications.
- Set the time range to the last 24 hours.
- Narrow both totals to one host.
Real-Time Metrics creates nothing, and there is nothing to turn on: it is active on every Azion account. It reads the metrics your applications and other products generate as they receive traffic, and charts them as soon as traffic arrives. Two things stand behind every number on this page:
- An application that has already served requests. Those requests are the data.
- The
httpMetricsdataset, which records the requests of your applications. The charts of the Applications tab and the GraphQL API both read it, so both interfaces return the same totals for the same range and filter.
Real-Time Metrics shows aggregated numbers. For the logs behind each number, refer to Real-Time Events.
Select your interface once. The prerequisites and each stage below show only that path.
Prerequisites
- An Azion account. To create one, refer to Create an account.
- An application served by a workload, with requests in the last 24 hours.
- A host the workload answers on, such as
www.example.com. You filter the metrics by it.
- Access to Azion Console. To sign in, refer to How to access Azion Console.
Open the request metrics of your applications
With no filter, Real-Time Metrics counts the requests and the data transferred of every application in your account.
To read both totals with the GraphQL API, send a POST request to https://api.azion.com/v4/metrics/graphql. The query selects requestsTotal and dataTransferredTotal from the httpMetrics dataset, and the variables set a one-hour range.
Replace [TOKEN VALUE] with your personal token, and the begin and end values with the hour you want to read:
The API answers 200 with one row:
The row holds the totals for the range. A 0 means no request reached your applications in that hour. The API requires a range: a query without tsRange returns 400 with To execute queries it is mandatory to provide the desired time interval.
For every field of the dataset, refer to Real-Time Metrics GraphQL fields.
Set the time range to the last 24 hours
The time range sets the period that every total covers. In both interfaces, this stage reads the same 24 hours.
The tsRange filter sets the period with begin and end. To read the last 24 hours with the API, send the same query with begin 24 hours before end. The operation name says what the range covers:
The API answers 200 with the totals for those 24 hours:
requestsTotal counts the requests your applications served in the range. dataTransferredTotal is in bytes, the sum of the data transferred in and out.
Filter by one host
A filter keeps only the requests that match it, and every total follows. This stage keeps the requests to the host www.example.com. Replace it with a host your workload answers on.
To filter with the API, add hostEq to filter, next to tsRange. The query keeps the 24-hour range you set:
The API answers 200 with the totals of that host alone:
The totals now count only the requests to that host, a part of the account totals for the same range. For the other operators a filter accepts, refer to GraphQL queries.