<@ULVA73B9P> how can i be notified when a deployme...
# marvin-in-the-wild
s
@Marvin how can i be notified when a deployment is not ready status
m
To assist you effectively, I need to know your Prefect version. Could you please confirm whether you're using Prefect 2.x or 3.x? If you're not sure, any additional details about your environment might help.
s
I am using prefect 2.x hosted @Marvin
m
It seems that there's active development and discussion around notifying users when a deployment is not in a ready status in Prefect 2.x. There are ongoing improvements to emit events like
prefect.deployment.ready
and
prefect.deployment.not-ready
, which would allow you to trigger notifications based on these status changes. Here are some key points from the related GitHub issues and pull requests: 1. A proposal exists to create deployment status events that would notify users when a deployment's status changes from ready to not ready (and vice versa), which can be used to automate notifications for deployment health (GitHub Issue). 2. A pull request has been merged to emit these events and persist deployment status in the database (GitHub PR). These features would allow you to set up automations or scripts that listen to these events and, in turn, notify you through your preferred communication channel (e.g., Slack, email, etc.). For further support, you might want to explore Prefect's event logging or look into integrations that can consume and act on these emitted events once they're publicly documented and available in your current deployment environment.
s
@Marvin so there is nothing out of the box with prefect notifications and these events at this time?
m
As of the latest updates, Prefect does not offer an out-of-the-box notification system specifically tied to deployment status changes like "not ready." The developments and discussions around this feature are still in progress, focusing on emitting status events that users can then utilize to build their own notification systems. While these events provide the groundwork for automation, you'll need to implement additional logic to capture these events and trigger notifications via a third-party service or a custom script. For notification capabilities, you may consider using Prefect's integration features or external services like Slack or email for sending alerts when your deployment status changes, once these events are implemented on your platform. Keep an eye on updates from Prefect for when these features are fully integrated and available for your environment.
n
hi @Spida45 - I would make an automation triggered on work pool readyness and then send the notification as the action
since in most cases, the readyness of the work pool (ie whether or not a worker is listening and ready to submit scheduled runs) is a good proxy for deployment readyness
s
Hi @Nate we are using prefect hosted and not using work pools. we are using a service. the issue is i am seeing is that service is running but prefect is showing "not ready" when i restart the service everything works again for a period of time
n
Hi @Nate we are using prefect hosted and not using work pools. we are using a service.
hmm im not sure what you mean by a service
s
nba_api_pipeline.nba_api_pipeline.serve
👍 1
n
got it - you're using
.serve
- thanks! I think you can use deployment status directly instead of work pool status then - Marvin is sometimes wrong, and in this case I think deployment status is ready to use
however, if you're using 2.x, the self hosted server doesnt have automations yet (it does in 3.x) so you may have to use a different strategy while on 2.x
👍 1