mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is Functional Software's trademark, so every place the running app says it to a user -- page titles, onboarding, empty states, toasts, settings copy, the self-hosted footer -- now says Sentinel. Attribution is the other half of the deal and stays untouched: upstream copyright headers, LICENSE, NOTICE. So does anything where the mark is a fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree. Renaming those would leave instructions that no longer work. Nothing structural moved. No import, identifier, route path, feature flag, API field or test id changed; the diff is 312 lines in and 312 out. Colocated specs were updated in lockstep with the copy they assert. Marketing and community links point at hanzo.ai, only where a real page exists to point at. Co-authored-by: Hanzo Dev <[email protected]>
393 lines
11 KiB
TypeScript
393 lines
11 KiB
TypeScript
import ExternalLink from 'sentry/components/links/externalLink';
|
|
import type {StepProps} from 'sentry/components/onboarding/gettingStartedDoc/step';
|
|
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
|
|
import type {
|
|
DocsParams,
|
|
OnboardingConfig,
|
|
} from 'sentry/components/onboarding/gettingStartedDoc/types';
|
|
import {t, tct} from 'sentry/locale';
|
|
import {getInstallConfig as getNodeInstallConfig} from 'sentry/utils/gettingStartedDocs/node';
|
|
|
|
const getJSConfigureSnippet = (params: DocsParams) => `
|
|
Sentry.init({
|
|
dsn: "${params.dsn}",
|
|
integrations: [
|
|
new Sentry.metrics.MetricsAggregator(),
|
|
],
|
|
});`;
|
|
|
|
const getJSVerifySnippet = () => `
|
|
// Add 4 to a counter named 'hits'
|
|
Sentry.metrics.increment('hits', 4);`;
|
|
|
|
export const getJSMetricsOnboarding = ({
|
|
getInstallConfig,
|
|
}: {
|
|
getInstallConfig: (params: DocsParams<any>) => StepProps['configurations'];
|
|
}): OnboardingConfig => ({
|
|
install: params => [
|
|
{
|
|
type: StepType.INSTALL,
|
|
description: tct(
|
|
'You need a minimum version [codeVersion:7.88.0] of the Sentry browser SDK package, or an equivalent framework SDK (e.g. [codePackage:@sentry/react]) installed.',
|
|
{
|
|
codeVersion: <code />,
|
|
codePackage: <code />,
|
|
}
|
|
),
|
|
configurations: getInstallConfig(params),
|
|
},
|
|
],
|
|
configure: params => [
|
|
{
|
|
type: StepType.CONFIGURE,
|
|
description: tct(
|
|
'To enable capturing metrics, you first need to add the [codeIntegration:MetricsAggregator] integration under the [codeNamespace:Sentry.metrics] namespace.',
|
|
{
|
|
codeIntegration: <code />,
|
|
codeNamespace: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'JavaScript',
|
|
value: 'javascript',
|
|
language: 'javascript',
|
|
code: getJSConfigureSnippet(params),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
verify: () => [
|
|
{
|
|
type: StepType.VERIFY,
|
|
description: tct(
|
|
"Then you'll be able to add metrics as [codeCounters:counters], [codeSets:sets], [codeDistribution:distributions], and [codeGauge:gauges]. These are available under the [codeNamespace:Sentry.metrics] namespace. Try out this example:",
|
|
{
|
|
codeCounters: <code />,
|
|
codeSets: <code />,
|
|
codeDistribution: <code />,
|
|
codeGauge: <code />,
|
|
codeNamespace: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'JavaScript',
|
|
value: 'javascript',
|
|
language: 'javascript',
|
|
code: getJSVerifySnippet(),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
description: t(
|
|
'With a bit of delay you can see the data appear in the Sentinel UI.'
|
|
),
|
|
},
|
|
{
|
|
description: tct(
|
|
'Learn more about metrics and how to configure them, by reading the [docsLink:docs].',
|
|
{
|
|
docsLink: (
|
|
<ExternalLink href="https://docs.sentry.io/platforms/javascript/metrics/" />
|
|
),
|
|
}
|
|
),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|
|
|
|
const getJSServerConfigureSnippet = (params: DocsParams) => `
|
|
Sentry.init({
|
|
dsn: "${params.dsn}",
|
|
_experiments: {
|
|
metricsAggregator: true,
|
|
},
|
|
});`;
|
|
|
|
export const getJSServerMetricsOnboarding = (): OnboardingConfig => ({
|
|
install: params => [
|
|
{
|
|
type: StepType.INSTALL,
|
|
description: tct(
|
|
'You need a minimum version [codeVersion:7.91.0] of [codeNode:@sentry/node], [codeDeno:@sentry/deno] or [codeBun:@sentry/bun].',
|
|
{
|
|
codeVersion: <code />,
|
|
codeNode: <code />,
|
|
codeDeno: <code />,
|
|
codeBun: <code />,
|
|
}
|
|
),
|
|
configurations: getNodeInstallConfig(params),
|
|
},
|
|
],
|
|
configure: params => [
|
|
{
|
|
type: StepType.CONFIGURE,
|
|
description: tct(
|
|
'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.',
|
|
{
|
|
codeIntegration: <code />,
|
|
codeNamespace: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'JavaScript',
|
|
value: 'javascript',
|
|
language: 'javascript',
|
|
code: getJSServerConfigureSnippet(params),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
verify: () => [
|
|
{
|
|
type: StepType.VERIFY,
|
|
description: tct(
|
|
"Then you'll be able to add metrics as [codeCounters:counters], [codeSets:sets], [codeDistribution:distributions], and [codeGauge:gauges]. These are available under the [codeNamespace:Sentry.metrics] namespace. This API is available in both renderer and main processes. Try out this example:",
|
|
{
|
|
codeCounters: <code />,
|
|
codeSets: <code />,
|
|
codeDistribution: <code />,
|
|
codeGauge: <code />,
|
|
codeNamespace: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'JavaScript',
|
|
value: 'javascript',
|
|
language: 'javascript',
|
|
code: getJSVerifySnippet(),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
description: t(
|
|
'With a bit of delay you can see the data appear in the Sentinel UI.'
|
|
),
|
|
},
|
|
{
|
|
description: tct(
|
|
'Learn more about metrics and how to configure them, by reading the [docsLink:docs].',
|
|
{
|
|
docsLink: (
|
|
<ExternalLink href="https://docs.sentry.io/platforms/node/metrics/" />
|
|
),
|
|
}
|
|
),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|
|
|
|
const getPythonConfigureSnippet = () => `
|
|
import sentry_sdk
|
|
|
|
sentry_sdk.init(
|
|
...
|
|
_experiments={
|
|
# Turns on the metrics module
|
|
"enable_metrics": True,
|
|
# Enables sending of code locations for metrics
|
|
"metric_code_locations": True,
|
|
},
|
|
)`;
|
|
|
|
const getPythonVerifySnippet = () => `
|
|
# Increment a metric to see how it works
|
|
metrics.incr("drank-drinks", 1, tags={"kind": "coffee"})`;
|
|
|
|
export const getPythonMetricsOnboarding = ({
|
|
installSnippet,
|
|
}: {
|
|
installSnippet: string;
|
|
}): OnboardingConfig => ({
|
|
install: () => [
|
|
{
|
|
type: StepType.INSTALL,
|
|
description: tct(
|
|
"You need a minimum version [codeVersion:1.38.0] of the [codePackage:sentry-python] SDK and add that as your dependency. You don't need to install any additional packages",
|
|
{
|
|
codeVersion: <code />,
|
|
codePackage: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'bash',
|
|
code: installSnippet,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
configure: () => [
|
|
{
|
|
type: StepType.CONFIGURE,
|
|
description: t(
|
|
'Once the SDK is installed or updated you have to add experimental flag into your SDK init:'
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'Python',
|
|
value: 'python',
|
|
language: 'python',
|
|
code: getPythonConfigureSnippet(),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
verify: () => [
|
|
{
|
|
type: StepType.VERIFY,
|
|
description: tct(
|
|
"Then you'll be able to add metrics as [codeCounters:counters], [codeSets:sets], [codeDistribution:distributions], and [codeGauge:gauges]. Try out this example:",
|
|
{
|
|
codeCounters: <code />,
|
|
codeSets: <code />,
|
|
codeDistribution: <code />,
|
|
codeGauge: <code />,
|
|
codeNamespace: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
code: [
|
|
{
|
|
label: 'Python',
|
|
value: 'python',
|
|
language: 'python',
|
|
code: getPythonVerifySnippet(),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
description: t(
|
|
'With a bit of delay you can see the data appear in the Sentinel UI.'
|
|
),
|
|
},
|
|
{
|
|
description: tct(
|
|
'Learn more about metrics and how to configure them, by reading the [docsLink:docs].',
|
|
{
|
|
docsLink: (
|
|
<ExternalLink href="https://docs.sentry.io/platforms/python/metrics/" />
|
|
),
|
|
}
|
|
),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|
|
|
|
const getDotnetConfigureSnippet = (params: DocsParams) => `
|
|
SentrySdk.Init(options =>
|
|
{
|
|
options.Dsn = "${params.dsn}";
|
|
options.ExperimentalMetrics = new ExperimentalMetricsOptions
|
|
{
|
|
EnableCodeLocations = true
|
|
};
|
|
});`;
|
|
|
|
const getDotnetVerifySnippet = () => `
|
|
SentrySdk.Metrics.Increment(
|
|
"drank-drinks",
|
|
tags:new Dictionary<string, string> {{"kind", "coffee"}}
|
|
);`;
|
|
|
|
export const getDotnetMetricsOnboarding = ({
|
|
packageName,
|
|
}: {
|
|
packageName: string;
|
|
}): OnboardingConfig => ({
|
|
install: () => [
|
|
{
|
|
type: StepType.INSTALL,
|
|
description: tct(
|
|
'You need a minimum version [codeVersion:4.0.0-beta.8] of the .NET SDK installed',
|
|
{
|
|
codeVersion: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'powershell',
|
|
code: `dotnet add package ${packageName} -v 4.0.0-beta.8`,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
configure: params => [
|
|
{
|
|
type: StepType.CONFIGURE,
|
|
description: t(
|
|
'Once the SDK is installed or updated, you can enable the experimental metrics feature and code locations being emitted in your SDK init.'
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'csharp',
|
|
code: getDotnetConfigureSnippet(params),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
verify: () => [
|
|
{
|
|
type: StepType.VERIFY,
|
|
description: tct(
|
|
"Then you'll be able to add metrics as [codeCounters:counters], [codeSets:sets], [codeDistribution:distributions], and [codeGauge:gauges]. Try out this example:",
|
|
{
|
|
codeCounters: <code />,
|
|
codeSets: <code />,
|
|
codeDistribution: <code />,
|
|
codeGauge: <code />,
|
|
}
|
|
),
|
|
configurations: [
|
|
{
|
|
language: 'csharp',
|
|
code: getDotnetVerifySnippet(),
|
|
},
|
|
{
|
|
description: t(
|
|
'With a bit of delay you can see the data appear in the Sentinel UI.'
|
|
),
|
|
},
|
|
{
|
|
description: tct(
|
|
'Learn more about metrics and how to configure them, by reading the [docsLink:docs].',
|
|
{
|
|
docsLink: (
|
|
<ExternalLink href="https://docs.sentry.io/platforms/dotnet/metrics/" />
|
|
),
|
|
}
|
|
),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|