Skip to content

Commit 228487f

Browse files
authored
Add NEL-related attributes (#68)
The changes are reflecting the discussions from [this document](https://www.notion.so/sentry/Browser-Reports-Attribute-21e8b10e4b5d8045a7fdc936c814ed70) and follow-up to [this Relay PR](getsentry/relay#4874).
1 parent cfa0b54 commit 228487f

File tree

12 files changed

+266
-3
lines changed

12 files changed

+266
-3
lines changed

generated/attributes/browser.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [Stable Attributes](#stable-attributes)
66
- [browser.name](#browsername)
7+
- [browser.report.type](#browserreporttype)
78
- [browser.script.invoker](#browserscriptinvoker)
89
- [browser.script.invoker_type](#browserscriptinvoker_type)
910
- [browser.script.source_char_position](#browserscriptsource_char_position)
@@ -22,6 +23,17 @@ The name of the browser.
2223
| Exists in OpenTelemetry | No |
2324
| Example | `Chrome` |
2425

26+
### browser.report.type
27+
28+
A browser report sent via reporting API..
29+
30+
| Property | Value |
31+
| --- | --- |
32+
| Type | `string` |
33+
| Has PII | false |
34+
| Exists in OpenTelemetry | No |
35+
| Example | `network-error` |
36+
2537
### browser.script.invoker
2638

2739
How a script was called in the browser.

generated/attributes/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This directory contains documentation for all available attributes.
2727
- [`logger` Attributes](./logger.md)
2828
- [`messaging` Attributes](./messaging.md)
2929
- [`navigation` Attributes](./navigation.md)
30+
- [`nel` Attributes](./nel.md)
3031
- [`net` Attributes](./net.md)
3132
- [`network` Attributes](./network.md)
3233
- [`os` Attributes](./os.md)

generated/attributes/nel.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. -->
2+
3+
# Nel Attributes
4+
5+
- [Stable Attributes](#stable-attributes)
6+
- [nel.elapsed_time](#nelelapsed_time)
7+
- [nel.phase](#nelphase)
8+
- [nel.referrer](#nelreferrer)
9+
- [nel.sampling_function](#nelsampling_function)
10+
- [nel.type](#neltype)
11+
12+
## Stable Attributes
13+
14+
### nel.elapsed_time
15+
16+
The elapsed number of milliseconds between the start of the resource fetch and when it was completed or aborted by the user agent.
17+
18+
| Property | Value |
19+
| --- | --- |
20+
| Type | `integer` |
21+
| Has PII | false |
22+
| Exists in OpenTelemetry | No |
23+
| Example | `100` |
24+
25+
### nel.phase
26+
27+
If request failed, the phase of its network error. If request succeeded, "application".
28+
29+
| Property | Value |
30+
| --- | --- |
31+
| Type | `string` |
32+
| Has PII | false |
33+
| Exists in OpenTelemetry | No |
34+
| Example | `application` |
35+
36+
### nel.referrer
37+
38+
request's referrer, as determined by the referrer policy associated with its client.
39+
40+
| Property | Value |
41+
| --- | --- |
42+
| Type | `string` |
43+
| Has PII | false |
44+
| Exists in OpenTelemetry | No |
45+
| Example | `https://example.com/foo?bar=baz` |
46+
47+
### nel.sampling_function
48+
49+
The sampling function used to determine if the request should be sampled.
50+
51+
| Property | Value |
52+
| --- | --- |
53+
| Type | `double` |
54+
| Has PII | false |
55+
| Exists in OpenTelemetry | No |
56+
| Example | `0.5` |
57+
58+
### nel.type
59+
60+
If request failed, the type of its network error. If request succeeded, "ok".
61+
62+
| Property | Value |
63+
| --- | --- |
64+
| Type | `string` |
65+
| Has PII | false |
66+
| Exists in OpenTelemetry | No |
67+
| Example | `dns.unreachable` |
68+

generated/attributes/sentry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The operation of a span.
143143

144144
### sentry.origin
145145

146-
The origin of a span.
146+
The origin of the instrumentation (e.g. span, log, etc.)
147147

148148
| Property | Value |
149149
| --- | --- |

javascript/sentry-conventions/src/attributes.ts

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,26 @@ export const BROWSER_NAME = 'browser.name';
746746
*/
747747
export type BROWSER_NAME_TYPE = string;
748748

749+
// Path: model/attributes/browser/browser__report__type.json
750+
751+
/**
752+
* A browser report sent via reporting API.. `browser.report.type`
753+
*
754+
* Attribute Value Type: `string` {@link BROWSER_REPORT_TYPE_TYPE}
755+
*
756+
* Contains PII: false
757+
*
758+
* Attribute defined in OTEL: No
759+
*
760+
* @example "network-error"
761+
*/
762+
export const BROWSER_REPORT_TYPE = 'browser.report.type';
763+
764+
/**
765+
* Type for {@link BROWSER_REPORT_TYPE} browser.report.type
766+
*/
767+
export type BROWSER_REPORT_TYPE_TYPE = string;
768+
749769
// Path: model/attributes/browser/browser__script__invoker.json
750770

751771
/**
@@ -3882,6 +3902,106 @@ export const NAVIGATION_TYPE = 'navigation.type';
38823902
*/
38833903
export type NAVIGATION_TYPE_TYPE = string;
38843904

3905+
// Path: model/attributes/nel/nel__elapsed_time.json
3906+
3907+
/**
3908+
* The elapsed number of milliseconds between the start of the resource fetch and when it was completed or aborted by the user agent. `nel.elapsed_time`
3909+
*
3910+
* Attribute Value Type: `number` {@link NEL_ELAPSED_TIME_TYPE}
3911+
*
3912+
* Contains PII: false
3913+
*
3914+
* Attribute defined in OTEL: No
3915+
*
3916+
* @example 100
3917+
*/
3918+
export const NEL_ELAPSED_TIME = 'nel.elapsed_time';
3919+
3920+
/**
3921+
* Type for {@link NEL_ELAPSED_TIME} nel.elapsed_time
3922+
*/
3923+
export type NEL_ELAPSED_TIME_TYPE = number;
3924+
3925+
// Path: model/attributes/nel/nel__phase.json
3926+
3927+
/**
3928+
* If request failed, the phase of its network error. If request succeeded, "application". `nel.phase`
3929+
*
3930+
* Attribute Value Type: `string` {@link NEL_PHASE_TYPE}
3931+
*
3932+
* Contains PII: false
3933+
*
3934+
* Attribute defined in OTEL: No
3935+
*
3936+
* @example "application"
3937+
*/
3938+
export const NEL_PHASE = 'nel.phase';
3939+
3940+
/**
3941+
* Type for {@link NEL_PHASE} nel.phase
3942+
*/
3943+
export type NEL_PHASE_TYPE = string;
3944+
3945+
// Path: model/attributes/nel/nel__referrer.json
3946+
3947+
/**
3948+
* request's referrer, as determined by the referrer policy associated with its client. `nel.referrer`
3949+
*
3950+
* Attribute Value Type: `string` {@link NEL_REFERRER_TYPE}
3951+
*
3952+
* Contains PII: false
3953+
*
3954+
* Attribute defined in OTEL: No
3955+
*
3956+
* @example "https://example.com/foo?bar=baz"
3957+
*/
3958+
export const NEL_REFERRER = 'nel.referrer';
3959+
3960+
/**
3961+
* Type for {@link NEL_REFERRER} nel.referrer
3962+
*/
3963+
export type NEL_REFERRER_TYPE = string;
3964+
3965+
// Path: model/attributes/nel/nel__sampling_function.json
3966+
3967+
/**
3968+
* The sampling function used to determine if the request should be sampled. `nel.sampling_function`
3969+
*
3970+
* Attribute Value Type: `number` {@link NEL_SAMPLING_FUNCTION_TYPE}
3971+
*
3972+
* Contains PII: false
3973+
*
3974+
* Attribute defined in OTEL: No
3975+
*
3976+
* @example 0.5
3977+
*/
3978+
export const NEL_SAMPLING_FUNCTION = 'nel.sampling_function';
3979+
3980+
/**
3981+
* Type for {@link NEL_SAMPLING_FUNCTION} nel.sampling_function
3982+
*/
3983+
export type NEL_SAMPLING_FUNCTION_TYPE = number;
3984+
3985+
// Path: model/attributes/nel/nel__type.json
3986+
3987+
/**
3988+
* If request failed, the type of its network error. If request succeeded, "ok". `nel.type`
3989+
*
3990+
* Attribute Value Type: `string` {@link NEL_TYPE_TYPE}
3991+
*
3992+
* Contains PII: false
3993+
*
3994+
* Attribute defined in OTEL: No
3995+
*
3996+
* @example "dns.unreachable"
3997+
*/
3998+
export const NEL_TYPE = 'nel.type';
3999+
4000+
/**
4001+
* Type for {@link NEL_TYPE} nel.type
4002+
*/
4003+
export type NEL_TYPE_TYPE = string;
4004+
38854005
// Path: model/attributes/net/net__host__ip.json
38864006

38874007
/**
@@ -5119,7 +5239,7 @@ export type SENTRY_OP_TYPE = string;
51195239
// Path: model/attributes/sentry/sentry__origin.json
51205240

51215241
/**
5122-
* The origin of a span. `sentry.origin`
5242+
* The origin of the instrumentation (e.g. span, log, etc.) `sentry.origin`
51235243
*
51245244
* Attribute Value Type: `string` {@link SENTRY_ORIGIN_TYPE}
51255245
*
@@ -6029,6 +6149,7 @@ export type Attributes = {
60296149
[APP_START_TYPE]?: APP_START_TYPE_TYPE;
60306150
[BLOCKED_MAIN_THREAD]?: BLOCKED_MAIN_THREAD_TYPE;
60316151
[BROWSER_NAME]?: BROWSER_NAME_TYPE;
6152+
[BROWSER_REPORT_TYPE]?: BROWSER_REPORT_TYPE_TYPE;
60326153
[BROWSER_SCRIPT_INVOKER]?: BROWSER_SCRIPT_INVOKER_TYPE;
60336154
[BROWSER_SCRIPT_INVOKER_TYPE]?: BROWSER_SCRIPT_INVOKER_TYPE_TYPE;
60346155
[BROWSER_SCRIPT_SOURCE_CHAR_POSITION]?: BROWSER_SCRIPT_SOURCE_CHAR_POSITION_TYPE;
@@ -6153,6 +6274,11 @@ export type Attributes = {
61536274
[MESSAGING_OPERATION_TYPE]?: MESSAGING_OPERATION_TYPE_TYPE;
61546275
[MESSAGING_SYSTEM]?: MESSAGING_SYSTEM_TYPE;
61556276
[NAVIGATION_TYPE]?: NAVIGATION_TYPE_TYPE;
6277+
[NEL_ELAPSED_TIME]?: NEL_ELAPSED_TIME_TYPE;
6278+
[NEL_PHASE]?: NEL_PHASE_TYPE;
6279+
[NEL_REFERRER]?: NEL_REFERRER_TYPE;
6280+
[NEL_SAMPLING_FUNCTION]?: NEL_SAMPLING_FUNCTION_TYPE;
6281+
[NEL_TYPE]?: NEL_TYPE_TYPE;
61566282
[NETWORK_LOCAL_ADDRESS]?: NETWORK_LOCAL_ADDRESS_TYPE;
61576283
[NETWORK_LOCAL_PORT]?: NETWORK_LOCAL_PORT_TYPE;
61586284
[NETWORK_PEER_ADDRESS]?: NETWORK_PEER_ADDRESS_TYPE;
@@ -6271,6 +6397,7 @@ export type FullAttributes = {
62716397
[APP_START_TYPE]?: APP_START_TYPE_TYPE;
62726398
[BLOCKED_MAIN_THREAD]?: BLOCKED_MAIN_THREAD_TYPE;
62736399
[BROWSER_NAME]?: BROWSER_NAME_TYPE;
6400+
[BROWSER_REPORT_TYPE]?: BROWSER_REPORT_TYPE_TYPE;
62746401
[BROWSER_SCRIPT_INVOKER]?: BROWSER_SCRIPT_INVOKER_TYPE;
62756402
[BROWSER_SCRIPT_INVOKER_TYPE]?: BROWSER_SCRIPT_INVOKER_TYPE_TYPE;
62766403
[BROWSER_SCRIPT_SOURCE_CHAR_POSITION]?: BROWSER_SCRIPT_SOURCE_CHAR_POSITION_TYPE;
@@ -6421,6 +6548,11 @@ export type FullAttributes = {
64216548
[MESSAGING_SYSTEM]?: MESSAGING_SYSTEM_TYPE;
64226549
[METHOD]?: METHOD_TYPE;
64236550
[NAVIGATION_TYPE]?: NAVIGATION_TYPE_TYPE;
6551+
[NEL_ELAPSED_TIME]?: NEL_ELAPSED_TIME_TYPE;
6552+
[NEL_PHASE]?: NEL_PHASE_TYPE;
6553+
[NEL_REFERRER]?: NEL_REFERRER_TYPE;
6554+
[NEL_SAMPLING_FUNCTION]?: NEL_SAMPLING_FUNCTION_TYPE;
6555+
[NEL_TYPE]?: NEL_TYPE_TYPE;
64246556
[NET_HOST_IP]?: NET_HOST_IP_TYPE;
64256557
[NET_HOST_NAME]?: NET_HOST_NAME_TYPE;
64266558
[NET_HOST_PORT]?: NET_HOST_PORT_TYPE;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "browser.report.type",
3+
"brief": "A browser report sent via reporting API..",
4+
"type": "string",
5+
"pii": {
6+
"key": "false"
7+
},
8+
"is_in_otel": false,
9+
"example": "network-error"
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"key": "nel.elapsed_time",
3+
"brief": "The elapsed number of milliseconds between the start of the resource fetch and when it was completed or aborted by the user agent.",
4+
"type": "integer",
5+
"pii": { "key": "false" },
6+
"is_in_otel": false,
7+
"example": 100
8+
}

model/attributes/nel/nel__phase.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"key": "nel.phase",
3+
"brief": "If request failed, the phase of its network error. If request succeeded, \"application\".",
4+
"type": "string",
5+
"pii": { "key": "false" },
6+
"is_in_otel": false,
7+
"example": "application"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"key": "nel.referrer",
3+
"brief": "request's referrer, as determined by the referrer policy associated with its client.",
4+
"type": "string",
5+
"pii": { "key": "false" },
6+
"is_in_otel": false,
7+
"example": "https://example.com/foo?bar=baz"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"key": "nel.sampling_function",
3+
"brief": "The sampling function used to determine if the request should be sampled.",
4+
"type": "double",
5+
"pii": { "key": "false" },
6+
"is_in_otel": false,
7+
"example": 0.5
8+
}

0 commit comments

Comments
 (0)