Skip to content
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
2 changes: 1 addition & 1 deletion packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0",
"@sentry/opentelemetry": "11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"/build"
],
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0",
"@sentry/server-runtime-injection": "11.8.0",
Expand Down
16 changes: 15 additions & 1 deletion packages/deno/src/opentelemetry/tracer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { SENTRY_ORIGIN } from '@sentry/conventions/attributes';
import type { Context, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';
import type { Context, Link, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';
import { trace } from '@opentelemetry/api';
import { isObjectLike, startInactiveSpan, startSpanManual } from '@sentry/core';
import type { SpanLink } from '@sentry/core';

/**
* Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.
Expand Down Expand Up @@ -32,6 +33,7 @@ class SentryDenoTracer implements Tracer {
public startSpan(name: string, options?: SpanOptions): Span {
return startInactiveSpan({
...options,
links: convertSpanLinkType(options?.links),
name,
attributes: {
...options?.attributes,
Expand Down Expand Up @@ -62,6 +64,7 @@ class SentryDenoTracer implements Tracer {

const spanOpts = {
...opts,
links: convertSpanLinkType(opts.links),
name,
attributes: {
...opts.attributes,
Expand All @@ -84,3 +87,14 @@ class SentryDenoTracer implements Tracer {
return startSpanManual(spanOpts, callback) as ReturnType<F>;
}
}

/**
* Converts OpenTelemetry span links to Sentry span links.
*
* Since `@opentelemetry/api` 1.10.0, link attribute values are typed as `unknown`.
* Sentry's `SpanLink` only accepts strings, numbers, booleans and arrays of these as attribute values,
* so OTel links do not match its type.
*/
function convertSpanLinkType(links: Link[] | undefined): SpanLink[] | undefined {
return links as SpanLink[] | undefined;
}
2 changes: 1 addition & 1 deletion packages/hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/core": "11.8.0",
"@sentry/conventions": "^0.27.0",
"@sentry/server-utils": "11.8.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@rollup/plugin-commonjs": "28.0.1",
"@sentry/browser-utils": "11.8.0",
"@sentry/bundler-plugins": "11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0",
"@sentry/opentelemetry": "11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@opentelemetry/api": "^1.9.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.9.1"
"@opentelemetry/api": "^1.10.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
Expand Down
3 changes: 2 additions & 1 deletion packages/opentelemetry/src/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@sentry/core';
import type { Span, SpanAttributes } from '@sentry/core';
import { SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY } from './constants';
import { convertSpanLinkType } from './utils/convertSpanLinkType';
import { SENTRY_KIND } from '@sentry/conventions/attributes';

export class SentryTracer implements Tracer {
Expand Down Expand Up @@ -134,7 +135,7 @@ export class SentryTracer implements Tracer {
const sentryOptions = {
name,
attributes: (options.attributes as SpanAttributes) || {},
links: options.links,
links: convertSpanLinkType(options.links),
startTime: options.startTime,
};

Expand Down
13 changes: 13 additions & 0 deletions packages/opentelemetry/src/utils/convertSpanLinkType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Link } from '@opentelemetry/api';
import type { SpanLink } from '@sentry/core';

/**
* Converts OpenTelemetry span links to Sentry span links.
*
* Since `@opentelemetry/api` 1.10.0, link attribute values are typed as `unknown`.
* Sentry's `SpanLink` only accepts strings, numbers, booleans and arrays of these as attribute values,
* so OTel links do not match its type.
*/
export function convertSpanLinkType(links: Link[] | undefined): SpanLink[] | undefined {
return links as SpanLink[] | undefined;
}
2 changes: 1 addition & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/browser": "11.8.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/server-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/cloudflare": "11.8.0",
"@sentry/core": "11.8.0",
"@sentry/conventions": "^0.27.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/sveltekit/src/server-common/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ async function instrumentHandle(
[SENTRY_ORIGIN]: 'auto.http.sveltekit',
[SENTRY_SEGMENT_NAME_SOURCE]: routeName ? 'route' : 'url',
'sveltekit.tracing.original_name': originalName,
[URL_FULL]: (kitRootSpanAttributes[URL_FULL] as string | undefined) ?? filterCollectedUrl(event.url.href),
[URL_PATH]: (kitRootSpanAttributes[URL_PATH] as string | undefined) ?? event.url.pathname,
[URL_FULL]: kitRootSpanAttributes[URL_FULL] ?? filterCollectedUrl(event.url.href),
[URL_PATH]: kitRootSpanAttributes[URL_PATH] ?? event.url.pathname,
...(routeName && {
[HTTP_ROUTE]: routeName,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/tanstackstart-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/browser-utils": "11.8.0",
"@sentry/conventions": "^0.27.0",
"@sentry/core": "11.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel-edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/api": "^1.10.0",
"@sentry/core": "11.8.0",
"@sentry/server-utils": "11.8.0"
},
Expand Down
Loading
Loading