Skip to content

Commit

Permalink
Merge branch 'master' into cmanallen/flags-generic-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
cmanallen committed Dec 20, 2024
2 parents 3724ffd + 897e2ab commit a2ccb2e
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 73 deletions.
11 changes: 11 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
data-api="https://plausible.io/api/event"
src="https://plausible.io/js/script.tagged-events.js"
/>
<Script
async
src="https://widget.kapa.ai/kapa-widget.bundle.js"
data-website-id="cac7cc70-969e-4bc1-a968-55534a839be4"
data-button-hide // do not render kapa ai button
data-modal-override-open-class="kapa-ai-class" // all elements with this class will open the kapa ai modal
data-project-name="Sentry"
data-project-color="#6A5FC1"
data-project-logo="https://docs.sentry.io/_next/static/media/sentry-logo-dark.fc8e1eeb.svg"
data-font-family="var(--font-rubik)"
/>
</html>
);
}
4 changes: 2 additions & 2 deletions develop-docs/sdk/telemetry/traces/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ If no `tracesSampler` callback is used, the SDK fully inherits sampling decision

The random value is set according to the following rules:

1. When an SDK starts a new trace, `sample_rand` is always set to a random number in the range of `[0, 1]`. This explicitly includes traces that aren't sampled, as well as when the `tracesSampleRate` is set to `0.0` or `1.0`.
1. When an SDK starts a new trace, `sample_rand` is always set to a random number in the range of `[0, 1)` (including 0.0, excluding 1.0). This explicitly includes traces that aren't sampled, as well as when the `tracesSampleRate` is set to `0.0` or `1.0`.
2. It is _recommended_ to generate the random number deterministically using the trace ID as seed or source of randomness. The exact method by which the random number is created is implementation defined and may vary between SDK implementations. See 4. on why this behaviour is desirable.
3. On incoming traces, an SDK assumes the `sample_rand` value along with the rest of the DSC, overriding an existing value if needed.
4. If `sample_rand` is missing on an incoming trace, the SDK creates and from now on propagates a new random number on-the-fly, based on the following rules:
1. If `sample_rate` and `sampled` are propgated, create `sample_rand` so that it adheres to the invariant. This means, for a decision of `True` generate a random number in half-open range `[0, rate)` and for a decision of `False` generate a random number in range `[rate, 1]`.
2. If the sampling decision is missing, generate a random number in range of `[0, 1]`, like for a new trace.
2. If the sampling decision is missing, generate a random number in range of `[0, 1)` (including 0.0, excluding 1.0), like for a new trace.

The SDK should always use the stored random number (`sentry-sample_rand`) for sampling decisions and should no longer rely on `math.random()` or similar functions in tracing code:

Expand Down
2 changes: 0 additions & 2 deletions docs/platforms/android/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/explore/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets.

We recommend installing the SDK through our [Sentry Wizard](https://github.com/getsentry/sentry-wizard) by running the following command inside your project directory:

```bash
Expand Down
128 changes: 101 additions & 27 deletions docs/platforms/apple/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,36 @@ The support for [visionOS](https://developer.apple.com/visionos/) is currently e

## Features

<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/explore/profiling/).

</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/).

</PlatformSection>

Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.

## Install

<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
]}
/>
<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.
<OnboardingOptionButtons options={['error-monitoring', 'performance', 'profiling']}/>

</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

<OnboardingOptionButtons options={['error-monitoring', 'performance']}/>

</PlatformSection>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets.

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.

<PlatformSection notSupported={["apple.ios"]}>

Expand Down Expand Up @@ -72,8 +85,9 @@ If you prefer, you can also [set up the SDK manually](/platforms/apple/guides/io

To capture all errors, initialize the SDK as soon as possible, such as in your `AppDelegate` `application:didFinishLaunchingWithOptions` method:

<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "13-16"}}
```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "14-24"}}
import Sentry

func application(_ application: UIApplication,
Expand All @@ -88,22 +102,22 @@ func application(_ application: UIApplication,
options.tracesSampleRate = 1.0
}

// Manually call startProfiler and stopProfiler to profile any code that runs in between.
SentrySDK.startProfiler()
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
SentrySDK.startProfiler()

//
// ...anything here will be profiled...
//
//
// ...anything here will be profiled...
//

// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
SentrySDK.stopProfiler()
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
SentrySDK.stopProfiler()

return true
}
```

```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "12-15"}}
```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "13-23"}}
@import Sentry;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
Expand All @@ -117,16 +131,16 @@ func application(_ application: UIApplication,
options.tracesSampleRate = @1.0;
}];

// Manually call startProfiler and stopProfiler to profile any code that runs in between.
[SentrySDK startProfiler];
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
[SentrySDK startProfiler];

//
// ...anything here will be profiled...
//
//
// ...anything here will be profiled...
//

// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
[SentrySDK stopProfiler];
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
[SentrySDK stopProfiler];

return YES;
}
Expand All @@ -153,6 +167,66 @@ struct SwiftUIApp: App {
}
}
```
</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12"}}
import Sentry

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
}

return true
}
```

```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11"}}
@import Sentry;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.debug = YES; // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = @1.0;
}];

return YES;
}
```

```swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "9-12"}}
import Sentry

@main
struct SwiftUIApp: App {
init() {
SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
}
}
}
```

</PlatformSection>

## Verify

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV6BrowserTr

<Alert level="warning">

Make sure you call `Sentry.init`, **before** you wrap your `<Routes />` component or the `useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
To ensure proper routing instrumentation, initialize Sentry by calling `Sentry.init` **before**:
- Wrapping your `<Routes />` component
- Using `useRoutes`
- Using `createBrowserRouterV6`

</Alert>

Expand Down Expand Up @@ -56,7 +59,7 @@ Sentry.init({
});

const sentryCreateBrowserRouter =
Sentry.wrapCreateBrowserRouter(createBrowserRouter);
Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);

const router = sentryCreateBrowserRouter([
// your routes...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV7BrowserTr

<Alert level="warning">

Make sure you call `Sentry.init`, **before** you wrap your `<Routes />` component or the `useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
To ensure proper routing instrumentation, initialize Sentry by calling `Sentry.init` **before**:
- Wrapping your `<Routes />` component
- Using `useRoutes`
- Using `createBrowserRouterV7`

</Alert>

Expand Down
19 changes: 13 additions & 6 deletions docs/platforms/unreal/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ description: "Learn how to configure your SDK to tell Sentry about your environm
sidebar_order: 30
---

Environments tell you where an error occurred, whether that's in your production system, your staging server, or elsewhere.
It help you better filter issues, releases, and user feedback in the Issue Details page of sentry.io, which you learn more about in our [documentation that covers using environments](/product/sentry-basics/environments/).
Environments in Sentry let you know where an error occurred, (such as in production, staging server, or another location).
They make it easier to filter issues, releases, and user feedback on the Issue Details page, (which you can navigate to by clicking any issue on the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues/) page). To learn more, read our docs about [using environments](/product/sentry-basics/environments/).

Sentry automatically creates an environment when it receives an event with the `environment` parameter set.

By default, the SDK reports `Editor` when running inside the Unreal Engine Editor.
For shipping builds it'll use `Release` and in other configurations it'll use `FApp::GetBuildConfiguration()`
You can also set the default environment to `Release`, `Development`, or `Debug` in your build configuration or override the environment value programatically.
When running inside the Unreal Engine Editor, the SDK reports the environment as `Editor`. For shipping builds, it defaults to `Release`.
In other configurations it uses the `FApp::GetBuildConfiguration()`.
You can also set the default environment to `Release`, `Development`, or `Debug` in your build configuration, or override it programmatically.

```cpp
FConfigureSettingsDelegate SettingsDelegate;
Expand All @@ -29,4 +29,11 @@ USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem<USentrySubsystem
SentrySubsystem->InitializeWithSettings(SettingsDelegate);
```
Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes, can't be the string "None", or exceed 64 characters. You can't delete environments, but you can [hide](/product/sentry-basics/environments/#hidden-environments) them.
**Important things to note about environments:**
- Environment names are case-sensitive.
- Names cannot include new lines, spaces, or forward slashes.
- Certain strings, like "None", aren't allowed.
- The maximum length for an environment name is 64 characters.
- Environments can't be deleted, but can be [hidden](/product/sentry-basics/environments/#hidden-environments) if no longer needed.
3 changes: 2 additions & 1 deletion platform-includes/capture-error/go.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
To capture an event in Go, you can pass any struct implementing an `error` interface to `CaptureException()`. If you use a 3rd party library instead of native `errors` package, we'll do our best to extract a stack trace.
To capture an event in Go, you can pass any struct implementing an `error` interface to `CaptureException()`. If you use a 3rd party library instead of the native `errors` package and it implements the `Unwrap() error` or `Cause() error` method, we'll follow the chain of errors and extract the stack trace from the root cause.

The SDK is fully compatible with (but not limited to):

- `github.com/pkg/errors`
- `github.com/go-errors/errors`
- `github.com/pingcap/errors`
- `github.com/rotisserie/eris`

If there is an errors package that's not working out of the box, let us know!

Expand Down
2 changes: 1 addition & 1 deletion src/build/resolveOpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {DeRefedOpenAPI} from './open-api/types';

// SENTRY_API_SCHEMA_SHA is used in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
// DO NOT change variable name unless you change it in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
const SENTRY_API_SCHEMA_SHA = '5d9340a8aa68964aa58ac198b5cdad2c7aaca5e9';
const SENTRY_API_SCHEMA_SHA = 'a2907d92817e43576c371270ca6854b472c3509c';

const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';

Expand Down
8 changes: 2 additions & 6 deletions src/components/mobileMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ export function MobileMenu({pathname, searchPlatforms}: Props) {
</DropdownMenu.Item>

<DropdownMenu.Item className={styles.DropdownMenuItem} asChild>
<Link
href="https://docsbot.ai/chat/skFEy0qDC01GrRrZ7Crs/EPqsd8nu2XmKzWnd45tL"
target="_blank"
className="mt-2 md:hidden"
>
Ask A Bot
<Link href="#" className="mt-2 kapa-ai-class md:hidden">
Ask AI
</Link>
</DropdownMenu.Item>
<DropdownMenu.Separator className={styles.DropdownMenuSeparator} />
Expand Down
Loading

0 comments on commit a2ccb2e

Please sign in to comment.