Skip to content

Commit 3b2e5e4

Browse files
committed
further deslop
1 parent 2fa39b2 commit 3b2e5e4

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎packages/astro/src/server/middleware.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const handleRequest: (options?: MiddlewareOptions) => MiddlewareHandler =
108108
const rootSpan = activeSpan ? getRootSpan(activeSpan) : undefined;
109109

110110
// if there is an active span, we just want to enhance it with routing data etc.
111-
if (rootSpan && spanToJSON(rootSpan).attributes[SENTRY_OP] === 'http.server') {
111+
if (rootSpan && spanToJSON(rootSpan).attributes[SENTRY_OP] === HTTP_SERVER) {
112112
return enhanceHttpServerSpan(ctx, next, rootSpan);
113113
}
114114

@@ -253,7 +253,7 @@ async function instrumentRequestStartHttpServerSpan(
253253
const res = await startSpan(
254254
{
255255
attributes: {
256-
[SENTRY_OP]: 'http.server',
256+
[SENTRY_OP]: HTTP_SERVER,
257257
...attributes,
258258
},
259259
name,

‎packages/browser/src/tracing/browserTracingIntegration.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {
55
RequestHookInfo,
66
ResponseHookInfo,
77
Span,
8-
SpanAttributes,
98
StartSpanOptions,
109
} from '@sentry/core/browser';
1110
import {
@@ -345,7 +344,7 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
345344
// For pageloads (and manual navigation spans without a URL) we fall back to the current location.
346345
const urlObject = parseStringToURLObject(url || getLocationHref());
347346

348-
const attributes: SpanAttributes = {
347+
const attributes = {
349348
...(urlObject?.pathname && { [URL_PATH]: urlObject.pathname }),
350349
...(urlObject && !isURLObjectRelative(urlObject) && { [URL_FULL]: filterCollectedUrl(urlObject.href) }),
351350
...finalStartSpanOptions.attributes,

‎packages/core/src/types/startSpanOptions.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,24 @@ export interface StartSpanOptions {
5454
*
5555
* @deprecated This option will be removed in the next major version of the SDK. There is no longer a concrete use
5656
* case for it: all spans are indexed and searchable in Sentry, so a span no longer needs to be a transaction to be
57-
* queried, filtered or aggregated on. In most cases, simply drop the option - the span is still sent, just as a child
58-
* of its parent span. If you do need the span to be a segment (root) span, start it without a parent span instead.
57+
* queried, filtered or aggregated on. In most cases, simply drop the option. The span is still sent, just as a child
58+
* of its parent span, if a parent span is active.
59+
* If you do need the span to be a segment (root) span, follow the examples below:.
5960
*
60-
* @example Making a span a segment span without forcing it into a transaction
61+
* @example Making a span a root span:
6162
* ```js
6263
* Sentry.withActiveSpan(null, () => {
63-
* Sentry.startSpan({ name: 'span-that-should-be-a-segment' }, () => {
64+
* Sentry.startSpan({ name: 'span-that-should-be-a-root' }, () => {
6465
* // ...
6566
* });
6667
* });
6768
* ```
6869
*
69-
* @example Keeping that segment span attached to an incoming trace
70+
* @example Keeping the root span attached to a specific trace:
7071
* ```js
7172
* Sentry.continueTrace({ sentryTrace, baggage }, () =>
7273
* Sentry.withActiveSpan(null, () =>
73-
* Sentry.startSpan({ name: 'span-that-should-be-a-segment' }, () => {
74+
* Sentry.startSpan({ name: 'span-that-should-be-a-root' }, () => {
7475
* // ...
7576
* }),
7677
* ),

0 commit comments

Comments
 (0)