Skip to content

Commit 5e145bf

Browse files
lforstAbhiPrasad
andauthored
feat: Add attribute for Next.js SSR functions (#54)
Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent 3b059ac commit 5e145bf

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

generated/attributes/sentry.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- [sentry.http.prefetch](#sentryhttpprefetch)
1111
- [sentry.idle_span_finish_reason](#sentryidle_span_finish_reason)
1212
- [sentry.module.\<key\>](#sentrymodulekey)
13+
- [sentry.nextjs.ssr.function.route](#sentrynextjsssrfunctionroute)
14+
- [sentry.nextjs.ssr.function.type](#sentrynextjsssrfunctiontype)
1315
- [sentry.op](#sentryop)
1416
- [sentry.origin](#sentryorigin)
1517
- [sentry.platform](#sentryplatform)
@@ -104,6 +106,30 @@ A module that was loaded in the process. The key is the name of the module.
104106
| Has dynamic suffix | Yes |
105107
| Example | `sentry.module.brianium/paratest='v7.7.0'` |
106108

109+
### sentry.nextjs.ssr.function.route
110+
111+
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.
112+
113+
| Property | Value |
114+
| --- | --- |
115+
| Type | `string` |
116+
| Has PII | false |
117+
| Exists in OpenTelemetry | No |
118+
| Example | `/posts/[id]/layout` |
119+
| Aliases | `sentry.nextjs.function.route` |
120+
121+
### sentry.nextjs.ssr.function.type
122+
123+
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.
124+
125+
| Property | Value |
126+
| --- | --- |
127+
| Type | `string` |
128+
| Has PII | false |
129+
| Exists in OpenTelemetry | No |
130+
| Example | `generateMetadata` |
131+
| Aliases | `sentry.nextjs.function.type` |
132+
107133
### sentry.op
108134

109135
The operation of a span.

javascript/sentry-conventions/src/attributes.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,6 +3872,50 @@ export const SENTRY_MODULE_KEY = 'sentry.module.<key>';
38723872
*/
38733873
export type SENTRY_MODULE_KEY_TYPE = string;
38743874

3875+
// Path: model/attributes/sentry/sentry__nextjs__ssr__function__route.json
3876+
3877+
/**
3878+
* 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`
3879+
*
3880+
* Attribute Value Type: `string` {@link SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE}
3881+
*
3882+
* Contains PII: false
3883+
*
3884+
* Attribute defined in OTEL: No
3885+
*
3886+
* Aliases: {@link SENTRY_NEXTJS_FUNCTION_ROUTE} `sentry.nextjs.function.route`
3887+
*
3888+
* @example "/posts/[id]/layout"
3889+
*/
3890+
export const SENTRY_NEXTJS_SSR_FUNCTION_ROUTE = 'sentry.nextjs.ssr.function.route';
3891+
3892+
/**
3893+
* Type for {@link SENTRY_NEXTJS_SSR_FUNCTION_ROUTE} sentry.nextjs.ssr.function.route
3894+
*/
3895+
export type SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE = string;
3896+
3897+
// Path: model/attributes/sentry/sentry__nextjs__ssr__function__type.json
3898+
3899+
/**
3900+
* 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`
3901+
*
3902+
* Attribute Value Type: `string` {@link SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE}
3903+
*
3904+
* Contains PII: false
3905+
*
3906+
* Attribute defined in OTEL: No
3907+
*
3908+
* Aliases: {@link SENTRY_NEXTJS_FUNCTION_TYPE} `sentry.nextjs.function.type`
3909+
*
3910+
* @example "generateMetadata"
3911+
*/
3912+
export const SENTRY_NEXTJS_SSR_FUNCTION_TYPE = 'sentry.nextjs.ssr.function.type';
3913+
3914+
/**
3915+
* Type for {@link SENTRY_NEXTJS_SSR_FUNCTION_TYPE} sentry.nextjs.ssr.function.type
3916+
*/
3917+
export type SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE = string;
3918+
38753919
// Path: model/attributes/sentry/sentry__op.json
38763920

38773921
/**
@@ -4925,6 +4969,8 @@ export type Attributes = {
49254969
[SENTRY_HTTP_PREFETCH]?: SENTRY_HTTP_PREFETCH_TYPE;
49264970
[SENTRY_IDLE_SPAN_FINISH_REASON]?: SENTRY_IDLE_SPAN_FINISH_REASON_TYPE;
49274971
[SENTRY_MODULE_KEY]?: SENTRY_MODULE_KEY_TYPE;
4972+
[SENTRY_NEXTJS_SSR_FUNCTION_ROUTE]?: SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE;
4973+
[SENTRY_NEXTJS_SSR_FUNCTION_TYPE]?: SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE;
49284974
[SENTRY_OP]?: SENTRY_OP_TYPE;
49294975
[SENTRY_ORIGIN]?: SENTRY_ORIGIN_TYPE;
49304976
[SENTRY_PLATFORM]?: SENTRY_PLATFORM_TYPE;
@@ -5154,6 +5200,8 @@ export type FullAttributes = {
51545200
[SENTRY_HTTP_PREFETCH]?: SENTRY_HTTP_PREFETCH_TYPE;
51555201
[SENTRY_IDLE_SPAN_FINISH_REASON]?: SENTRY_IDLE_SPAN_FINISH_REASON_TYPE;
51565202
[SENTRY_MODULE_KEY]?: SENTRY_MODULE_KEY_TYPE;
5203+
[SENTRY_NEXTJS_SSR_FUNCTION_ROUTE]?: SENTRY_NEXTJS_SSR_FUNCTION_ROUTE_TYPE;
5204+
[SENTRY_NEXTJS_SSR_FUNCTION_TYPE]?: SENTRY_NEXTJS_SSR_FUNCTION_TYPE_TYPE;
51575205
[SENTRY_OP]?: SENTRY_OP_TYPE;
51585206
[SENTRY_ORIGIN]?: SENTRY_ORIGIN_TYPE;
51595207
[SENTRY_PLATFORM]?: SENTRY_PLATFORM_TYPE;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"key": "sentry.nextjs.ssr.function.route",
3+
"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.",
4+
"type": "string",
5+
"pii": {
6+
"key": "false"
7+
},
8+
"is_in_otel": false,
9+
"example": "/posts/[id]/layout",
10+
"alias": ["sentry.nextjs.function.route"],
11+
"sdks": ["javascript"]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"key": "sentry.nextjs.ssr.function.type",
3+
"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.",
4+
"type": "string",
5+
"pii": {
6+
"key": "false"
7+
},
8+
"is_in_otel": false,
9+
"example": "generateMetadata",
10+
"alias": ["sentry.nextjs.function.type"],
11+
"sdks": ["javascript"]
12+
}

0 commit comments

Comments
 (0)