From 6af843706fd7a2965a7c96a3d731b8f02a598c66 Mon Sep 17 00:00:00 2001 From: Joris Bayer Date: Thu, 30 Jun 2022 08:55:28 +0200 Subject: [PATCH 1/7] Table of transaction sources --- .../properties/transaction_info.mdx | 28 +++++++++++++++++++ src/docs/sdk/event-payloads/transaction.mdx | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 src/docs/sdk/event-payloads/properties/transaction_info.mdx diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx new file mode 100644 index 0000000000..edf59e0397 --- /dev/null +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -0,0 +1,28 @@ +`transaction_info` + +: _Required_. Additional information about the name of the transaction. + +```json +{ + "transaction_info": { + "source": "raw-url" + } +} +``` + +`transaction_info.source` + +: _Required_. Contains information about how the name of the transaction was determined. +This will be used by the server to decide whether or not to scrub identifiers +from the transaction name, or replace the entire name with a placeholder. + +| Source | Description | Examples | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | +| `raw-url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | +| `raw-url-fallback` | The SDK is configured to send `url-pattern`, but has to fall back to a raw URL for this particular transaction. | +| `url-pattern` | URL pattern / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | +| `view` | Name of the view handling the request. | `UserListView` | +| `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | +| `unknown` | This is the default value set by Relay for legacy SDKs. | | +| `component` | Named after a software component, such as function or class names | `AuthLogin.login`
`LoginActivity.login_button` | +| `background-task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | diff --git a/src/docs/sdk/event-payloads/transaction.mdx b/src/docs/sdk/event-payloads/transaction.mdx index 685e420938..db777548a5 100644 --- a/src/docs/sdk/event-payloads/transaction.mdx +++ b/src/docs/sdk/event-payloads/transaction.mdx @@ -63,3 +63,5 @@ import "./properties/status.mdx"; import "./properties/spans.mdx"; import "./properties/measurements.mdx"; + +import "./properties/transaction_info.mdx"; From e574b8f3bfc64efda1f9417aebad1c841ff13385 Mon Sep 17 00:00:00 2001 From: Joris Bayer Date: Thu, 30 Jun 2022 09:09:03 +0200 Subject: [PATCH 2/7] Fix layout --- src/docs/sdk/event-payloads/properties/transaction_info.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index edf59e0397..168b2b58d5 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -16,7 +16,7 @@ This will be used by the server to decide whether or not to scrub identifiers from the transaction name, or replace the entire name with a placeholder. -| Source | Description | Examples | +| Source | Description |
Examples
| | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | | `raw-url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | | `raw-url-fallback` | The SDK is configured to send `url-pattern`, but has to fall back to a raw URL for this particular transaction. | @@ -24,5 +24,5 @@ from the transaction name, or replace the entire name with a placeholder. | `view` | Name of the view handling the request. | `UserListView` | | `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | | `unknown` | This is the default value set by Relay for legacy SDKs. | | -| `component` | Named after a software component, such as function or class names | `AuthLogin.login`
`LoginActivity.login_button` | +| `component` | Named after a software component, such as a function or class name. | `AuthLogin.login`
`LoginActivity.login_button` | | `background-task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | From 3055c6f018f656ff84c31e561fc12fbd481d6ccb Mon Sep 17 00:00:00 2001 From: Joris Bayer Date: Thu, 30 Jun 2022 12:06:55 +0200 Subject: [PATCH 3/7] simplify source names, move "custom" to top --- .../sdk/event-payloads/properties/transaction_info.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index 168b2b58d5..4357ffed9b 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -18,11 +18,11 @@ from the transaction name, or replace the entire name with a placeholder. | Source | Description |
Examples
| | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -| `raw-url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | -| `raw-url-fallback` | The SDK is configured to send `url-pattern`, but has to fall back to a raw URL for this particular transaction. | -| `url-pattern` | URL pattern / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | -| `view` | Name of the view handling the request. | `UserListView` | | `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | +| `url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | +| `raw-url-fallback` | The SDK is configured to send a `route`, but has to fall back to a raw URL for this particular transaction. | +| `route` | Parametrized URL / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | +| `view` | Name of the view handling the request. | `UserListView` | | `unknown` | This is the default value set by Relay for legacy SDKs. | | | `component` | Named after a software component, such as a function or class name. | `AuthLogin.login`
`LoginActivity.login_button` | -| `background-task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | +| `task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | From bc6941fa8258a3ea74d722719084d6d548a6dd48 Mon Sep 17 00:00:00 2001 From: Joris Bayer Date: Thu, 30 Jun 2022 12:59:18 +0200 Subject: [PATCH 4/7] Add link from PM guidelines --- src/docs/sdk/event-payloads/properties/transaction_info.mdx | 2 ++ src/docs/sdk/performance/index.mdx | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index 4357ffed9b..3d2df24dc0 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -1,3 +1,5 @@ +## Transaction Annotations + `transaction_info` : _Required_. Additional information about the name of the transaction. diff --git a/src/docs/sdk/performance/index.mdx b/src/docs/sdk/performance/index.mdx index 0a9127a5ce..ddd531921c 100644 --- a/src/docs/sdk/performance/index.mdx +++ b/src/docs/sdk/performance/index.mdx @@ -2,7 +2,7 @@ title: "Guidelines for Performance Monitoring" --- -This document covers how SDKs should add support for Performance Monitoring with [Distributed +This document covers how SDKs should add support for Performance Monitoring with [Distributed Tracing](https://docs.sentry.io/product/performance/distributed-tracing/). This should give an overview of the APIs that SDKs need to implement, without @@ -64,6 +64,7 @@ The [Transaction](/sdk/event-payloads/transaction/) class is like a span, with a few key differences: - Transactions have `name`, spans don't. +- Transactions must specify the [source](/sdk/event-payloads/transaction/#transaction-annotations) of its `name` to indicate how the transaction name was generated. - Calling the `finish` method on spans record the span's end timestamp. For transactions, the `finish` method additionally sends an event to Sentry. @@ -90,7 +91,6 @@ tree as well as the unit of reporting to Sentry. - `TransactionContext` should have a static/ctor method called `fromSentryTrace` which prefills a `TransactionContext` with data received from a `sentry-trace` header value - `TransactionContext` should have a static/ctor method called `continueFromHeaders(headerMap)` which is really just a thin wrapper around `fromSentryTrace(headerMap.get("sentry-trace"))` right now. This should be preferred by integration/framework-sdk authors over `fromSentryTrace` as it hides the exact header names used deeper in the core sdk, and leaves opportunity for using additional headers (from the W3C) in the future without changing all integrations. - - `Span.finish()` - Accepts an optional `endTimestamp` to allow users to set a custom `endTimestamp` on the finished span @@ -196,6 +196,7 @@ keep track of it themselves. - The value should be the trace header string of the `Span` that is currently on the `Scope` - Introduce a method called `startTransaction` + - Takes the same two arguments as `Sentry.startTransaction` - Creates a new `Transaction` instance - Should implement sampling as described in more detail in the 'Sampling' section of this document From 098694848867dd60280d69edceadaa948f09df00 Mon Sep 17 00:00:00 2001 From: Joris Bayer Date: Thu, 30 Jun 2022 13:11:39 +0200 Subject: [PATCH 5/7] fix: broken link --- src/docs/sdk/event-payloads/properties/transaction_info.mdx | 2 -- src/docs/sdk/event-payloads/transaction.mdx | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index 3d2df24dc0..4357ffed9b 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -1,5 +1,3 @@ -## Transaction Annotations - `transaction_info` : _Required_. Additional information about the name of the transaction. diff --git a/src/docs/sdk/event-payloads/transaction.mdx b/src/docs/sdk/event-payloads/transaction.mdx index db777548a5..633492af45 100644 --- a/src/docs/sdk/event-payloads/transaction.mdx +++ b/src/docs/sdk/event-payloads/transaction.mdx @@ -64,4 +64,6 @@ import "./properties/spans.mdx"; import "./properties/measurements.mdx"; +## Transaction Annotations + import "./properties/transaction_info.mdx"; From e4f7841d8c029954db680889caf2d9bcf08cab22 Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Fri, 1 Jul 2022 12:58:42 +0200 Subject: [PATCH 6/7] ref: Recommended, simplify --- .../properties/transaction_info.mdx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index 4357ffed9b..38b8b44e60 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -1,28 +1,28 @@ `transaction_info` -: _Required_. Additional information about the name of the transaction. +: _Recommended_. Additional information about the name of the transaction. ```json { "transaction_info": { - "source": "raw-url" + "source": "url" } } ``` `transaction_info.source` -: _Required_. Contains information about how the name of the transaction was determined. +: _Recommended_. Contains information about how the name of the transaction was determined. This will be used by the server to decide whether or not to scrub identifiers from the transaction name, or replace the entire name with a placeholder. -| Source | Description |
Examples
| -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -| `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | -| `url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | -| `raw-url-fallback` | The SDK is configured to send a `route`, but has to fall back to a raw URL for this particular transaction. | -| `route` | Parametrized URL / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | -| `view` | Name of the view handling the request. | `UserListView` | -| `unknown` | This is the default value set by Relay for legacy SDKs. | | -| `component` | Named after a software component, such as a function or class name. | `AuthLogin.login`
`LoginActivity.login_button` | -| `task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | +| Source | Description |
Examples
| +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | +| `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | +| `url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | +| `url-fallback` | The SDK is configured to send a `route`, but has to fall back to a raw URL for this particular transaction. | +| `route` | Parametrized URL / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | +| `view` | Name of the view handling the request. | `UserListView` | +| `component` | Named after a software component, such as a function or class name. | `AuthLogin.login`
`LoginActivity.login_button` | +| `task` | Name of a background task (e.g. a Celery task) | `sentry.tasks.do_something` | +| `unknown` (default) | This is the default value set by Relay for legacy SDKs. | | From 2d8f1dcdc2d3688086d8bd0c8de1a17636368298 Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Fri, 1 Jul 2022 14:16:11 +0200 Subject: [PATCH 7/7] ref: Remove raw-url-fallback --- src/docs/sdk/event-payloads/properties/transaction_info.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/docs/sdk/event-payloads/properties/transaction_info.mdx b/src/docs/sdk/event-payloads/properties/transaction_info.mdx index 38b8b44e60..36eb64da1f 100644 --- a/src/docs/sdk/event-payloads/properties/transaction_info.mdx +++ b/src/docs/sdk/event-payloads/properties/transaction_info.mdx @@ -20,7 +20,6 @@ from the transaction name, or replace the entire name with a placeholder. | ------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | | `custom` | User-defined name, see [`setTransactionName()`](https://docs.sentry.io/platforms/javascript/enriching-events/transaction-name/) | `my_transaction` | | `url` | Raw URL, potentially containing identifiers. | `/auth/login/john123/`
`GET /auth/login/john123/` | -| `url-fallback` | The SDK is configured to send a `route`, but has to fall back to a raw URL for this particular transaction. | | `route` | Parametrized URL / route | `/auth/login/:userId/`
`GET /auth/login/{user}/` | | `view` | Name of the view handling the request. | `UserListView` | | `component` | Named after a software component, such as a function or class name. | `AuthLogin.login`
`LoginActivity.login_button` |