-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore(logs): update SDK onboarding pages #104234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2a795b8
3d3fc0e
60afa60
bcf6099
7403592
25d3f70
cb211a3
0219a37
f3a368a
b3fe2f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -304,7 +304,10 @@ export const withLoggingOnboarding: Set<PlatformKey> = new Set([ | |
| 'apple-ios', | ||
| 'apple-macos', | ||
| 'bun', | ||
| 'cocoa-objc', | ||
| 'cocoa-swift', | ||
|
Comment on lines
+307
to
+308
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that we have several references to these platforms in the codebase, but we don’t present them as options when users create a project. My understanding is that users can also create projects through the public API - Is that why we need to include these platforms here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah seems like it, they were also added to some other categories for backwards compatability #84768 |
||
| 'dart', | ||
| 'dotnet', | ||
| 'flutter', | ||
| 'go', | ||
| 'go-echo', | ||
|
|
@@ -336,6 +339,7 @@ export const withLoggingOnboarding: Set<PlatformKey> = new Set([ | |
| 'javascript-sveltekit', | ||
| 'javascript-tanstackstart-react', | ||
| 'javascript-vue', | ||
| 'native', | ||
| 'node', | ||
| 'node-azurefunctions', | ||
| 'node-connect', | ||
|
|
@@ -350,6 +354,7 @@ export const withLoggingOnboarding: Set<PlatformKey> = new Set([ | |
| 'node-nestjs', | ||
| 'php', | ||
| 'php-laravel', | ||
| 'php-symfony', | ||
| 'python', | ||
| 'python-aiohttp', | ||
| 'python-asgi', | ||
|
|
@@ -376,6 +381,8 @@ export const withLoggingOnboarding: Set<PlatformKey> = new Set([ | |
| 'ruby-rack', | ||
| 'ruby-rails', | ||
| 'rust', | ||
| 'unity', | ||
| 'unreal', | ||
| ]); | ||
|
|
||
| // List of platforms that do not have logging support. We make use of this list in the product to not provide any Logging | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,88 @@ | ||||||
| import {ExternalLink} from 'sentry/components/core/link'; | ||||||
| import type { | ||||||
| DocsParams, | ||||||
| OnboardingConfig, | ||||||
| } from 'sentry/components/onboarding/gettingStartedDoc/types'; | ||||||
| import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; | ||||||
| import {t, tct} from 'sentry/locale'; | ||||||
|
|
||||||
| export const logs: OnboardingConfig = { | ||||||
| install: () => [ | ||||||
| { | ||||||
| type: StepType.INSTALL, | ||||||
| content: [ | ||||||
| { | ||||||
| type: 'text', | ||||||
| text: tct( | ||||||
| 'Logs in .NET are supported in Sentry .NET SDK version [code:5.14.0] and above.', | ||||||
| { | ||||||
| code: <code />, | ||||||
| } | ||||||
| ), | ||||||
| }, | ||||||
| ], | ||||||
| }, | ||||||
| ], | ||||||
| configure: (params: DocsParams) => [ | ||||||
| { | ||||||
| type: StepType.CONFIGURE, | ||||||
| content: [ | ||||||
| { | ||||||
| type: 'text', | ||||||
| text: tct( | ||||||
| 'To enable logging, you need to initialize the SDK with the [code:EnableLogs] option set to [code:true].', | ||||||
| { | ||||||
| code: <code />, | ||||||
| } | ||||||
| ), | ||||||
| }, | ||||||
| { | ||||||
| type: 'code', | ||||||
| language: 'csharp', | ||||||
| code: `SentrySdk.Init(options => | ||||||
| { | ||||||
| options.Dsn = "${params.dsn.public}"; | ||||||
| // Enable logs to be sent to Sentry | ||||||
| options.EnableLogs = true; | ||||||
| });`, | ||||||
| }, | ||||||
| ], | ||||||
| }, | ||||||
| ], | ||||||
| verify: () => [ | ||||||
| { | ||||||
| type: StepType.VERIFY, | ||||||
| content: [ | ||||||
| { | ||||||
| type: 'text', | ||||||
| text: t( | ||||||
| 'Once the feature is enabled on the SDK and the SDK is initialized, you can send logs using the SentrySdk.Logger APIs.' | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ), | ||||||
| }, | ||||||
| { | ||||||
| type: 'text', | ||||||
| text: t( | ||||||
| 'The SentrySdk.Logger instance exposes six methods that you can use to log messages at different log levels: Trace, Debug, Info, Warning, Error, and Fatal.' | ||||||
| ), | ||||||
| }, | ||||||
| { | ||||||
| type: 'code', | ||||||
| language: 'csharp', | ||||||
| code: `SentrySdk.Logger.LogInfo("A simple log message"); | ||||||
| SentrySdk.Logger.LogError("A {0} log message", "formatted");`, | ||||||
| }, | ||||||
| { | ||||||
| type: 'text', | ||||||
| text: tct( | ||||||
| 'You can also attach custom attributes via a delegate. For more information, see the [link:Integrations documentation].', | ||||||
| { | ||||||
| link: ( | ||||||
| <ExternalLink href="https://docs.sentry.io/platforms/dotnet/logs/#integrations" /> | ||||||
| ), | ||||||
| } | ||||||
| ), | ||||||
| }, | ||||||
| ], | ||||||
| }, | ||||||
| ], | ||||||
| }; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types'; | ||
| import {CrashReportWebApiOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding'; | ||
|
|
||
| import {logs} from './logs'; | ||
| import {onboarding} from './onboarding'; | ||
|
|
||
| const docs: Docs = { | ||
| onboarding, | ||
| crashReportOnboarding: CrashReportWebApiOnboarding, | ||
| logsOnboarding: logs, | ||
| }; | ||
|
|
||
| export default docs; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import {ExternalLink} from 'sentry/components/core/link'; | ||
| import type { | ||
| DocsParams, | ||
| OnboardingConfig, | ||
| } from 'sentry/components/onboarding/gettingStartedDoc/types'; | ||
| import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; | ||
| import {tct} from 'sentry/locale'; | ||
|
|
||
| export const logs: OnboardingConfig = { | ||
| install: () => [ | ||
| { | ||
| type: StepType.INSTALL, | ||
| content: [ | ||
| { | ||
| type: 'text', | ||
| text: tct( | ||
| 'Logs in Native are supported in Sentry Native SDK version [link:0.11.1] and above.', | ||
| { | ||
| link: ( | ||
| <ExternalLink href="https://github.com/getsentry/sentry-native/releases/tag/0.11.1" /> | ||
| ), | ||
| } | ||
|
Comment on lines
+18
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when mentioning versions, why do provide a link only here? asking because I did not see that for dotnet too. |
||
| ), | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| configure: (params: DocsParams) => [ | ||
| { | ||
| type: StepType.CONFIGURE, | ||
| content: [ | ||
| { | ||
| type: 'text', | ||
| text: tct( | ||
| 'To enable logging, you need to initialize the SDK with the [code:enable_logs] option set to [code:true].', | ||
| { | ||
| code: <code />, | ||
| } | ||
| ), | ||
| }, | ||
| { | ||
| type: 'code', | ||
| language: 'c', | ||
| code: `sentry_options_t *options = sentry_options_new(); | ||
| sentry_options_set_dsn(options, "${params.dsn.public}"); | ||
| sentry_options_set_enable_logs(options, 1); | ||
| // set other options | ||
| sentry_init(options);`, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| verify: () => [ | ||
| { | ||
| type: StepType.VERIFY, | ||
| content: [ | ||
| { | ||
| type: 'text', | ||
| text: tct( | ||
| 'Once the feature is enabled on the SDK and the SDK is initialized, you can send logs using the [code:sentry_log_X()] APIs.', | ||
| { | ||
| code: <code />, | ||
| } | ||
| ), | ||
| }, | ||
| { | ||
| type: 'text', | ||
| text: tct( | ||
| 'The API exposes six methods that you can use to log messages at different log levels: [code:trace], [code:debug], [code:info], [code:warn], [code:error], and [code:fatal].', | ||
| { | ||
| code: <code />, | ||
| } | ||
| ), | ||
| }, | ||
| { | ||
| type: 'code', | ||
| language: 'c', | ||
| code: `sentry_log_info("A simple log message"); | ||
| sentry_log_error("A %s log message", "formatted");`, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we going to add LOGS here and other platforms afterwards? Just noticed that it's "new" in our docs https://docs.sentry.io/platforms/dotnet/guides/aspnet/logs/