https://prefect.io logo
Title
f

Farooque Shaikh

10/03/2022, 3:27 PM
Hi All... I am trying to pull detailed prefect logs using the graphql, however i could not find the table/column name in graphql which holds the detailed logs. Any help would be really appreciated
m

Mason Menges

10/03/2022, 6:11 PM
Hey @Farooque Shaikh Could you elaborate on the types os logs you're looking for, are they related to flow_runs, task_runs, or something else?
f

Farooque Shaikh

10/04/2022, 12:21 PM
both flow_run and task_Run, so we are running dbt tasks through Prefect and the logs that we get on UI do not fit in 1 page so we have to keep scrolling up and down to read the entire log, I wanted to see if same log info is stored in some backend view so that i can extract that and load into one of our warehouse tables for easily querying on errors
m

Mason Menges

10/04/2022, 6:06 PM
Brilliant, you can retrieve logs from the graphql endpoint, I just run these in the interactive api but you should be able to query using the client as well 🙂
query {
  flow_run {
    logs {
      message
      timestamp
    }
  }
}
f

Farooque Shaikh

10/04/2022, 6:24 PM
i tried this, but the message and timestamp in logs is showing null for all records
@Mason Menges
m

Mason Menges

10/04/2022, 6:28 PM
depending on when the flow run was triggered some of the logs may be archived, it's also possible that could be a permissions issue, though unlikely.
f

Farooque Shaikh

10/04/2022, 6:44 PM
is there anything i can check to figure out if this is access issue
m

Mason Menges

10/04/2022, 6:55 PM
Are you a user or an admin within the Tenant?
f

Farooque Shaikh

10/04/2022, 7:07 PM
admin