Send custom event to Sentry

Hello All,

I have configured sentry in my Ruby on Rails applications, I want to send custom events to Sentry and i am using something like

Raven.send_event({:message => 'Custom event'})

This works but I need to send additional custom information like user_name, email_id and other details which may vary from event to event.

Any help would be really great, Thanks.

Hi! Sounds like you’re looking for this: https://docs.sentry.io/clients/ruby/#additional-context

HI @BYK, thanks for your message.

I managed to do it via,

    Raven.capture_message "message for user_id #{user.id}",
      logger: 'logger',
      extra: {
        time_at: Time.now
      },
      tags: {
        env: Rails.env
      }
1 Like

Thanks for sharing your solution @AksharJ! You may also want to mark your own answer as “solution” :wink:

1 Like

Hey @BYK, sorry can you please let me know, how can i mark it as the answer :slight_smile:

You should click on the checkbox icon in your message above with the code snippet:

Hi @BYK,

Thanks for your reply. However, i dont see the checkbox, here is what i see. Thanks.

@AksharJ ah, never mind then and sorry for the trouble. I’m also still learning to use our forums so I’ll figure it out :slight_smile:

1 Like