Skip to content

Commit

Permalink
fix: update remaining 404s (#10853)
Browse files Browse the repository at this point in the history
* docs: add section for custom otel sampler (#10843)

* fix: remaining 404s
  • Loading branch information
chargome committed Jul 25, 2024
1 parent d9b7584 commit 2416a71
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ description: "Learn about the experimental features available for Sentry's Apple
Do you want to try some new experimental features? On the latest version of the Apple SDK, you can:

- Enable <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#time-to-full-display">Time to Full Display (TTFD)</PlatformLink> to gain insight into how long it takes your view controller to launch and load all of its content.
<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>
- Enable <PlatformLink to="/profiling/#enable-launch-profiling">App Launch Profiling</PlatformLink> to get detailed profiles for your app launches.
</PlatformSection>
- If you use Swift concurrency, stitch together stack traces of your async code with the `swiftAsyncStacktraces` option. Note that you can enable this in your Objective-C project, but only async code written in Swift will be stitched together.


<Note>
Experimental features are still a work-in-progress and may have bugs. We recognize the irony.
Experimental features are still a work-in-progress and may have bugs. We
recognize the irony.
</Note>

```swift {tabTitle:Swift}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,72 @@ tracer.startActiveSpan("span name", () => {
```
You can also use any other tracer; all OpenTelemetry spans will be picked up by Sentry automatically.
## Using a Custom Sampler
We recommend using `SentrySampler` as this will ensure the correct subset of traces is sent to Sentry depending on your `tracesSampleRate`, as well as that all other Sentry features like trace propagation work as expected.
If you however need to use your own sampler then make sure to wrap your `SamplingResult` with our `wrapSamplingDecision` method:
```js {filename: custom-sampler.js}
const { wrapSamplingDecision } = require("@sentry/opentelemetry");

// implements Sampler from "@opentelemetry/sdk-trace-node"
class CustomSampler {
shouldSample(
context,
_traceId,
_spanName,
_spanKind,
attributes,
_links
) {
const decision = yourDecisionLogic();

// wrap the result
return wrapSamplingDecision({
decision,
context,
spanAttributes: attributes,
});
}

toString() {
return CustomSampler.name;
}
}

module.exports = CustomSampler;

```
Now use your sampler in your `TraceProvider`:
```js {filename: instrument.js}
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const Sentry = require("@sentry/node");
const {
SentrySpanProcessor,
SentryPropagator,
SentrySampler,
} = require("@sentry/opentelemetry");
const CustomSampler = require("./custom-sampler");

const sentryClient = Sentry.init({
dsn: "__DSN__",
skipOpenTelemetrySetup: true,

// By defining any sample rate,
// tracing intergations will be added by default
tracesSampleRate: 0
});


const provider = new NodeTracerProvider({
sampler: new CustomSampler(sentryClient),
});

// ...rest of your setup

// Validate that the setup is correct
Sentry.validateOpenTelemetrySetup();
```
2 changes: 1 addition & 1 deletion docs/platforms/javascript/guides/aws-lambda/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Depending on your setup, there are different ways to install and use Sentry in y
- [Install the Sentry AWS Lambda Layer](./install/cjs-layer) if your Lambda functions are written in CommonJS (CJS) using `require` syntax.
- [Install the Sentry AWS NPM package](./install/esm-npm) if your Lambda functions are running in EcmaScript Modules (ESM) using `import` syntax.

If you're not sure which installation method to use or want an overview of all available options to use Sentry in your Lambda functions, read the [installation methods overview](/guides/aws-lambda/install).
If you're not sure which installation method to use or want an overview of all available options to use Sentry in your Lambda functions, read the [installation methods overview](./install).

## Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For detailed information about which data can be set, see the [Cache Module deve

## Custom Instrumentation

If you're using anything other than our <PlatformLink to="/guides/laravel/">Laravel SDK</PlatformLink>, you'll need to manually instrument the [Cache Module](https://sentry.io/orgredirect/organizations/:orgslug/performance/caches/) by following the steps below.
If you're using anything other than our [Laravel SDK](/platforms/php/guides/laravel/), you'll need to manually instrument the [Cache Module](https://sentry.io/orgredirect/organizations/:orgslug/performance/caches/) by following the steps below.

### Add Span When Putting Data Into the Cache

Expand Down
2 changes: 1 addition & 1 deletion docs/product/issues/issue-details/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ It's the most important piece of information that the Sentry grouping algorithm

You can set your own <PlatformLink to="/enriching-events/breadcrumbs/">breadcrumbs</PlatformLink> to make them more useful for debugging.

If you’ve enabled [Session Replay](/product/explore/session-replay/), you’ll see a replay preview under Breadcrumbs if there’s one associated with the event you’re viewing. Replays can be associated with both frontend and [backend errors](/product/explore/session-replay/getting-started#replays-for-backend-errors) (as long as distrubted tracing is set up). Clicking on the replay preview will lead you to the [Replay Details](/product/explore/session-replay/replay-details/) page.
If you’ve enabled [Session Replay](/product/explore/session-replay/), you’ll see a replay preview under Breadcrumbs if there’s one associated with the event you’re viewing. Replays can be associated with both frontend and [backend errors](/product/explore/session-replay/getting-started#replays-for-backend-errors) (as long as distrubted tracing is set up). Clicking on the replay preview will lead you to the [Replay Details](/product/explore/session-replay/web/replay-details/) page.

## Tags

Expand Down
2 changes: 1 addition & 1 deletion docs/product/performance/transaction-summary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Spans with the same operation and description are grouped together into a single

### Replays

The Replays tab displays a list of replays where the transaction you’re viewing had occurred. Go directly to [Replay Details](/product/explore/session-replay/replay-details/) for any replay and see how a slow transaction impacted the user experience. Note: you must have [Session Replay](/product/explore/session-replay/) enabled to see this tab.
The Replays tab displays a list of replays where the transaction you’re viewing had occurred. Go directly to [Replay Details](/product/explore/session-replay/web/replay-details/) for any replay and see how a slow transaction impacted the user experience. Note: you must have [Session Replay](/product/explore/session-replay/) enabled to see this tab.

## Additional Actions

Expand Down

0 comments on commit 2416a71

Please sign in to comment.