Hello! Is there a way to access the Audit Logs ass...
# prefect-cloud
g
Hello! Is there a way to access the Audit Logs associated with an Enterprise customer account through a query to Prefect Cloud? I can see them via the web UI, but want to access this programmatically via query (or otherwise make it available to be piped/accessed via another monitoring service) I found this post from February '22 on the topic which seems to imply it's possible, but it was for Prefect 1, using GraphQL: https://discourse.prefect.io/t/how-to-query-audit-logs-using-graphql-api/344 I'm using Prefect 2.13. I've tried searching through the Cloud API docs, but I wasn't able to find any documentation on this. Any help?
w
Hey Geoff - audit events are account level events. so they are represented in our API under the account events object - this endpoint should be what you need https://app.prefect.cloud/api/docs#tag/Events/operation/create_account_events_api_accounts__account_id__events_post
g
Ah, awesome, thank you so much, that works great for me!
Actually, one other related question: what is the retention period for an Enterprise customer for both account level events, as well as standard Flow logs?
w
if you go to account settings here, you should see your retention period.
here we go, this comparison on the pricing page is accurate. https://www.prefect.io/pricing
flow runs and logs are 30 days on pro and custom on enterprise. audit logs are three days on pro and custom on enterprise. hit my DMs if you need an extension on that lookback on a temporary basis or have any detailed questions.
g
Thanks so much for your help!
w
totally.