Skip to content

Commit 0787316

Browse files
authored
feat(onboarding): Add logs to ruby onboarding (#96653)
resolves https://linear.app/getsentry/issue/LOGS-259/add-logs-to-ruby-onboarding <img width="1514" height="759" alt="image" src="https://github.com/user-attachments/assets/8cd30708-3715-43dc-9576-372720450416" />
1 parent a1ee381 commit 0787316

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

static/app/components/onboarding/productSelection.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ export const platformProductAvailability = {
226226
ProductSolution.PROFILING,
227227
ProductSolution.SESSION_REPLAY,
228228
],
229-
ruby: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
229+
ruby: [
230+
ProductSolution.PERFORMANCE_MONITORING,
231+
ProductSolution.PROFILING,
232+
ProductSolution.LOGS,
233+
],
230234
'ruby-rack': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
231235
'ruby-rails': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
232236
} as Record<PlatformKey, ProductSolution[]>;

static/app/gettingStartedDocs/ruby/ruby.spec.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,17 @@ describe('getting started with ruby', function () {
4646
)
4747
).toBeInTheDocument();
4848
});
49+
50+
it('enables logs by setting enable_logs to true', function () {
51+
renderWithOnboardingLayout(docs, {
52+
selectedProducts: [ProductSolution.ERROR_MONITORING, ProductSolution.LOGS],
53+
});
54+
55+
expect(
56+
screen.getByText(textWithMarkupMatcher(/config.enable_logs = true/))
57+
).toBeInTheDocument();
58+
expect(
59+
screen.getByText(textWithMarkupMatcher(/config.enabled_patches = \[:logger\]/))
60+
).toBeInTheDocument();
61+
});
4962
});

static/app/gettingStartedDocs/ruby/ruby.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ Sentry.init do |config|
8989
# Add data like request headers and IP for users,
9090
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
9191
config.send_default_pii = true${
92+
params.isLogsSelected
93+
? `
94+
95+
# Enable sending logs to Sentry
96+
config.enable_logs = true
97+
# Patch Ruby logger to forward logs
98+
config.enabled_patches = [:logger]`
99+
: ''
100+
}${
92101
params.isPerformanceSelected
93102
? `
94103

0 commit comments

Comments
 (0)