We'd like to integrate Sentry with our Prefect flo...
# prefect-community
a
We'd like to integrate Sentry with our Prefect flows as described here. However, the approach that has been taken here has been to have the sentry initialisation done in a separate task that is called at the beginning of each flow. Am i correct in believing that this will only work for LocalExecutor and not for LocalDaskExecutor or DaskExecutor? If so, what would be the best practice to have the sentry initialisation done for those executors? Calling the initialisation as a function at the beginning of each task is technically feasible but clunky. Would a Task subclass help here? Could the initialisation be put in a task state handler?
1
a
I've never worked with Sentry so it's hard to help, sorry maybe someone from the community will chime in
k
You can try a task state handler for when tasks go into a running state. That would be the best attempt, but I don’t know if it will work
a
i guess the question would be whether the task state handler will get executed in the same dask worker as the task. If yes, that should theoretically work.
k
I believe it’s yes. The decorated function contains all the logic and is submitted to Dask
a
alright, i'll try that then. Thanks!
a
@Anurag Bajpai Mathijs from Pocket has just contributed their data flows repository that contains Sentry integration - check it out, perhaps it can help solve your issue
m
^ There are probably some references to Slack Sentry in our repo because we use it widely at Pocket. We haven't integrated it with Prefect yet. If you find a solution, please let me know, Anurag!
I briefly looked into it a while back, and found this: https://github.com/PrefectHQ/prefect/discussions/4672
a
@Mathijs Miermans I think you meant Sentry, not Slack? Sure, I'll let you know once we try it out and see if it works. Might take a while 😅
m
Yes. I guess it was the end of the week. 😄
👍 1