You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- You can set a uniform sample rate for all transactions using the <PlatformIdentifiername="traces-sample-rate" /> option in your SDK config to a number between `0` and `1`. (For example, to send 20% of transactions, set <PlatformIdentifiername="traces-sample-rate" /> to `0.2`.)
43
+
- You can establish a uniform sample rate for all transactions by setting the <PlatformIdentifiername="traces-sample-rate" /> option in your SDK config to a number between `0` and `1`. (For example, to send 20% of transactions, set <PlatformIdentifiername="traces-sample-rate" /> to `0.2`.)
44
44
- For more granular control over sampling, you can set the sample rate based on the transaction itself and the context in which it's captured, by providing a function to the <PlatformIdentifiername="traces-sampler" /> config option.
45
45
46
46
The two options are mutually exclusive. If both are set, <PlatformIdentifiername="traces-sampler" /> will take precedence.
@@ -49,7 +49,7 @@ Learn more about tracing <PlatformLink to="/configuration/options/#tracing-optio
49
49
50
50
## Distributed Tracing
51
51
52
-
Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services. Learn more about our model in [Distributed Tracing](/product/sentry-basics/tracing/distributed-tracing/).
52
+
Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services, respectively. Learn more about our model in [Distributed Tracing](/product/sentry-basics/tracing/distributed-tracing/).
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/tracing/instrumentation/index.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ To get started, import the SDK.
18
18
19
19
There are three key functions for creating spans:
20
20
21
-
-[startSpan](#starting-an-active-span-startspan): Creates a new span that is active, and which is automatically ended. You'll likely want to use this function.
21
+
-[startSpan](#starting-an-active-span-startspan): Creates a new span that is active, and which will end automatically. You'll likely want to use this function.
22
22
-[startSpanManual](#starting-an-active-span-with-manual-end-startspanmanual): Creates a new span that is active, which has to be ended manually.
23
23
-[startInactiveSpan](#starting-inactive-spans-startinactivespan): Creates a new span that is inactive, which has to be ended manually.
24
24
@@ -30,7 +30,7 @@ In contrast, **inactive spans** will never have children automatically associate
30
30
31
31
A key constraint for active spans is that they can only be made active inside of a callback. This constraint exists because otherwise it becomes impossible to associate spans with the correct parent span when working with asynchronous code.
32
32
33
-
In places where you are not able to wrap executing code in a callback (e.g. when working with hooks or similar) you have to work with inactive spans, and can combine this with [withActiveSpan](#withactivespan) to manually associate child spans with the correct parent span.
33
+
In places where you are not able to execute your code in a callback (for example, when working with hooks or similar) you have to work with inactive spans, and can combine this with [withActiveSpan](#withactivespan) to manually associate child spans with the correct parent span.
34
34
35
35
<PlatformCategorySectionsupported={['browser']}>
36
36
@@ -86,7 +86,7 @@ Only `name` is required, all other options are optional.
86
86
87
87
## Starting an Active Span (`startSpan`)
88
88
89
-
For most scenarios, we recommend to start active spans with `Sentry.startSpan()`. This will start a new span that is active in the provided callback, and will automatically end the span when the callback is done. The callback can be synchronous, or asynchronous (a promise). In the case of an asynchronous callback, the span will be ended when the promise is resolved or rejected. If the provided callback errors or rejects, the span will be marked as failed.
89
+
For most scenarios, we recommend to start active spans with `Sentry.startSpan()`. This will start a new span that is active in the provided callback, and will automatically end the span when the callback is done. The callback can be synchronous or asynchronous (a promise). In the case of an asynchronous callback, the span will be ended when the promise is resolved or rejected. If the provided callback throws an error or rejects a promise, the span will be marked as failed.
Suppress the creation of sampled spans for the duration of the callback. This is useful when you want to prevent certain spans from being captured. For example, if you do not want to create spans for a given fetch request, you can do:
178
+
Suppresses the creation of sampled spans for the duration of the callback. This is useful when you want to prevent certain spans from being captured. For example, if you do not want to create spans for a given fetch request, you can do:
179
179
180
180
```javascript
181
181
Sentry.suppressTracing(() => {
@@ -255,9 +255,9 @@ Sentry.init({
255
255
256
256
### Adding Span Operations ("op")
257
257
258
-
Spans can have an operation associated with them, which help activate Sentry identify additional context about the span. For example database related spans have the `db` span operation associated with them. The Sentry product offers additional controls, visualizations and filters for spans with known operations.
258
+
Spans can have an operation associated with them, which help Sentry identify additional context about the span. For example, database related spans have the `db` span operation associated with them. The Sentry product offers additional controls, visualizations, and filters for spans with known operations.
259
259
260
-
Sentry maintains a [list of wellknown span operations](https://develop.sentry.dev/sdk/performance/span-operations/#list-of-operations) and it is recommended that you use one of those operations if it is applicable to your span.
260
+
Sentry maintains a [list of well-known span operations](https://develop.sentry.dev/sdk/performance/span-operations/#list-of-operations) and it is recommended that you use one of those operations if it is applicable to your span.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/tracing/span-metrics/index.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ When adding metrics as span attributes:
41
41
42
42
- Use consistent naming conventions (for example, `category.metric_name`)
43
43
- Keep attribute names concise but descriptive
44
-
- Use appropriate data types (string, number, boolean, or arrays of these types)
44
+
- Use appropriate data types (string, number, boolean, or (non-mixed) arrays of these types)
45
45
46
46
## Creating Dedicated Metric Spans
47
47
@@ -100,7 +100,7 @@ Sentry.init({
100
100
101
101
1.**Metric Naming**
102
102
- Use clear, consistent naming patterns
103
-
- Include the metric category (e.g.,`db`, `cache`, `http`)
103
+
- Include the metric category (examples:`db`, `cache`, `http`)
104
104
- Use snake_case for metric names
105
105
- Avoid high-cardinality values in metric names
106
106
@@ -139,6 +139,6 @@ When implementing span metrics in your application:
139
139
3.**Focus on Actionability**
140
140
- Track metrics that help diagnose specific issues
141
141
- Consider what alerts or dashboard visualizations you'll want to create
142
-
- Ensure metrics can drive issue resolution or decision-making
142
+
- Ensure metrics can drive issue resolution or decisionmaking
143
143
144
144
For detailed examples of how to implement span metrics in common scenarios, see our <PlatformLinkto="/tracing/span-metrics/examples/">Span Metrics Examples</PlatformLink> guide.
0 commit comments