PetroGromovo's avatar

How in sentry console to make search with custom tag?

On laravel 11 site I want to write message into sentry with custom tag "StaffUserChangingStatus" in event handler.

In sentry project I have some errors :

enter image description here

I check this custom tag in issue detailes:

enter image description here

Now I need to filter by all issues with custom tag "StaffUserChangingStatus". I tried to make a condition manually :

enter image description here

But that does not work. If there is a way to use custom tags for filter? Maybe sentry has some other functionality for grouping and filtering of issues?

"laravel/framework": "^11.9",
"sentry/sentry-laravel": "^4.7",

Thanks in advance!

0 likes
4 replies
martinbean's avatar

@petrogromovo You’re not filtering properly. You’re trying to use the value of a tag (StaffUserChangingStatus) but you also need to include the tag name, which is eventType. So just query on that:

eventType:StaffUserChangingStatus

You should also get autocompletion when typing eventType in the search bar.

You‘re probably also better off sticking to snake_case for tag names (i.e. event_type) as per all of Sentry’s other tag names.

1 like
PetroGromovo's avatar

@martinbean I changed line of code :

$scope->setTag('event_type', $tag);

Now in sentry issue I see :

https://img001.prntscr.com/file/img001/jodV1Lq9TEi-MyI6JJC83g.png

But when I try to apply filter with string

event_type:StaffUserChangingStatus

Nothing was found :

![Screenshot at sentry.] (https://img001.prntscr.com/file/img001/MJk3tiScRQCOJmt-d4PqbQ.png)

I changed condition as array :

event_type:[StaffUserChangingStatus]

and still nothing found :

![Screenshot at sentry.] (https://img001.prntscr.com/file/img001/5zdo-kzBTiCS547zOMvE4w.png)

?

martinbean's avatar
Level 80

@PetroGromovo You’ve changed the event name. So it will only work for new issues, as all the old issues will still have the camelCase-named tag (eventType).

1 like
PetroGromovo's avatar

@martinbean No I see event_type only. I logged new errors and I changed label of the tag ... Please point where I left "eventType" literal ?

Please or to participate in this conversation.