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
120 changes: 120 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3946,6 +3946,24 @@ export const FRAMES_FROZEN = 'frames.frozen';
*/
export type FRAMES_FROZEN_TYPE = number;

// Path: model/attributes/frames_frozen_rate.json

/**
* The rate of frozen frames, or `app_vitals.frames.frozen.count` divided by `app_vitals.frames.total.count`. `frames_frozen_rate`
*
* Attribute Value Type: `number` {@link FRAMES_FROZEN_RATE_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*/
export const FRAMES_FROZEN_RATE = 'frames_frozen_rate';

/**
* Type for {@link FRAMES_FROZEN_RATE} frames_frozen_rate
*/
export type FRAMES_FROZEN_RATE_TYPE = number;

// Path: model/attributes/frames/frames__slow.json

/**
Expand All @@ -3969,6 +3987,24 @@ export const FRAMES_SLOW = 'frames.slow';
*/
export type FRAMES_SLOW_TYPE = number;

// Path: model/attributes/frames_slow_rate.json

/**
* The rate of slow frames, or `app_vitals.frames.slow.count` divided by `app_vitals.frames.total.count`. `frames_slow_rate`
*
* Attribute Value Type: `number` {@link FRAMES_SLOW_RATE_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*/
export const FRAMES_SLOW_RATE = 'frames_slow_rate';

/**
* Type for {@link FRAMES_SLOW_RATE} frames_slow_rate
*/
export type FRAMES_SLOW_RATE_TYPE = number;

// Path: model/attributes/frames/frames__total.json

/**
Expand Down Expand Up @@ -10286,6 +10322,42 @@ export const SERVICE_VERSION = 'service.version';
*/
export type SERVICE_VERSION_TYPE = string;

// Path: model/attributes/stall_percentage.json

/**
* The fraction of time the app was stalled. Only applies to React Native. `stall_percentage`
*
* Attribute Value Type: `number` {@link STALL_PERCENTAGE_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*/
export const STALL_PERCENTAGE = 'stall_percentage';

/**
* Type for {@link STALL_PERCENTAGE} stall_percentage
*/
export type STALL_PERCENTAGE_TYPE = number;

// Path: model/attributes/stall_total_time.json

/**
* The combined duration of all stalls in milliseconds. Only applies to React Native. `stall_total_time`
*
* Attribute Value Type: `number` {@link STALL_TOTAL_TIME_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*/
export const STALL_TOTAL_TIME = 'stall_total_time';

/**
* Type for {@link STALL_TOTAL_TIME} stall_total_time
*/
export type STALL_TOTAL_TIME_TYPE = number;

// Path: model/attributes/thread/thread__id.json

/**
Expand Down Expand Up @@ -12141,7 +12213,9 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
[FP]: 'double',
[FRAMES_DELAY]: 'integer',
[FRAMES_FROZEN]: 'integer',
[FRAMES_FROZEN_RATE]: 'double',
[FRAMES_SLOW]: 'integer',
[FRAMES_SLOW_RATE]: 'double',
[FRAMES_TOTAL]: 'integer',
[FS_ERROR]: 'string',
[GEN_AI_AGENT_NAME]: 'string',
Expand Down Expand Up @@ -12444,6 +12518,8 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
[SERVER_PORT]: 'integer',
[SERVICE_NAME]: 'string',
[SERVICE_VERSION]: 'string',
[STALL_PERCENTAGE]: 'double',
[STALL_TOTAL_TIME]: 'integer',
[THREAD_ID]: 'integer',
[THREAD_NAME]: 'string',
[TIMBER_TAG]: 'string',
Expand Down Expand Up @@ -12711,7 +12787,9 @@ export type AttributeName =
| typeof FP
| typeof FRAMES_DELAY
| typeof FRAMES_FROZEN
| typeof FRAMES_FROZEN_RATE
| typeof FRAMES_SLOW
| typeof FRAMES_SLOW_RATE
| typeof FRAMES_TOTAL
| typeof FS_ERROR
| typeof GEN_AI_AGENT_NAME
Expand Down Expand Up @@ -13014,6 +13092,8 @@ export type AttributeName =
| typeof SERVER_PORT
| typeof SERVICE_NAME
| typeof SERVICE_VERSION
| typeof STALL_PERCENTAGE
| typeof STALL_TOTAL_TIME
| typeof THREAD_ID
| typeof THREAD_NAME
| typeof TIMBER_TAG
Expand Down Expand Up @@ -15497,6 +15577,15 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
{ version: '0.0.0' },
],
},
[FRAMES_FROZEN_RATE]: {
brief: 'The rate of frozen frames, or `app_vitals.frames.frozen.count` divided by `app_vitals.frames.total.count`.',
type: 'double',
pii: {
isPii: 'maybe',
},
isInOtel: false,
changelog: [{ version: 'next', prs: [362], description: 'Added frames_frozen_rate attribute' }],
},
[FRAMES_SLOW]: {
brief: 'The number of slow frames rendered during the lifetime of the span.',
type: 'integer',
Expand All @@ -15517,6 +15606,15 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
{ version: '0.0.0' },
],
},
[FRAMES_SLOW_RATE]: {
brief: 'The rate of slow frames, or `app_vitals.frames.slow.count` divided by `app_vitals.frames.total.count`.',
type: 'double',
pii: {
isPii: 'maybe',
},
isInOtel: false,
changelog: [{ version: 'next', prs: [362], description: 'Added frames_slow_rate attribute' }],
},
[FRAMES_TOTAL]: {
brief: 'The number of total frames rendered during the lifetime of the span.',
type: 'integer',
Expand Down Expand Up @@ -19193,6 +19291,24 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
aliases: [SENTRY_RELEASE],
changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }],
},
[STALL_PERCENTAGE]: {
brief: 'The fraction of time the app was stalled. Only applies to React Native.',
type: 'double',
pii: {
isPii: 'maybe',
},
isInOtel: false,
changelog: [{ version: 'next', prs: [362], description: 'Added stall_percentage attribute' }],
},
[STALL_TOTAL_TIME]: {
brief: 'The combined duration of all stalls in milliseconds. Only applies to React Native.',
type: 'integer',
pii: {
isPii: 'maybe',
},
isInOtel: false,
changelog: [{ version: 'next', prs: [362], description: 'Added stall_total_time attribute' }],
},
[THREAD_ID]: {
brief: 'Current “managed” thread ID.',
type: 'integer',
Expand Down Expand Up @@ -20257,7 +20373,9 @@ export type Attributes = {
[FP]?: FP_TYPE;
[FRAMES_DELAY]?: FRAMES_DELAY_TYPE;
[FRAMES_FROZEN]?: FRAMES_FROZEN_TYPE;
[FRAMES_FROZEN_RATE]?: FRAMES_FROZEN_RATE_TYPE;
[FRAMES_SLOW]?: FRAMES_SLOW_TYPE;
[FRAMES_SLOW_RATE]?: FRAMES_SLOW_RATE_TYPE;
[FRAMES_TOTAL]?: FRAMES_TOTAL_TYPE;
[FS_ERROR]?: FS_ERROR_TYPE;
[GEN_AI_AGENT_NAME]?: GEN_AI_AGENT_NAME_TYPE;
Expand Down Expand Up @@ -20560,6 +20678,8 @@ export type Attributes = {
[SERVER_PORT]?: SERVER_PORT_TYPE;
[SERVICE_NAME]?: SERVICE_NAME_TYPE;
[SERVICE_VERSION]?: SERVICE_VERSION_TYPE;
[STALL_PERCENTAGE]?: STALL_PERCENTAGE_TYPE;
[STALL_TOTAL_TIME]?: STALL_TOTAL_TIME_TYPE;
[THREAD_ID]?: THREAD_ID_TYPE;
[THREAD_NAME]?: THREAD_NAME_TYPE;
[TIMBER_TAG]?: TIMBER_TAG_TYPE;
Expand Down
16 changes: 16 additions & 0 deletions model/attributes/frames_frozen_rate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"key": "frames_frozen_rate",
"brief": "The rate of frozen frames, or `app_vitals.frames.frozen.count` divided by `app_vitals.frames.total.count`.",
"type": "double",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"changelog": [
{
"version": "next",
"prs": [362],
"description": "Added frames_frozen_rate attribute"
}
]
}
16 changes: 16 additions & 0 deletions model/attributes/frames_slow_rate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"key": "frames_slow_rate",
"brief": "The rate of slow frames, or `app_vitals.frames.slow.count` divided by `app_vitals.frames.total.count`.",
"type": "double",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"changelog": [
{
"version": "next",
"prs": [362],
"description": "Added frames_slow_rate attribute"
}
]
}
16 changes: 16 additions & 0 deletions model/attributes/stall_percentage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"key": "stall_percentage",
"brief": "The fraction of time the app was stalled. Only applies to React Native.",
"type": "double",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"changelog": [
{
"version": "next",
"prs": [362],
"description": "Added stall_percentage attribute"
}
]
}
16 changes: 16 additions & 0 deletions model/attributes/stall_total_time.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"key": "stall_total_time",
"brief": "The combined duration of all stalls in milliseconds. Only applies to React Native.",
"type": "integer",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

stall_total_time type should be double, not integer

High Severity

stall_total_time is typed as integer, but real-world values from the React Native SDK have sub-millisecond precision (e.g., 247.875). All other time-duration measurements in this repo (time_to_full_display, fcp, ttfb, etc.) use double. Using integer here will truncate fractional millisecond values when Relay converts measurements to attributes, causing silent data loss.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7a0b3e4. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is correct. The RN SDK calls the JS SDK's timestampInSeconds * 1000 which returns the current time stamp with sub-millisecond precision. IIRC Relay treats integer and double attributes in the same way but it's probably safer to declare this attribute as type double. WDYT?

"pii": {
"key": "maybe"
},
"is_in_otel": false,
"changelog": [
{
"version": "next",
"prs": [362],
"description": "Added stall_total_time attribute"
}
]
}
Loading
Loading