mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
73 lines
1.6 KiB
TypeScript
73 lines
1.6 KiB
TypeScript
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
|
|
import type {
|
|
Docs,
|
|
DocsParams,
|
|
OnboardingConfig,
|
|
} from 'sentry/components/onboarding/gettingStartedDoc/types';
|
|
import {tct} from 'sentry/locale';
|
|
|
|
type Params = DocsParams;
|
|
|
|
const getConfigureSnippet = (params: Params) => `
|
|
require 'sentry-ruby'
|
|
|
|
Sentry.init do |config|
|
|
config.dsn = '${params.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`;
|
|
|
|
const onboarding: OnboardingConfig = {
|
|
install: () => [
|
|
{
|
|
type: StepType.INSTALL,
|
|
description: tct(
|
|
'Install the SDK via Rubygems by adding it to your [code:Gemfile]:',
|
|
{
|
|
code: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'ruby',
|
|
code: `gem "sentry-ruby"`,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
configure: params => [
|
|
{
|
|
type: StepType.CONFIGURE,
|
|
description: tct(
|
|
'Add use [sentryRackCode:Sentry::Rack::CaptureExceptions] to your [sentryConfigCode:config.ru] or other rackup file (this is automatically inserted in Rails):',
|
|
{
|
|
sentryRackCode: <code />,
|
|
sentryConfigCode: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'ruby',
|
|
code: getConfigureSnippet(params),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
verify: () => [],
|
|
};
|
|
|
|
const docs: Docs = {
|
|
onboarding,
|
|
};
|
|
|
|
export default docs;
|