Skip to content

Commit be6dca4

Browse files
authored
feat(attributes): Add ui.element.* attributes (#284)
* feat(attributes): Add `ui.element.*` attributes * fix incorrect sdk identifier
1 parent 538bd4a commit be6dca4

11 files changed

Lines changed: 696 additions & 0 deletions

javascript/sentry-conventions/src/attributes.ts

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8336,6 +8336,186 @@ export const UI_CONTRIBUTES_TO_TTID = 'ui.contributes_to_ttid';
83368336
*/
83378337
export type UI_CONTRIBUTES_TO_TTID_TYPE = boolean;
83388338

8339+
// Path: model/attributes/ui/ui__element__height.json
8340+
8341+
/**
8342+
* The height of the UI element (for Html in pixels) `ui.element.height`
8343+
*
8344+
* Attribute Value Type: `number` {@link UI_ELEMENT_HEIGHT_TYPE}
8345+
*
8346+
* Contains PII: maybe
8347+
*
8348+
* Attribute defined in OTEL: No
8349+
*
8350+
* @example 256
8351+
*/
8352+
export const UI_ELEMENT_HEIGHT = 'ui.element.height';
8353+
8354+
/**
8355+
* Type for {@link UI_ELEMENT_HEIGHT} ui.element.height
8356+
*/
8357+
export type UI_ELEMENT_HEIGHT_TYPE = number;
8358+
8359+
// Path: model/attributes/ui/ui__element__id.json
8360+
8361+
/**
8362+
* The id of the UI element `ui.element.id`
8363+
*
8364+
* Attribute Value Type: `string` {@link UI_ELEMENT_ID_TYPE}
8365+
*
8366+
* Contains PII: maybe
8367+
*
8368+
* Attribute defined in OTEL: No
8369+
*
8370+
* @example "btn-login"
8371+
*/
8372+
export const UI_ELEMENT_ID = 'ui.element.id';
8373+
8374+
/**
8375+
* Type for {@link UI_ELEMENT_ID} ui.element.id
8376+
*/
8377+
export type UI_ELEMENT_ID_TYPE = string;
8378+
8379+
// Path: model/attributes/ui/ui__element__identifier.json
8380+
8381+
/**
8382+
* The identifier used to measure the UI element timing `ui.element.identifier`
8383+
*
8384+
* Attribute Value Type: `string` {@link UI_ELEMENT_IDENTIFIER_TYPE}
8385+
*
8386+
* Contains PII: maybe
8387+
*
8388+
* Attribute defined in OTEL: No
8389+
*
8390+
* @example "heroImage"
8391+
*/
8392+
export const UI_ELEMENT_IDENTIFIER = 'ui.element.identifier';
8393+
8394+
/**
8395+
* Type for {@link UI_ELEMENT_IDENTIFIER} ui.element.identifier
8396+
*/
8397+
export type UI_ELEMENT_IDENTIFIER_TYPE = string;
8398+
8399+
// Path: model/attributes/ui/ui__element__load_time.json
8400+
8401+
/**
8402+
* The loading time of a UI element (from time origin to finished loading) `ui.element.load_time`
8403+
*
8404+
* Attribute Value Type: `number` {@link UI_ELEMENT_LOAD_TIME_TYPE}
8405+
*
8406+
* Contains PII: maybe
8407+
*
8408+
* Attribute defined in OTEL: No
8409+
*
8410+
* @example 998.2234
8411+
*/
8412+
export const UI_ELEMENT_LOAD_TIME = 'ui.element.load_time';
8413+
8414+
/**
8415+
* Type for {@link UI_ELEMENT_LOAD_TIME} ui.element.load_time
8416+
*/
8417+
export type UI_ELEMENT_LOAD_TIME_TYPE = number;
8418+
8419+
// Path: model/attributes/ui/ui__element__paint_type.json
8420+
8421+
/**
8422+
* The type of element paint. Can either be 'image-paint' or 'text-paint' `ui.element.paint_type`
8423+
*
8424+
* Attribute Value Type: `string` {@link UI_ELEMENT_PAINT_TYPE_TYPE}
8425+
*
8426+
* Contains PII: maybe
8427+
*
8428+
* Attribute defined in OTEL: No
8429+
*
8430+
* @example "image-paint"
8431+
*/
8432+
export const UI_ELEMENT_PAINT_TYPE = 'ui.element.paint_type';
8433+
8434+
/**
8435+
* Type for {@link UI_ELEMENT_PAINT_TYPE} ui.element.paint_type
8436+
*/
8437+
export type UI_ELEMENT_PAINT_TYPE_TYPE = string;
8438+
8439+
// Path: model/attributes/ui/ui__element__render_time.json
8440+
8441+
/**
8442+
* The rendering time of the UI element (from time origin to finished rendering) `ui.element.render_time`
8443+
*
8444+
* Attribute Value Type: `number` {@link UI_ELEMENT_RENDER_TIME_TYPE}
8445+
*
8446+
* Contains PII: maybe
8447+
*
8448+
* Attribute defined in OTEL: No
8449+
*
8450+
* @example 1023.1124
8451+
*/
8452+
export const UI_ELEMENT_RENDER_TIME = 'ui.element.render_time';
8453+
8454+
/**
8455+
* Type for {@link UI_ELEMENT_RENDER_TIME} ui.element.render_time
8456+
*/
8457+
export type UI_ELEMENT_RENDER_TIME_TYPE = number;
8458+
8459+
// Path: model/attributes/ui/ui__element__type.json
8460+
8461+
/**
8462+
* type of the UI element `ui.element.type`
8463+
*
8464+
* Attribute Value Type: `string` {@link UI_ELEMENT_TYPE_TYPE}
8465+
*
8466+
* Contains PII: maybe
8467+
*
8468+
* Attribute defined in OTEL: No
8469+
*
8470+
* @example "img"
8471+
*/
8472+
export const UI_ELEMENT_TYPE = 'ui.element.type';
8473+
8474+
/**
8475+
* Type for {@link UI_ELEMENT_TYPE} ui.element.type
8476+
*/
8477+
export type UI_ELEMENT_TYPE_TYPE = string;
8478+
8479+
// Path: model/attributes/ui/ui__element__url.json
8480+
8481+
/**
8482+
* The URL of the UI element (e.g. an img src) `ui.element.url`
8483+
*
8484+
* Attribute Value Type: `string` {@link UI_ELEMENT_URL_TYPE}
8485+
*
8486+
* Contains PII: maybe
8487+
*
8488+
* Attribute defined in OTEL: No
8489+
*
8490+
* @example "https://assets.myapp.com/hero.png"
8491+
*/
8492+
export const UI_ELEMENT_URL = 'ui.element.url';
8493+
8494+
/**
8495+
* Type for {@link UI_ELEMENT_URL} ui.element.url
8496+
*/
8497+
export type UI_ELEMENT_URL_TYPE = string;
8498+
8499+
// Path: model/attributes/ui/ui__element__width.json
8500+
8501+
/**
8502+
* The width of the UI element (for HTML in pixels) `ui.element.width`
8503+
*
8504+
* Attribute Value Type: `number` {@link UI_ELEMENT_WIDTH_TYPE}
8505+
*
8506+
* Contains PII: maybe
8507+
*
8508+
* Attribute defined in OTEL: No
8509+
*
8510+
* @example 512
8511+
*/
8512+
export const UI_ELEMENT_WIDTH = 'ui.element.width';
8513+
8514+
/**
8515+
* Type for {@link UI_ELEMENT_WIDTH} ui.element.width
8516+
*/
8517+
export type UI_ELEMENT_WIDTH_TYPE = number;
8518+
83398519
// Path: model/attributes/url.json
83408520

83418521
/**
@@ -9947,6 +10127,15 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
994710127
[UI_COMPONENT_NAME]: 'string',
994810128
[UI_CONTRIBUTES_TO_TTFD]: 'boolean',
994910129
[UI_CONTRIBUTES_TO_TTID]: 'boolean',
10130+
[UI_ELEMENT_HEIGHT]: 'integer',
10131+
[UI_ELEMENT_ID]: 'string',
10132+
[UI_ELEMENT_IDENTIFIER]: 'string',
10133+
[UI_ELEMENT_LOAD_TIME]: 'double',
10134+
[UI_ELEMENT_PAINT_TYPE]: 'string',
10135+
[UI_ELEMENT_RENDER_TIME]: 'double',
10136+
[UI_ELEMENT_TYPE]: 'string',
10137+
[UI_ELEMENT_URL]: 'string',
10138+
[UI_ELEMENT_WIDTH]: 'integer',
995010139
[URL]: 'string',
995110140
[URL_DOMAIN]: 'string',
995210141
[URL_FRAGMENT]: 'string',
@@ -10403,6 +10592,15 @@ export type AttributeName =
1040310592
| typeof UI_COMPONENT_NAME
1040410593
| typeof UI_CONTRIBUTES_TO_TTFD
1040510594
| typeof UI_CONTRIBUTES_TO_TTID
10595+
| typeof UI_ELEMENT_HEIGHT
10596+
| typeof UI_ELEMENT_ID
10597+
| typeof UI_ELEMENT_IDENTIFIER
10598+
| typeof UI_ELEMENT_LOAD_TIME
10599+
| typeof UI_ELEMENT_PAINT_TYPE
10600+
| typeof UI_ELEMENT_RENDER_TIME
10601+
| typeof UI_ELEMENT_TYPE
10602+
| typeof UI_ELEMENT_URL
10603+
| typeof UI_ELEMENT_WIDTH
1040610604
| typeof URL
1040710605
| typeof URL_DOMAIN
1040810606
| typeof URL_FRAGMENT
@@ -15302,6 +15500,105 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1530215500
example: true,
1530315501
changelog: [{ version: '0.0.0' }],
1530415502
},
15503+
[UI_ELEMENT_HEIGHT]: {
15504+
brief: 'The height of the UI element (for Html in pixels)',
15505+
type: 'integer',
15506+
pii: {
15507+
isPii: 'maybe',
15508+
},
15509+
isInOtel: false,
15510+
example: 256,
15511+
sdks: ['javascript-browser'],
15512+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.height attribute' }],
15513+
},
15514+
[UI_ELEMENT_ID]: {
15515+
brief: 'The id of the UI element',
15516+
type: 'string',
15517+
pii: {
15518+
isPii: 'maybe',
15519+
},
15520+
isInOtel: false,
15521+
example: 'btn-login',
15522+
sdks: ['javascript-browser'],
15523+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.id attribute' }],
15524+
},
15525+
[UI_ELEMENT_IDENTIFIER]: {
15526+
brief: 'The identifier used to measure the UI element timing',
15527+
type: 'string',
15528+
pii: {
15529+
isPii: 'maybe',
15530+
},
15531+
isInOtel: false,
15532+
example: 'heroImage',
15533+
sdks: ['javascript-browser'],
15534+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.identifier attribute' }],
15535+
},
15536+
[UI_ELEMENT_LOAD_TIME]: {
15537+
brief: 'The loading time of a UI element (from time origin to finished loading)',
15538+
type: 'double',
15539+
pii: {
15540+
isPii: 'maybe',
15541+
},
15542+
isInOtel: false,
15543+
example: 998.2234,
15544+
sdks: ['javascript-browser'],
15545+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.load_time attribute' }],
15546+
},
15547+
[UI_ELEMENT_PAINT_TYPE]: {
15548+
brief: "The type of element paint. Can either be 'image-paint' or 'text-paint'",
15549+
type: 'string',
15550+
pii: {
15551+
isPii: 'maybe',
15552+
},
15553+
isInOtel: false,
15554+
example: 'image-paint',
15555+
sdks: ['javascript-browser'],
15556+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.paint_type attribute' }],
15557+
},
15558+
[UI_ELEMENT_RENDER_TIME]: {
15559+
brief: 'The rendering time of the UI element (from time origin to finished rendering)',
15560+
type: 'double',
15561+
pii: {
15562+
isPii: 'maybe',
15563+
},
15564+
isInOtel: false,
15565+
example: 1023.1124,
15566+
sdks: ['javascript-browser'],
15567+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.render_time attribute' }],
15568+
},
15569+
[UI_ELEMENT_TYPE]: {
15570+
brief: 'type of the UI element',
15571+
type: 'string',
15572+
pii: {
15573+
isPii: 'maybe',
15574+
},
15575+
isInOtel: false,
15576+
example: 'img',
15577+
sdks: ['javascript-browser'],
15578+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.type attribute' }],
15579+
},
15580+
[UI_ELEMENT_URL]: {
15581+
brief: 'The URL of the UI element (e.g. an img src)',
15582+
type: 'string',
15583+
pii: {
15584+
isPii: 'maybe',
15585+
},
15586+
isInOtel: false,
15587+
example: 'https://assets.myapp.com/hero.png',
15588+
sdks: ['javascript-browser'],
15589+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.url attribute' }],
15590+
},
15591+
[UI_ELEMENT_WIDTH]: {
15592+
brief: 'The width of the UI element (for HTML in pixels)',
15593+
type: 'integer',
15594+
pii: {
15595+
isPii: 'maybe',
15596+
},
15597+
isInOtel: false,
15598+
example: 512,
15599+
sdks: ['javascript-browser'],
15600+
changelog: [{ version: 'next', prs: [284], description: 'Added ui.element.width attribute' }],
15601+
},
1530515602
[URL]: {
1530615603
brief: 'The URL of the resource that was fetched.',
1530715604
type: 'string',
@@ -16303,6 +16600,15 @@ export type Attributes = {
1630316600
[UI_COMPONENT_NAME]?: UI_COMPONENT_NAME_TYPE;
1630416601
[UI_CONTRIBUTES_TO_TTFD]?: UI_CONTRIBUTES_TO_TTFD_TYPE;
1630516602
[UI_CONTRIBUTES_TO_TTID]?: UI_CONTRIBUTES_TO_TTID_TYPE;
16603+
[UI_ELEMENT_HEIGHT]?: UI_ELEMENT_HEIGHT_TYPE;
16604+
[UI_ELEMENT_ID]?: UI_ELEMENT_ID_TYPE;
16605+
[UI_ELEMENT_IDENTIFIER]?: UI_ELEMENT_IDENTIFIER_TYPE;
16606+
[UI_ELEMENT_LOAD_TIME]?: UI_ELEMENT_LOAD_TIME_TYPE;
16607+
[UI_ELEMENT_PAINT_TYPE]?: UI_ELEMENT_PAINT_TYPE_TYPE;
16608+
[UI_ELEMENT_RENDER_TIME]?: UI_ELEMENT_RENDER_TIME_TYPE;
16609+
[UI_ELEMENT_TYPE]?: UI_ELEMENT_TYPE_TYPE;
16610+
[UI_ELEMENT_URL]?: UI_ELEMENT_URL_TYPE;
16611+
[UI_ELEMENT_WIDTH]?: UI_ELEMENT_WIDTH_TYPE;
1630616612
[URL]?: URL_TYPE;
1630716613
[URL_DOMAIN]?: URL_DOMAIN_TYPE;
1630816614
[URL_FRAGMENT]?: URL_FRAGMENT_TYPE;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"key": "ui.element.height",
3+
"brief": "The height of the UI element (for Html in pixels)",
4+
"type": "integer",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": 256,
10+
"sdks": ["javascript-browser"],
11+
"changelog": [
12+
{
13+
"version": "next",
14+
"prs": [284],
15+
"description": "Added ui.element.height attribute"
16+
}
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"key": "ui.element.id",
3+
"brief": "The id of the UI element",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "btn-login",
10+
"sdks": ["javascript-browser"],
11+
"changelog": [
12+
{
13+
"version": "next",
14+
"prs": [284],
15+
"description": "Added ui.element.id attribute"
16+
}
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"key": "ui.element.identifier",
3+
"brief": "The identifier used to measure the UI element timing",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "heroImage",
10+
"sdks": ["javascript-browser"],
11+
"changelog": [
12+
{
13+
"version": "next",
14+
"prs": [284],
15+
"description": "Added ui.element.identifier attribute"
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)