https://prefect.io logo
#prefect-community
Title
# prefect-community
a

Anurag Bajpai

05/13/2022, 12:53 PM
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

Anna Geller

05/13/2022, 12:55 PM
I've never worked with Sentry so it's hard to help, sorry maybe someone from the community will chime in
k

Kevin Kho

05/13/2022, 1:32 PM
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

Anurag Bajpai

05/13/2022, 1:52 PM
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

Kevin Kho

05/13/2022, 1:54 PM
I believe it’s yes. The decorated function contains all the logic and is submitted to Dask
a

Anurag Bajpai

05/13/2022, 2:05 PM
alright, i'll try that then. Thanks!
a

Anna Geller

05/13/2022, 9:36 PM
@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

Mathijs Miermans

05/13/2022, 9:43 PM
^ 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

Anurag Bajpai

05/14/2022, 7:02 AM
@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

Mathijs Miermans

05/16/2022, 3:52 PM
Yes. I guess it was the end of the week. 😄
👍 1
5 Views