Hi there Fly.io team,
I’m writing a small utility script to ease pulling usage and cost data for my organisations, using the billables
resolver under organization
in your graphql API.
Here’s an example of a query I run:
{
organization(name: "<organisation slug>") {
billables(startDate: "2021-11-01", endDate: "2021-11-30") {
nodes {
app {
name
}
category
product
quantity
time
}
}
}
}
and here’s an example of an object in the output array:
[
...,
{
"app": {
"name": "<app-name>"
},
"category": "vm",
"product": "micro-1x",
"quantity": 2505622.237516,
"time": "2021-11-01T00:00:00Z"
},
...
]
So far enumerating stuff has been fairly straightforward, but I came across a weird object in November’s array, it looks like below:
{
"app": {
"name": "REDACTED"
},
"category": "vm",
"product": "unknown",
"quantity": -22997441.516189,
"time": "2021-11-11T00:00:00Z"
}
At first I thought this was how y’all do the free-tier deduction, but looking in the other months I don’t see this entry.
This caught my eye because due to it, November’s total vm
time became negative, but looking at the actual Stripe bill we were charged, we definitely had a positive amount charged for November for the vm
line item so I’m curious if you can help shed some light on this.
Also please do let me know if I should be using another resolver instead of this one, I got this from here
Thanks!