Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

feat(transactions): Add transaction_info.source [INGEST-1427] #624

Merged
merged 7 commits into from
Jul 4, 2022
Merged
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
27 changes: 27 additions & 0 deletions src/docs/sdk/event-payloads/properties/transaction_info.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
`transaction_info`

: _Recommended_. Additional information about the name of the transaction.

```json
{
"transaction_info": {
"source": "url"
}
}
```

`transaction_info.source`

: _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 | <div style="width:220px">Examples</div> |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `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/`<br />`GET /auth/login/john123/` |
| `route` | Parametrized URL / route | `/auth/login/:userId/`<br />`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`<br /> `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. | |
4 changes: 4 additions & 0 deletions src/docs/sdk/event-payloads/transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ import "./properties/status.mdx";
import "./properties/spans.mdx";

import "./properties/measurements.mdx";

## Transaction Annotations

import "./properties/transaction_info.mdx";
5 changes: 3 additions & 2 deletions src/docs/sdk/performance/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down