Sentry and custom context


I have problem with customization and Sentry. I would like add some specifics data in context. I use Plug.Router andI I have example actions

get ":group/:user_id" do end
post ":group/:user_id" do end
put ":group/:user_id" do end
delete ":group/:user_id" do end

and I would like to add group and user_id to sentry context. I can do this with

Sentry.Context.set_user_context(%{id: user_id})
Sentry.Context.set_tags_context(%{group: group})

but I don’t want set context in each action separately,
How to add that “globally”?

Thanks in advance

You can create a plug where you would call Sentry.Context.set_user_context and pipe conns for all these actions through it.