1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import {Layout, LayoutProps} from 'sentry/components/onboarding/gettingStartedDoc/layout';
- import {ModuleProps} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation';
- import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
- import {tct} from 'sentry/locale';
- // Configuration Start
- export const steps = ({
- dsn,
- }: {
- dsn?: string;
- } = {}): LayoutProps['steps'] => [
- {
- type: StepType.INSTALL,
- description: (
- <p>
- {tct('Install the SDK via Rubygems by adding it to your [code:Gemfile]:', {
- code: <code />,
- })}
- </p>
- ),
- configurations: [
- {
- language: 'ruby',
- code: `gem "sentry-ruby"`,
- },
- ],
- },
- {
- type: StepType.CONFIGURE,
- description: (
- <p>
- {tct(
- 'Add use [code:Sentry::Rack::CaptureExceptions] to your [code:config.ru] or other rackup file (this is automatically inserted in Rails):',
- {
- code: <code />,
- }
- )}
- </p>
- ),
- configurations: [
- {
- language: 'ruby',
- code: `
- require 'sentry-ruby'
- Sentry.init do |config|
- config.dsn = '${dsn}'
- # Set traces_sample_rate to 1.0 to capture 100%
- # of transactions for performance monitoring.
- # We recommend adjusting this value in production.
- config.traces_sample_rate = 1.0
- # or
- config.traces_sampler = lambda do |context|
- true
- end
- end
- use Sentry::Rack::CaptureExceptions
- `,
- },
- ],
- },
- ];
- // Configuration End
- export function GettingStartedWithRubyRack({dsn, ...props}: ModuleProps) {
- return <Layout steps={steps({dsn})} {...props} />;
- }
- export default GettingStartedWithRubyRack;
|