Skip to content

Commit cc18504

Browse files
authored
feat(onboarding): Add logs to ruby-rack onboarding (#96673)
resolves https://linear.app/getsentry/issue/LOGS-261/add-logs-to-ruby-rack-onboarding
1 parent bceadcd commit cc18504

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
@@ -231,7 +231,11 @@ export const platformProductAvailability = {
231231
ProductSolution.PROFILING,
232232
ProductSolution.LOGS,
233233
],
234-
'ruby-rack': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING],
234+
'ruby-rack': [
235+
ProductSolution.PERFORMANCE_MONITORING,
236+
ProductSolution.PROFILING,
237+
ProductSolution.LOGS,
238+
],
235239
'ruby-rails': [
236240
ProductSolution.PERFORMANCE_MONITORING,
237241
ProductSolution.PROFILING,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,17 @@ describe('getting started with rack', 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/rack.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ Sentry.init do |config|
2323
# Add data like request headers and IP for users,
2424
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
2525
config.send_default_pii = true${
26+
params.isLogsSelected
27+
? `
28+
29+
# Enable sending logs to Sentry
30+
config.enable_logs = true
31+
# Patch Ruby logger to forward logs
32+
config.enabled_patches = [:logger]`
33+
: ''
34+
}${
2635
params.isPerformanceSelected
2736
? `
2837

0 commit comments

Comments
 (0)