https://prefect.io logo
Title
b

Ben Ayers-Glassey

09/09/2022, 9:03 PM
Does Prefect discard the data for old flow runs?.. maybe ones older than 14 days?.. In particular, I had a failed run from Aug 31: https://cloud.prefect.io/zesty-ai/flow-run/385b3c9b-8828-4b46-bda7-5ea32642b266 ...and today I was going to get around to poking at the bug causing it to fail, but instead I see a mostly-blank page with lots of "Uncaught TypeError: Cannot read properties of null (reading 'state')" in the JS console (see attached screenshot). In case it matters, this is for old Prefect, not 2.0.
1
Also, I ask if 14 days is significant, because when I look at either the dashboard or a specific flow, I can only seem to see a "run history" for 14 days ago. See attached screenshot.
c

Christopher Boyd

09/09/2022, 9:12 PM
Hi Ben, that's correct , flow logs are retained only for 14 days by default . Additional length of time for log retention is possible with enterprise features
b

Ben Ayers-Glassey

09/09/2022, 9:13 PM
Ah, I see. Thanks!
c

Christopher Boyd

09/09/2022, 9:15 PM
One possibility we have seen is to capture and log to your own location / storage
If you need longer than 14 days retention but not enterprise features
b

Ben Ayers-Glassey

09/09/2022, 9:18 PM
Is there a good "official-ish" way to capture the
prefect.context.logger
? Like, to just wrap it so that you can do what you want with each log first, before letting the logger then do whatever it usually does (i.e. store logs in Prefect Cloud)?
We have many Prefect flows, but using a common library with helpers for setting up Prefect stuff, so maybe we can just update the library to wrap the logger or something.
c

Christopher Boyd

09/09/2022, 9:20 PM
Generally yea, it would just be logging your output and capturing it where ever you want - you have the option with the loggers to specify the i/O stream like a file or location or datadog or an s3 bucket
We'd still capture in prefect for the fourteen days
But then you'd have your own elsewhere