# Sentry/Publish event to Kafka in WorkflowInboudInterceptor

**URL:** <https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [May 25, 2025, 5:01am UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515 "2025-05-25T05:01:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sohil](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sohil/32/7303_2.png) [@Sohil](https://community.temporal.io/u/Sohil)\
**Post date:** [May 25, 2025, 5:01am UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/1 "2025-05-25T05:01:03Z")

</div>

Hi!

I want to achieve the following:

- Whenever a workflow fails/succeeds I want to send an event to kafka
- Wherever a workflow fails I want to log to Sentry
- In future, I would want to extend this for other “interesting” points in the workflow execution

I see that the workflow inbound interceptor needs to be deterministic, however I am unclear whether to use IsReplaying vs model this as an activity (seems overkill)

In general, is IsReplaying positionally aware wrt the call in the workflow? Or will it be true throughout even if a path within the workflow is being taken for the first time after partial replay?

Please assist with the best pattern for achieving this. I see a lot of different opinions on this forum wrt this topic so wanted to see what’s the best pattern as per current sdk

Thanks!

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 25, 2025, 5:06pm UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/2 "2025-05-25T17:06:31Z")

</div>

It is OK to use isReplaying to filter out duplicates. There are a few things to watch for when doing this:

- You have to ignore all errors and continue when publishing is not possible. Another option is to panic on a publishing error. This is going to fail a workflow task. The task is retried, but this is not recommended for long outages.
- If publishing takes longer than one second it is going to trip the deadlock detector. So you have to either ensure lower latency or publish asynchronously from a separate goroutine.

---

<div class="post-metadata">

**Author:** ![Sohil](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sohil/32/7303_2.png) [@Sohil](https://community.temporal.io/u/Sohil)\
**Post date:** [May 25, 2025, 5:12pm UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/3 "2025-05-25T17:12:40Z")

</div>

2 questions

Would using an activity instead yield the same result?

Also when you say goroutine, you mean workflow.Go or vanilla “go”. I assume the latter, since it’s under IsReplaying so it shouldn’t matter

Correct?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 25, 2025, 5:16pm UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/4 "2025-05-25T17:16:07Z")

</div>

When using activity it is going to be retried on its own retry options and workflow can decide if it continues or waits for it to complete.

Vanilla “go”.

---

<div class="post-metadata">

**Author:** ![Sohil](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sohil/32/7303_2.png) [@Sohil](https://community.temporal.io/u/Sohil)\
**Post date:** [May 28, 2025, 5:24am UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/5 "2025-05-28T05:24:02Z")

</div>

Thanks! That worked well

One last question if you are still around

If I use an Activity in my interceptor, I don’t need to worry about IsReplaying etc right?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 28, 2025, 4:34pm UTC](https://community.temporal.io/t/sentry-publish-event-to-kafka-in-workflowinboudinterceptor/17515/6 "2025-05-28T16:34:27Z")

</div>

Yes, the interceptor is executing with the same semantic as the rest of the workflow code.
