What GB-hours are
When you run queries, your usage of the Axiom platform is measured in query-hours. The unit of this measurement is GB-hours which reflects the duration (measured in milliseconds) serverless functions are running to execute your query multiplied by the amount of memory (GB) allocated to execution. This metric is important for monitoring and managing your usage against the monthly allowance included in your plan.How Axiom measures query-hours
Axiom uses serverless computing to execute queries efficiently. The consumption of serverless compute resources is measured along two dimensions:- Time: The duration (in milliseconds) for which the serverless function is running to execute your query.
- Memory allocation: The amount of memory (in GB) allocated to the serverless function during execution.
What counts as a query
In calculating query costs, Axiom considers any request that queries your data as a query. For example, the following all count as queries:- You initiate a query in the Axiom user interface.
- You query your data with an API token or a personal access token.
- Your match monitor runs a query to determine if any new events match your criteria.
Run queries and understand costs
When you run queries on Axiom, the cost in GB-hours is determined by the shape and size of the events in your dataset and the volume of events scanned to return a query result. After executing a query, you can find the associated query cost in the response header labeled asX-Axiom-Query-Cost-Gbms
.
Determine query cost
- Go to an API testing tool like Postman.
-
Send a
POST
requesthttps://api.axiom.co/v1/datasets/_apl?format=tabular
orhttps://api.axiom.co/v1/datasets/_apl?format=legacy
with the following configuration:-
Content-Type
header with the valueapplication/json
. -
Authorization
header with the valueBearer API_TOKEN
. ReplaceAPI_TOKEN
with your Axiom API token. -
In the body of your request, enter your query in JSON format. For example:
apl
specifies the Axiom Processing Language (APL) query to run. In this case,"telegraf | count"
indicates that you query thetelegraf
dataset and use thecount
operator to aggregate the data.startTime
andendTime
define the time range of your query. In this case,"2024-01-11T19:25:00Z"
is the start time, and"2024-02-13T19:25:00Z"
is the end time, both in ISO 8601 format. This time range limits the query to events recorded within these specific dates and times.
-
-
In the response to your request, the information about the query cost in GB-milliseconds is in the
X-Axiom-Query-Cost-Gbms
header.