Sentry-ruby: How to send release?

Created on 24 Oct 2018  Â·  14Comments  Â·  Source: getsentry/sentry-ruby

Other implementations have the option to set the release.

sentry_sdk.init(release="[email protected]")
Sentry.init({
  release: "[email protected]"
})

I haven't found in the documentation anywhere who to do it in ruby/rails

question

All 14 comments

I would also like to know this, i've not been able to find in the code either.

it looks likes EVENTS that are sent will pull the current release from the configuration https://github.com/getsentry/raven-ruby/blob/master/lib/raven/event.rb#L198

  self.release     ||= configuration.release

but i am not sure if this is the same as sending an init event with release data

Just dropping a permalink for the above URL https://github.com/getsentry/raven-ruby/blob/v2.7.4/lib/raven/event.rb#L198 as the "master link" will probably point to some other line of code in the future :)

You can use sentry-cli to manage releases: https://docs.sentry.io/cli/releases/

Note that the config doesn't create a release using Sentry API. It sets the release to use for Sentry events. That's autodetected, but you can manually override with

Raven.configure do |config|
  config.release = '2.3.12'
end

Using the CLI requires another dependency and onboarding Too many people. Are there other ways to achieve?

Blair

On Jan 3, 2019, at 12:23 PM, Jeremy Daer notifications@github.com wrote:

You can use sentry-cli to manage releases: https://docs.sentry.io/cli/releases/

Note that the config doesn't create a release using Sentry API. It sets the release to use for Sentry events. That's autodetected, but you can manually override with

Raven.configure do |config|
config.release = '2.3.12'
end
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Yep. Using a source control integration is recommended: https://docs.sentry.io/workflow/releases/

You may use curl to directly invoke the API as well.

When using the Raven config in this manner:

Raven.configure do |config|
  config.release = ENV['RELEASE']
end

What is the best value to use as RELEASE? I see in the documentation for Ruby specifically it mentions a commit SHA, but other docs it shows a [email protected] syntax.

I'd prefer to use my git tag for the release. Do I gain anything by passing in a commit SHA? Does it automatically grab the git tag even when prepended with an app name as recommended? So many missing details.

Is this correct? detect_release is only doing the "Tell Sentry When You Deploy a Release" step from https://docs.sentry.io/workflow/releases/, I still need to use the Sentry API somewhere in my deploy process to do the "Associate Commits with a Release" step

AFAICT this is a separate step and is done by using the web API and not from raven-ruby.

The process of registering a release seems to be simple though and can be done with curl, wget or Ruby.

As @jeremy said, you should be able to set the release with

Raven.configure do |config|
  config.release = "revision"
end

If it's not set, the SDK will detect release from different sources in the following order:

  1. ENV["SENTRY_CURRENT_ENV"]
  2. git
  3. capistrano revision file or revisions.log
  4. ENV["HEROKU_SLUG_COMMIT"] if your app is on heroku

I'm going to close this now, but feel free to reopen it if you still have questions on release detection 😄

@st0012 there's still no support for _creating_ release information, right?

Is there any other issue about creating a release?

currently, we have no plan to support creating release information from SDK (not just Ruby SDK, but all SDKs). so please use either the API or cli for that purpose as the document suggests. I'll keep you posted if this decision was changed 😉

Was this page helpful?
0 / 5 - 0 ratings