Hi, I'm new to prefect and I'm trying to use it t...
# ask-community
d
Hi, I'm new to prefect and I'm trying to use it to evaluate the performance of code / parameter changes. I've created a basic flow but cannot figure out how to get historical metrics on each of the tasks. Is there something that I'm missing? My hope would be to get a table that looks like: | Flow Name | Parameters | Task Name | Start Time | End Time | Duration | I've tried going through the graphQL api and I've looked through the UI. Any direction would be appreciated.
n
Hi @Dan Corbiani - you should be able to query for these using the GraphQL API, or see them in a UI (but in a non-aggregate way at the moment). Try a query like this:
Copy code
query {
  flow_run(where: {name: {_eq: ""}}) {
    id
    name
    parameters
    start_time
    end_time
    task_runs {
      start_time
      end_time
    }
  }
}
But you'll want to tweak that, depending on how you want to aggregate your data
d
thanks @nicholas. I was so close. Is there also a way to get something like this when running the workflow through flow.run() in python?
Is there a way to display the name of the task? I've tried name but it's null.
n
Sure, you can use the graphql client from core to query for that!
I'm not sure what you mean by displaying the name of the task though