Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/contributing/pages/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,33 @@ Attributes:

- `src` (string) - the URL of the Arcade embed

## AvailableSince

Display version availability information in a consistent format. Use this component to indicate when a feature, API, or configuration option became available in an SDK.

<AvailableSince version="10" />

```markdown {tabTitle:Basic Usage}
<AvailableSince version="10.17.0" />
```

Attributes:

- `version` (string) - required, the version number (e.g., "10", "8.5.0")

**When to use:**

- Use `AvailableSince` to indicate when a feature or option first became available
- For prominent minimum version requirements, use the [`VersionRequirement`](#versionrequirement) component instead

**Examples in the wild:**

The `AvailableSince` component is automatically used within:
- `SdkOption` component for configuration options
- `SdkApi` component for API methods

You can also use it directly in MDX content to indicate availability for features or entire sections.

## Expandable

Render an expandable section to provide additional information to users on demand.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If you want to add your own http/node-fetch instrumentation, you have to follow

### Custom HTTP Instrumentation

_Available since SDK version 8.35.0_
<AvailableSince version="8.35.0" />

You can add your own `@opentelemetry/instrumentation-http` instance in your OpenTelemetry setup. However, in this case, you need to disable span creation in Sentry's `httpIntegration`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To add spans that aren't active, you can create independent spans. This is usefu

### Setting an inactive span active (browser only)

_Available Since: `10.15.0`_
<AvailableSince version="10.15.0" />

In browser environments, you might run into use cases, where the callback-based span APIs are not sufficient.
In such cases (see example below), you can use `startInactiveSpan` to start an initially inactive span and then
Expand Down Expand Up @@ -231,7 +231,7 @@ Sentry maintains a [list of well-known span operations](https://develop.sentry.d

### Updating the Span Name

_Available since: v8.47.0_
<AvailableSince version="8.47.0" />

You can update the name of a span at any time:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: SentryCron Decorator
description: "Learn about Sentry's SentryCron decorator."
---

<Alert>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The info of @SentryCon or which SDK is actually not needed as the context of the page should indicate that already

The `@SentryCron` decorator is available from version `@sentry/nestjs` 8.16.0 and up.
</Alert>
<AvailableSince version="8.16.0" />

The NestJS SDK includes a `@SentryCron` decorator that can be used to augment the native NestJS `@Cron` decorator to
send check-ins to Sentry before and after each cron job run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: SentryTraced Decorator
description: "Learn about Sentry's SentryTraced decorator."
---

<Alert>
The `@SentryTraced` decorator is available from version `@sentry/nestjs` 8.15.0 and up.
</Alert>
<AvailableSince version="8.15.0" />

The NestJS SDK includes a `@SentryTraced` decorator that will create spans whenever the method it decorates is invoked.
This feature enables more granular performance monitoring and helps you gather detailed insights into the performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ The Sentry Nuxt SDK automatically instruments various Nitro server APIs to provi

## Server Middleware

<Alert>Available from version `@sentry/nuxt` 10.17.0 and up.</Alert>
<AvailableSince version="10.17.0" />

The Sentry Nuxt SDK automatically instruments [server middleware handlers](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-middleware) in addition to server event handlers. This includes the handler functions and their `onBeforeResponse` and `onRequest` callbacks.

## Cache

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
<AvailableSince version="10.21.0" />

The Sentry Nuxt SDK automatically instruments [cache APIs](https://nitro.build/guide/cache) for the following Nitro functions:

Expand All @@ -25,15 +25,15 @@ This provides spans in your transactions that represent cache operations and the

## Storage

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
<AvailableSince version="10.21.0" />

The Sentry Nuxt SDK automatically instruments [storage APIs](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-storage) (also known as KV storage) and common operations.

Keep in mind that only the storage mounts configured under `nitro.storage` in your `nuxt.config.ts` will be instrumented. Storage spans will show up in a similar way to [cache](#cache) spans since they both utilize the same underlying Nitro storage API.

## Database

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
<AvailableSince version="10.21.0" />

The Sentry Nuxt SDK automatically instruments Nitro's [database API](https://nitro.build/guide/database). This provides spans in your transactions that represent database query operations and their durations, enabling you to identify slow queries, track query frequency, and optimize your database interactions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ If you are using Sentry in your mobile app, read our [frequently asked questions

<Alert>

This options is available since SDK version `0.13.0`
<AvailableSince version="0.13.0" />

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The two services are now connected with your custom distributed tracing implemen

### Starting a New Trace

Available since SDK version `8.5.0`.
<AvailableSince version="8.5.0" />

In case the SDK's [default behavior](../#trace-duration) for the trace duration does not fit your needs, you can manually start a new trace that will no longer be connected to the current (distributed) trace.
This means that spans or errors collected by the SDK during this new trace will not be connected to spans or errors collected before or after this new trace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />_

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe

### Strict Trace Continuation

_Available since SDK version 10_
<AvailableSince version="10" />

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,
Expand Down
21 changes: 21 additions & 0 deletions src/components/availableSince.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
type AvailableSinceProps = {
version: string;
};

/**
* AvailableSince displays version availability information in a consistent format.
*
* Use this component to indicate when a feature, API, or option became available.
*
* @param version - The version number (e.g., "10.0.0", "8.5.0")
*/
export function AvailableSince({
version,
}: AvailableSinceProps) {
return (
<p className="italic">
Available since: <code>v{version.replace(/^v/, '')}</code>
</p>
);
}

7 changes: 2 additions & 5 deletions src/components/sdkApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {getCurrentPlatform} from 'sentry-docs/docTree';
import {serverContext} from 'sentry-docs/serverContext';
import {PlatformCategory} from 'sentry-docs/types';

import {AvailableSince} from './availableSince';
import {Expandable} from './expandable';
import {codeToJsx} from './highlightCode';
import {SdkDefinition} from './sdkDefinition';
Expand Down Expand Up @@ -54,11 +55,7 @@ export function SdkApi({
<div className="italic text-sm">Only available on Server</div>
)}
<pre className="mt-2 mb-2 text-sm">{codeToJsx(signature, lang)}</pre>
{availableSince && (
<p className="italic">
Available Since: <code>{availableSince}</code>
</p>
)}
{availableSince && <AvailableSince version={availableSince} />}
{parameters.length ? (
<Expandable title="Parameters">
<div className="space-y-3">
Expand Down
1 change: 1 addition & 0 deletions src/components/sdkOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {serverContext} from 'sentry-docs/serverContext';
import {PlatformCategory} from 'sentry-docs/types';

import {AvailableSince} from './availableSince';

Check failure on line 5 in src/components/sdkOption.tsx

View workflow job for this annotation

GitHub Actions / Lint

'AvailableSince' is declared but its value is never read.
import {SdkDefinition, SdkDefinitionTable} from './sdkDefinition';

type Props = {
Expand Down
2 changes: 2 additions & 0 deletions src/mdxComponents.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Alert} from './components/alert';
import {Arcade} from './components/arcade';
import {AvailableSince} from './components/availableSince';
import {Break} from './components/break';
import {Card} from './components/card';
import {CliChecksumTable} from './components/cliChecksumTable';
Expand Down Expand Up @@ -56,6 +57,7 @@ export function mdxComponents(
return {
Alert,
Arcade,
AvailableSince,
Break,
Card,
CliChecksumTable,
Expand Down
Loading