Skip to content

Commit d631127

Browse files
authored
feat(opentelemetry): Update OpenTelemetry dependencies to 1.28.0 (#14547)
Updates all OpenTelemetry dependencies to 1.28.0, as well as all instrumentation except for prisma (which is a major from 5 to 6, so leaving this out for now...) to their latest version.
1 parent 2a41c84 commit d631127

File tree

20 files changed

+417
-248
lines changed

20 files changed

+417
-248
lines changed

.size-limit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ module.exports = [
228228
import: createImport('init'),
229229
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
230230
gzip: true,
231-
limit: '140 KB',
231+
limit: '160 KB',
232232
},
233233
{
234234
name: '@sentry/node - without tracing',
@@ -260,7 +260,7 @@ module.exports = [
260260
import: createImport('init'),
261261
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
262262
gzip: true,
263-
limit: '130 KB',
263+
limit: '150 KB',
264264
},
265265
];
266266

dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ test('Lambda layer SDK bundle sends events', async ({ request }) => {
3333
'sentry.op': 'function.aws.lambda',
3434
'cloud.account.id': '123453789012',
3535
'faas.id': 'arn:aws:lambda:us-east-1:123453789012:function:my-lambda',
36+
'faas.coldstart': true,
3637
'otel.kind': 'SERVER',
3738
},
3839
op: 'function.aws.lambda',

dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,22 @@ test('AWS Serverless SDK sends events in ESM mode', async ({ request }) => {
2828
expect(transactionEvent.contexts?.trace).toEqual({
2929
data: {
3030
'sentry.sample_rate': 1,
31-
'sentry.source': 'component',
32-
'sentry.origin': 'auto.function.serverless',
31+
'sentry.source': 'custom',
32+
'sentry.origin': 'auto.otel.aws-lambda',
3333
'sentry.op': 'function.aws.lambda',
34+
'cloud.account.id': '123453789012',
35+
'faas.id': 'arn:aws:lambda:us-east-1:123453789012:function:my-lambda',
36+
'faas.coldstart': true,
37+
'otel.kind': 'SERVER',
3438
},
3539
op: 'function.aws.lambda',
36-
origin: 'auto.function.serverless',
40+
origin: 'auto.otel.aws-lambda',
3741
span_id: expect.stringMatching(/[a-f0-9]{16}/),
3842
status: 'ok',
3943
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
4044
});
4145

42-
expect(transactionEvent.spans).toHaveLength(2);
46+
expect(transactionEvent.spans).toHaveLength(3);
4347

4448
// shows that the Otel Http instrumentation is working
4549
expect(transactionEvent.spans).toContainEqual(
@@ -54,6 +58,19 @@ test('AWS Serverless SDK sends events in ESM mode', async ({ request }) => {
5458
}),
5559
);
5660

61+
expect(transactionEvent.spans).toContainEqual(
62+
expect.objectContaining({
63+
data: {
64+
'sentry.op': 'function.aws.lambda',
65+
'sentry.origin': 'auto.function.serverless',
66+
'sentry.source': 'component',
67+
},
68+
description: 'my-lambda',
69+
op: 'function.aws.lambda',
70+
origin: 'auto.function.serverless',
71+
}),
72+
);
73+
5774
// shows that the manual span creation is working
5875
expect(transactionEvent.spans).toContainEqual(
5976
expect.objectContaining({

dev-packages/node-integration-tests/suites/aws-serverless/aws-integration/s3/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const EXPECTED_TRANSCATION = {
1414
'rpc.method': 'PutObject',
1515
'rpc.service': 'S3',
1616
'aws.region': 'us-east-1',
17+
'aws.s3.bucket': 'ot-demo-test',
1718
'otel.kind': 'CLIENT',
1819
},
1920
}),

jest/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
testMatch: ['<rootDir>/**/*.test.ts', '<rootDir>/**/*.test.tsx'],
1111
moduleNameMapper: {
1212
'^axios$': require.resolve('axios'),
13+
'@opentelemetry/semantic-conventions/incubating': require.resolve('@opentelemetry/semantic-conventions/incubating'),
1314
},
1415
globals: {
1516
'ts-jest': {

packages/aws-serverless/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
"access": "public"
6565
},
6666
"dependencies": {
67-
"@opentelemetry/instrumentation": "^0.54.0",
68-
"@opentelemetry/instrumentation-aws-lambda": "0.44.0",
69-
"@opentelemetry/instrumentation-aws-sdk": "0.45.0",
67+
"@opentelemetry/instrumentation": "^0.55.0",
68+
"@opentelemetry/instrumentation-aws-lambda": "0.48.0",
69+
"@opentelemetry/instrumentation-aws-sdk": "0.47.0",
7070
"@sentry/core": "8.42.0",
7171
"@sentry/node": "8.42.0",
7272
"@types/aws-lambda": "^8.10.62"

packages/aws-serverless/src/sdk.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ export function wrapHandler<TEvent, TResult>(
336336
// Only start a trace and root span if the handler is not already wrapped by Otel instrumentation
337337
// Otherwise, we create two root spans (one from otel, one from our wrapper).
338338
// If Otel instrumentation didn't work or was filtered by users, we still want to trace the handler.
339+
// TODO(v9): Since bumping the OTEL Instrumentation, this is likely not needed anymore, we can possibly remove this
339340
if (options.startTrace && !isWrappedByOtel(handler)) {
340341
const traceData = getAwsTraceData(event as { headers?: Record<string, string> }, context);
341342

packages/nextjs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@
7777
},
7878
"dependencies": {
7979
"@opentelemetry/api": "^1.9.0",
80-
"@opentelemetry/instrumentation-http": "0.53.0",
81-
"@opentelemetry/semantic-conventions": "^1.27.0",
80+
"@opentelemetry/semantic-conventions": "^1.28.0",
8281
"@rollup/plugin-commonjs": "28.0.1",
8382
"@sentry-internal/browser-utils": "8.42.0",
8483
"@sentry/core": "8.42.0",

packages/node/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@
6868
"@opentelemetry/api": "^1.9.0",
6969
"@opentelemetry/context-async-hooks": "^1.25.1",
7070
"@opentelemetry/core": "^1.25.1",
71-
"@opentelemetry/instrumentation": "^0.54.0",
72-
"@opentelemetry/instrumentation-amqplib": "^0.43.0",
73-
"@opentelemetry/instrumentation-connect": "0.40.0",
74-
"@opentelemetry/instrumentation-dataloader": "0.12.0",
75-
"@opentelemetry/instrumentation-express": "0.44.0",
76-
"@opentelemetry/instrumentation-fastify": "0.41.0",
77-
"@opentelemetry/instrumentation-fs": "0.16.0",
71+
"@opentelemetry/instrumentation": "^0.55.0",
72+
"@opentelemetry/instrumentation-amqplib": "^0.44.0",
73+
"@opentelemetry/instrumentation-connect": "0.41.0",
74+
"@opentelemetry/instrumentation-dataloader": "0.14.0",
75+
"@opentelemetry/instrumentation-express": "0.45.0",
76+
"@opentelemetry/instrumentation-fastify": "0.42.0",
77+
"@opentelemetry/instrumentation-fs": "0.17.0",
7878
"@opentelemetry/instrumentation-generic-pool": "0.39.0",
7979
"@opentelemetry/instrumentation-graphql": "0.44.0",
8080
"@opentelemetry/instrumentation-hapi": "0.41.0",
81-
"@opentelemetry/instrumentation-http": "0.53.0",
81+
"@opentelemetry/instrumentation-http": "0.55.0",
8282
"@opentelemetry/instrumentation-ioredis": "0.43.0",
8383
"@opentelemetry/instrumentation-kafkajs": "0.4.0",
8484
"@opentelemetry/instrumentation-knex": "0.41.0",
@@ -94,8 +94,8 @@
9494
"@opentelemetry/instrumentation-tedious": "0.15.0",
9595
"@opentelemetry/instrumentation-undici": "0.6.0",
9696
"@opentelemetry/resources": "^1.26.0",
97-
"@opentelemetry/sdk-trace-base": "^1.26.0",
98-
"@opentelemetry/semantic-conventions": "^1.27.0",
97+
"@opentelemetry/sdk-trace-base": "^1.28.0",
98+
"@opentelemetry/semantic-conventions": "^1.28.0",
9999
"@prisma/instrumentation": "5.19.1",
100100
"@sentry/core": "8.42.0",
101101
"@sentry/opentelemetry": "8.42.0",

packages/node/src/integrations/http/SentryHttpInstrumentation.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type * as https from 'node:https';
44
import { VERSION } from '@opentelemetry/core';
55
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
66
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
7-
import { getRequestInfo } from '@opentelemetry/instrumentation-http';
87
import type { RequestEventData, SanitizedRequestData, Scope } from '@sentry/core';
98
import {
109
addBreadcrumb,
@@ -21,7 +20,7 @@ import {
2120
import { DEBUG_BUILD } from '../../debug-build';
2221
import type { NodeClient } from '../../sdk/client';
2322
import { getRequestUrl } from '../../utils/getRequestUrl';
24-
23+
import { getRequestInfo } from './vendor/getRequestInfo';
2524
type Http = typeof http;
2625
type Https = typeof https;
2726

@@ -196,7 +195,7 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
196195
? (argsCopy.shift() as http.RequestOptions)
197196
: undefined;
198197

199-
const { optionsParsed } = getRequestInfo(options, extraOptions);
198+
const { optionsParsed } = getRequestInfo(instrumentation._diag, options, extraOptions);
200199

201200
const request = original.apply(this, args) as ReturnType<typeof http.request>;
202201

0 commit comments

Comments
 (0)