Skip to content

feat: Add attribute for Next.js SSR functions #54

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

Merged
merged 2 commits into from
May 8, 2025
Merged
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
26 changes: 26 additions & 0 deletions generated/attributes/sentry.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [sentry.http.prefetch](#sentryhttpprefetch)
- [sentry.idle_span_finish_reason](#sentryidle_span_finish_reason)
- [sentry.module.\<key\>](#sentrymodulekey)
- [sentry.nextjs.ssr.function.route](#sentrynextjsssrfunctionroute)
- [sentry.nextjs.ssr.function.type](#sentrynextjsssrfunctiontype)
- [sentry.op](#sentryop)
- [sentry.origin](#sentryorigin)
- [sentry.platform](#sentryplatform)
Expand Down Expand Up @@ -104,6 +106,30 @@ A module that was loaded in the process. The key is the name of the module.
| Has dynamic suffix | Yes |
| Example | `sentry.module.brianium/paratest='v7.7.0'` |

### sentry.nextjs.ssr.function.route

A parameterized route for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions when the file location of the function is known.

| Property | Value |
| --- | --- |
| Type | `string` |
| Has PII | false |
| Exists in OpenTelemetry | No |
| Example | `/posts/[id]/layout` |
| Aliases | `sentry.nextjs.function.route` |

### sentry.nextjs.ssr.function.type

A descriptor for a for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions.

| Property | Value |
| --- | --- |
| Type | `string` |
| Has PII | false |
| Exists in OpenTelemetry | No |
| Example | `generateMetadata` |
| Aliases | `sentry.nextjs.function.type` |

### sentry.op

The operation of a span.
Expand Down
48 changes: 48 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3872,6 +3872,50 @@ export const SENTRY_MODULE_KEY = 'sentry.module.<key>';
*/
export type SENTRY_MODULE_KEY_TYPE = string;

// Path: model/attributes/sentry/sentry__nextjs__ssr__function__route.json

/**
* A parameterized route for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions when the file location of the function is known. `sentry.nextjs.ssr.function.route`
*
* Attribute Value Type: `string` {@link SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE}
*
* Contains PII: false
*
* Attribute defined in OTEL: No
*
* Aliases: {@link SENTRY_NEXTJS_FUNCTION_ROUTE} `sentry.nextjs.function.route`
*
* @example "/posts/[id]/layout"
*/
export const SENTRY_NEXTJS_SSR_FUNCTION_ROUTE = 'sentry.nextjs.ssr.function.route';

/**
* Type for {@link SENTRY_NEXTJS_SSR_FUNCTION_ROUTE} sentry.nextjs.ssr.function.route
*/
export type SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE = string;

// Path: model/attributes/sentry/sentry__nextjs__ssr__function__type.json

/**
* A descriptor for a for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions. `sentry.nextjs.ssr.function.type`
*
* Attribute Value Type: `string` {@link SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE}
*
* Contains PII: false
*
* Attribute defined in OTEL: No
*
* Aliases: {@link SENTRY_NEXTJS_FUNCTION_TYPE} `sentry.nextjs.function.type`
*
* @example "generateMetadata"
*/
export const SENTRY_NEXTJS_SSR_FUNCTION_TYPE = 'sentry.nextjs.ssr.function.type';

/**
* Type for {@link SENTRY_NEXTJS_SSR_FUNCTION_TYPE} sentry.nextjs.ssr.function.type
*/
export type SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE = string;

// Path: model/attributes/sentry/sentry__op.json

/**
Expand Down Expand Up @@ -4925,6 +4969,8 @@ export type Attributes = {
[SENTRY_HTTP_PREFETCH]?: SENTRY_HTTP_PREFETCH_TYPE;
[SENTRY_IDLE_SPAN_FINISH_REASON]?: SENTRY_IDLE_SPAN_FINISH_REASON_TYPE;
[SENTRY_MODULE_KEY]?: SENTRY_MODULE_KEY_TYPE;
[SENTRY_NEXTJS_SSR_FUNCTION_ROUTE]?: SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE;
[SENTRY_NEXTJS_SSR_FUNCTION_TYPE]?: SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE;
[SENTRY_OP]?: SENTRY_OP_TYPE;
[SENTRY_ORIGIN]?: SENTRY_ORIGIN_TYPE;
[SENTRY_PLATFORM]?: SENTRY_PLATFORM_TYPE;
Expand Down Expand Up @@ -5154,6 +5200,8 @@ export type FullAttributes = {
[SENTRY_HTTP_PREFETCH]?: SENTRY_HTTP_PREFETCH_TYPE;
[SENTRY_IDLE_SPAN_FINISH_REASON]?: SENTRY_IDLE_SPAN_FINISH_REASON_TYPE;
[SENTRY_MODULE_KEY]?: SENTRY_MODULE_KEY_TYPE;
[SENTRY_NEXTJS_SSR_FUNCTION_ROUTE]?: SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE;
[SENTRY_NEXTJS_SSR_FUNCTION_TYPE]?: SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE;
[SENTRY_OP]?: SENTRY_OP_TYPE;
[SENTRY_ORIGIN]?: SENTRY_ORIGIN_TYPE;
[SENTRY_PLATFORM]?: SENTRY_PLATFORM_TYPE;
Expand Down
12 changes: 12 additions & 0 deletions model/attributes/sentry/sentry__nextjs__ssr__function__route.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"key": "sentry.nextjs.ssr.function.route",
"brief": "A parameterized route for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions when the file location of the function is known.",
"type": "string",
"pii": {
"key": "false"
},
"is_in_otel": false,
"example": "/posts/[id]/layout",
"alias": ["sentry.nextjs.function.route"],
"sdks": ["javascript"]
}
12 changes: 12 additions & 0 deletions model/attributes/sentry/sentry__nextjs__ssr__function__type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"key": "sentry.nextjs.ssr.function.type",
"brief": "A descriptor for a for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions.",
"type": "string",
"pii": {
"key": "false"
},
"is_in_otel": false,
"example": "generateMetadata",
"alias": ["sentry.nextjs.function.type"],
"sdks": ["javascript"]
}