Hi all, are there any utilities to determine how m...
# prefect-community
j
Hi all, are there any utilities to determine how many tasks were charged for a given flow run? (Using Prefect Cloud)
k
Not exactly. We don’t have these kind of tools, but I think if you have questions on billing, sales could help with that more at
<mailto:sales@prefect.io|sales@prefect.io>
j
Hey @Kevin Kho, thanks for the quick response. (a) would a utility for this be viable? (b) would sales be able to breakdown costs or task usage per flow?
k
I don’t know if they can on an individual Flow. The utility for a full tenant billing is on the backlog because some users who migrate from Server to Cloud want a cost estimate, but it hasn’t been a high priority ticket. On the individual Flow, you could have a script that counts the number of successful tasks and then filters the ones with duration above 1 second.
j
Ok, good to know - thanks!
k
I gave this a shot. It’s a bit tricky. How many tasks are you expecting on that Flow? I’m guessing you’re asking because there are a lot of tasks right?
j
Not that many tasks actually, it's rather the number of flows runs. I ended up writing some utility functions to query all task runs matching a flow run name pattern and subset that to determine the #/% of tasks charged. The context here is that I'm trying to estimate the task usage + flow efficiency for backfilling X years of data
Would save time to have an official utility to achieve this, but a little GraphQL magic is all it takes
k
Ah I see what you mean. I think we’re not focused on exposing such a utility at the moment because the focus is on 2.0 and the billing model there will be different
👍 1