-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Make
samples
be standalone (#3480)
- Loading branch information
1 parent
dab5789
commit 43e28ad
Showing
54 changed files
with
542 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,6 @@ | |
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
This sets the default DSN for all sample projects. Sentry employees and contractors | ||
can view events at https://sentry-sdks.sentry.io/projects/sentry-dotnet. | ||
The DSN can easily be overwritten in the sample application by the end-user. | ||
The order of precedence is: | ||
- SentryOptions.Dsn property set in code | ||
- Sentry:Dsn set in appsettings.json or other config (where applicable) | ||
- SENTRY_DSN environment variable | ||
- This [Sentry.Dsn] attribute | ||
Thus, this DSN is applied only if no other mechanism is used to set the DSN. | ||
Note - The below works because SentryAttributes is already being converted to | ||
actual attributes in src/Sentry/buildTransitive/Sentry.targets. | ||
--> | ||
<ItemGroup> | ||
<SentryAttributes Include="Sentry.DsnAttribute"> | ||
<_Parameter1>https://[email protected]/5428537</_Parameter1> | ||
</SentryAttributes> | ||
</ItemGroup> | ||
|
||
<!-- Workaround for hang on compile issue. See https://github.com/xamarin/xamarin-macios/issues/17825#issuecomment-1478568270. --> | ||
<PropertyGroup Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' == 'net7.0-ios' And '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'"> | ||
<MtouchUseLlvm>false</MtouchUseLlvm> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,19 @@ public class MainActivity : Activity | |
{ | ||
protected override void OnCreate(Bundle? savedInstanceState) | ||
{ | ||
SentrySdk.Init(o => | ||
SentrySdk.Init(options => | ||
{ | ||
o.Dsn = "https://[email protected]/5428537"; | ||
o.SendDefaultPii = true; // adds the user's IP address automatically | ||
options.Dsn = "https://[email protected]/5428537"; | ||
options.SendDefaultPii = true; // adds the user's IP address automatically | ||
|
||
// Android specific .NET features are under the Android properties: | ||
o.Android.LogCatIntegration = LogCatIntegrationType.Errors; // Get logcat logs for both handled and unhandled errors; default is unhandled only | ||
o.Android.LogCatMaxLines = 1000; // Defaults to 1000 | ||
options.Android.LogCatIntegration = LogCatIntegrationType.Errors; // Get logcat logs for both handled and unhandled errors; default is unhandled only | ||
options.Android.LogCatMaxLines = 1000; // Defaults to 1000 | ||
|
||
// All the native Android SDK options are available below | ||
// https://docs.sentry.io/platforms/android/configuration/ | ||
// Enable Native Android SDK ANR detection | ||
o.Native.AnrEnabled = true; | ||
options.Native.AnrEnabled = true; | ||
}); | ||
|
||
// Here's an example of adding custom scope information. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.WebHost.UseSentry(o => | ||
builder.WebHost.UseSentry(options => | ||
{ | ||
// A DSN is required. You can set it here, or in configuration, or in an environment variable. | ||
o.Dsn = "https://[email protected]/5428537"; | ||
options.Dsn = "https://[email protected]/5428537"; | ||
|
||
// Enable Sentry performance monitoring | ||
o.TracesSampleRate = 1.0; | ||
options.TracesSampleRate = 1.0; | ||
|
||
#if DEBUG | ||
// Log debug information about the Sentry SDK | ||
o.Debug = true; | ||
options.Debug = true; | ||
#endif | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,9 @@ | |
{ | ||
builder.UseSentry(host, options => | ||
{ | ||
options.Dsn = "https://[email protected]/5428537"; | ||
options.TracesSampleRate = 1.0; | ||
// options.Debug = true; | ||
options.Debug = true; | ||
}); | ||
}) | ||
.Build(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,9 @@ | |
|
||
SentrySdk.Init(options => | ||
{ | ||
// TODO: Configure a Sentry Data Source Name (DSN). | ||
// You can set here in code, or you can set it in the SENTRY_DSN environment variable. | ||
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/ | ||
// You can set it in the SENTRY_DSN environment variable, or you can set it in code here. | ||
options.Dsn = "... Your DSN ..."; | ||
options.Dsn = "https://[email protected]/5428537"; | ||
|
||
// When debug is enabled, the Sentry client will emit detailed debugging information to the console. | ||
// This might be helpful, or might interfere with the normal operation of your application. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.