#Logging business flow using Sentry

38 messages · Page 1 of 1 (latest)

oblique grove
#

Hi, so I've been trying to make a logging report for specific business flow in my application. Let's say it was a checkout process.

I want to record the full process between the first user load the page, and then whether their GPS has been loaded (for shipping address), and then when they tap button, whether they can submit the check out or not (referencing with client validation), and when they can submit the check out, it will check whether it succeded or fails.

so in main overview, it will be like this:

  • opening the page (record)
  • ⁠the gps has been loaded or not (record)
  • ⁠when tapping the button, it should check if it’s blocked by client validation (record)
  • ⁠if it’s not blocked by client validation and they tap the submit button, it should call HTTP request (record)
  • ⁠and last it will record the respond of HTTP request whether it was success or failed
  • ⁠if the HTTP request failed due to internet error, it also record.

With this scenario, from the documentation I’m trying to use Transaction as the parent (which is to wrap the whole checkout process), and the children (span) for every record.

Is this a correct way to do it, or there is another better way to achieve this?

dim vessel
oblique grove
#

Can I use the breadcrumbs to also show that there is a client validation error that causing user not submitting their checkout? This validation doesn’t count as exception

dim vessel
#

A span measures how long something takes, a breadcrumb is a point in time event.

oblique grove
#

I see, I think that satisfy my needs.

#

I’ll try it soon

#

By the way, I was also curious on how the additional data works. In flutter, in a transaction I can set the data by ‘transactionName.setData(key, value)’.

Can I filter all data by this? I can only find that I can filter by tag

oblique grove
#

Hi @dim vessel, I just tried the breadcrumbs but I can't find the API.

Transaction is a ISentrySpan right? And I try to transaction.startBreadcrumbs or something that has breadcrumbs in the keyword but I can't find it. Can you help me? Thanks

oblique grove
oblique oasis
#

Yes. Breadcrumbs are sent with both errors and transactions. So that’s why they are created like that. They are not specific to a transaction.

oblique grove
#

Thanks Alex, I already test and the breadcrumbs works.

#

[SOLVED] Logging business flow using Sentry

oblique grove
#

Logging business flow using Sentry

#

Hi @oblique oasis, I have another question. Is it possible to create an alert based on a breadcrumb in a transaction?

Let's say that I have a disabled checkout button, and when I tap it, it will send a breadcrumb disabled_checkout_button in a checkout_process transaction.

Whenever user do this, I want to get an alert because checkout button is not meant to be disabled at any time, so when this happens, it means there is a logic error. Is that possible? Thanks

oblique oasis
#

I would advise you to generate an exception or error to notify you of that.

#

Sentry.captureMessage("Button clicked that shouldn't be clicked")

#

Or something like that

oblique grove
#

Ah I see.

#

Can I somehow link that exception or error into a transaction? So when i got this error, I can directly find the related transaction/the transaction going on

#

And is it possible that I create the alert based on "when this specific exception" happens?

oblique oasis
#

Yes. That is done automatically as long as a transaction is active. But the error also shows all breadcrumbs.

oblique oasis
oblique grove
#

Is this the correct menu? I can't find the option to set the alert only on specific exception

#

Ah I see

oblique oasis
#

See my screenshot in the if condition

oblique grove
#

I'll try to follow your screenshot

oblique oasis
#

Usually though you would just be alerted on all issues

oblique grove
oblique oasis
#

Ahhh, okay that makes sense!

#

Did I see you mention you are on the developer plan though?

oblique grove
#

A new issue is created this option in when, this means that it will be called when every new issue created? Then it will continue to check wit hif condition right?

oblique oasis
#

I think you need to be on any paid plan to use the discord notifications (or any other integration)

oblique oasis
oblique grove
#

Thanks Alex, you've been a big help for me doing this!