Skip to content

refactor: migrate ruby and related sdks to inline product options sytnax #13442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions platform-includes/debug-symbols-apple/_default.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,25 @@ Sentry can display snippets of your code next to event stack traces. This featur

<OrgAuthTokenNote />

```ruby {tabTitle:Current Fastlane plugin} {"onboardingOptions": {"source-context": "5"}}
```ruby {tabTitle:Current Fastlane plugin}
sentry_debug_files_upload(
auth_token: '___ORG_AUTH_TOKEN___',
org_slug: '___ORG_SLUG___',
project_slug: '___PROJECT_SLUG___',
# ___PRODUCT_OPTION_START___ source-context
include_sources: true, # Optional. For source context.
# ___PRODUCT_OPTION_END___ source-context
)
```

```ruby {tabTitle:Fastlane plugin before 1.20.0} {"onboardingOptions": {"source-context": "5"}}
```ruby {tabTitle:Fastlane plugin before 1.20.0}
sentry_upload_dif(
auth_token: '___ORG_AUTH_TOKEN___',
org_slug: '___ORG_SLUG___',
project_slug: '___PROJECT_SLUG___',
# ___PRODUCT_OPTION_START___ source-context
include_sources: true, # Optional. For source context.
# ___PRODUCT_OPTION_END___ source-context
)
```

Expand Down Expand Up @@ -106,7 +110,7 @@ Another option is to use warnings, and then set `GCC_TREAT_WARNINGS_AS_ERRORS` t

<OrgAuthTokenNote />

```bash {tabTitle:Warn on failures - nonblocking} {"onboardingOptions": {"source-context": "10"}}
```bash {tabTitle:Warn on failures - nonblocking}
if [[ "$(uname -m)" == arm64 ]]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
Expand All @@ -116,7 +120,9 @@ export SENTRY_ORG=___ORG_SLUG___
export SENTRY_PROJECT=___PROJECT_SLUG___
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
ERROR=$(sentry-cli debug-files upload \
# ___PRODUCT_OPTION_START___ source-context
--include-sources \
# ___PRODUCT_OPTION_END___ source-context
"$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
if [ ! $? -eq 0 ]; then
echo "warning: sentry-cli - $ERROR"
Expand All @@ -126,7 +132,7 @@ echo "warning: sentry-cli not installed, download from https://github.com/getsen
fi
```

```bash {tabTitle:Error on failures - blocking} {"onboardingOptions": {"source-context": "10"}}
```bash {tabTitle:Error on failures - blocking}
if [[ "$(uname -m)" == arm64 ]]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
Expand All @@ -136,7 +142,9 @@ export SENTRY_ORG=___ORG_SLUG___
export SENTRY_PROJECT=___PROJECT_SLUG___
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
ERROR=$(sentry-cli debug-files upload \
# ___PRODUCT_OPTION_START___ source-context
--include-sources \
# ___PRODUCT_OPTION_END___ source-context
"$DWARF_DSYM_FOLDER_PATH" --force-foreground 2>&1 >/dev/null)
if [ ! $? -eq 0 ]; then
echo "error: sentry-cli - $ERROR"
Expand Down
6 changes: 5 additions & 1 deletion platform-includes/getting-started-config/ruby.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```ruby {"onboardingOptions": {"performance": "12-15", "profiling": "16-19"}}
```ruby
require 'sentry-ruby'

Sentry.init do |config|
Expand All @@ -10,13 +10,17 @@ Sentry.init do |config|
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# ___PRODUCT_OPTION_START___ performance

# enable tracing
# we recommend adjusting this value in production
config.traces_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ performance
# ___PRODUCT_OPTION_START___ profiling

# enable profiling
# this is relative to traces_sample_rate
config.profiles_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ profiling
end
```
12 changes: 10 additions & 2 deletions platform-includes/getting-started-config/ruby.rack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add `use Sentry::Rack::CaptureExceptions` to your `config.ru` or other rackup file:


```ruby {filename:config.ru} {"onboardingOptions": {"performance": "12-15", "profiling": "16-19"}}
```ruby {filename:config.ru}
require 'sentry-ruby'

Sentry.init do |config|
Expand All @@ -15,14 +15,18 @@ Sentry.init do |config|
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# ___PRODUCT_OPTION_START___ performance

# enable tracing
# we recommend adjusting this value in production
config.traces_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ performance
# ___PRODUCT_OPTION_START___ profiling

# enable profiling
# this is relative to traces_sample_rate
config.profiles_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ profiling
end

use Sentry::Rack::CaptureExceptions
Expand All @@ -37,7 +41,7 @@ be placed before your code requires Sinatra:

</Alert>

```ruby {filename:app.rb} {"onboardingOptions": {"performance": "12-15", "profiling": "16-19"}}
```ruby {filename:app.rb}
require 'sentry-ruby'

Sentry.init do |config|
Expand All @@ -49,14 +53,18 @@ Sentry.init do |config|
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# ___PRODUCT_OPTION_START___ performance

# enable tracing
# we recommend adjusting this value in production
config.traces_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ performance
# ___PRODUCT_OPTION_START___ profiling

# enable profiling
# this is relative to traces_sample_rate
config.profiles_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ profiling
end

# in a non-rackup environment you must initialize the Sentry SDK before requiring sinatra
Expand Down
6 changes: 5 additions & 1 deletion platform-includes/getting-started-config/ruby.rails.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Initialize the SDK within your `config/initializers/sentry.rb`:


```ruby {filename:config/initializers/sentry.rb} {"onboardingOptions": {"performance": "10-13", "profiling": "14-17"}}
```ruby {filename:config/initializers/sentry.rb}
Sentry.init do |config|
config.dsn = '___PUBLIC_DSN___'

Expand All @@ -11,13 +11,17 @@ Sentry.init do |config|
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# ___PRODUCT_OPTION_START___ performance

# enable tracing
# we recommend adjusting this value in production
config.traces_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ performance
# ___PRODUCT_OPTION_START___ profiling

# enable profiling
# this is relative to traces_sample_rate
config.profiles_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ profiling
end
```
6 changes: 5 additions & 1 deletion platform-includes/getting-started-config/ruby.resque.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```ruby {"onboardingOptions": {"performance": "12-15", "profiling": "16-19"}}
```ruby
require 'sentry-ruby'

Sentry.init do |config|
Expand All @@ -10,14 +10,18 @@ Sentry.init do |config|
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# ___PRODUCT_OPTION_START___ performance

# enable tracing
# we recommend adjusting this value in production
config.traces_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ performance
# ___PRODUCT_OPTION_START___ profiling

# enable profiling
# this is relative to traces_sample_rate
config.profiles_sample_rate = 1.0
# ___PRODUCT_OPTION_END___ profiling
end
```

Expand Down