diff --git a/src/docs/sdk/event-payloads/properties/measurements.mdx b/src/docs/sdk/event-payloads/properties/measurements.mdx new file mode 100644 index 0000000000..743ccaf84f --- /dev/null +++ b/src/docs/sdk/event-payloads/properties/measurements.mdx @@ -0,0 +1,41 @@ +`measurements` + +: _Optional_. An object containing standard/custom measurements with keys signifying the name of the measurement. + +Standard measurement keys currently supported are from the following list taken from [here](https://github.com/getsentry/sentry/blob/a8c960a933d2ded5225841573d8fc426a482ca9c/static/app/utils/discover/fields.tsx#L654-L676). + +```json +[ + // web + "fp", + "fcp", + "lcp", + "fid", + "cls", + "ttfb", + "ttfb.requesttime", + // mobile + "app_start_cold", + "app_start_warm", + "frames_total", + "frames_slow", + "frames_frozen", + // react native + "stall_count", + "stall_total_time", + "stall_longest_time" +] +``` + +Custom measurements need units to be specified. Units currently supported are durations from the list `["ns" , "ms" , "s"]` taken from [here](https://github.com/getsentry/relay/blob/1e45a8817e45408ecbdbd3f0a679a5f5e4885290/relay-metrics/src/protocol.rs#L14-L21). Note that in the future we will extend the available units (for instance, memory units) but we will not implement a generic user-defined unit interface. + + +```json +{ + "measurements": { + "lcp": { "value": 100 }, + "fp": { "value": 123 }, + "my.custom.metric": { "value": 456, "unit": "ms" } + } +} +``` diff --git a/src/docs/sdk/event-payloads/transaction.mdx b/src/docs/sdk/event-payloads/transaction.mdx index 10534008ed..685e420938 100644 --- a/src/docs/sdk/event-payloads/transaction.mdx +++ b/src/docs/sdk/event-payloads/transaction.mdx @@ -61,3 +61,5 @@ import "./properties/status.mdx"; ``` import "./properties/spans.mdx"; + +import "./properties/measurements.mdx";