Skip to content

Commit 916e70a

Browse files
authored
Merge branch 'develop' into ab/sentry-tracer-provider
2 parents 34725df + e856eb4 commit 916e70a

148 files changed

Lines changed: 542 additions & 2029 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"type": "module",
55
"private": true,
66
"dependencies": {
7-
"@react-router/node": "latest",
8-
"@react-router/serve": "latest",
7+
"@react-router/node": "^7",
8+
"@react-router/serve": "^7",
99
"@sentry/react-router": "file:../../packed/sentry-react-router-packed.tgz",
1010
"ioredis": "^5.4.1",
1111
"isbot": "^5.1.17",
1212
"react": "^18.3.1",
1313
"react-dom": "^18.3.1",
14-
"react-router": "latest"
14+
"react-router": "^7"
1515
},
1616
"devDependencies": {
1717
"@playwright/test": "~1.56.0",
18-
"@react-router/dev": "latest",
18+
"@react-router/dev": "^7",
1919
"@sentry-internal/test-utils": "link:../../../test-utils",
2020
"@types/node": "^20",
2121
"@types/react": "18.3.1",

dev-packages/e2e-tests/test-applications/react-router-7-framework/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"scripts": {
2727
"build": "react-router build",
28-
"test:build-latest": "pnpm install && pnpm add react-router@latest && pnpm add @react-router/node@latest && pnpm add @react-router/serve@latest && pnpm build",
28+
"test:build-latest": "pnpm install && pnpm add react-router@7 && pnpm add @react-router/node@7 && pnpm add @react-router/serve@7 && pnpm build",
2929
"dev": "NODE_OPTIONS='--import ./instrument.mjs' react-router dev",
3030
"start": "NODE_OPTIONS='--import ./instrument.mjs' react-router-serve ./build/server/index.js",
3131
"proxy": "node start-event-proxy.mjs",

dev-packages/node-integration-tests/suites/tracing/hapi/scenario.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ const run = async () => {
5151
},
5252
});
5353

54+
// Route registered via a plugin produces a `plugin.hapi` span.
55+
await server.register({
56+
name: 'testPlugin',
57+
version: '1.0.0',
58+
register: async function (pluginServer) {
59+
pluginServer.route({
60+
method: 'GET',
61+
path: '/plugin-route',
62+
handler: () => 'Hello from plugin!',
63+
});
64+
},
65+
});
66+
67+
// Server extension produces a `server.ext.hapi` span.
68+
server.ext('onPreResponse', (request, h) => h.continue);
69+
5470
await Sentry.setupHapiErrorHandler(server);
5571
await server.start();
5672

dev-packages/node-integration-tests/suites/tracing/hapi/test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,43 @@ describe('hapi auto-instrumentation', () => {
4343
await runner.completed();
4444
});
4545

46+
test('should instrument plugin routes and server extensions.', async () => {
47+
const runner = createRunner()
48+
.expect({
49+
transaction: {
50+
transaction: 'GET /plugin-route',
51+
spans: expect.arrayContaining([
52+
expect.objectContaining({
53+
description: 'GET /plugin-route',
54+
op: 'plugin.hapi',
55+
origin: 'auto.http.otel.hapi',
56+
data: expect.objectContaining({
57+
'http.route': '/plugin-route',
58+
'hapi.type': 'plugin',
59+
'hapi.plugin.name': 'testPlugin',
60+
'sentry.op': 'plugin.hapi',
61+
'sentry.origin': 'auto.http.otel.hapi',
62+
}),
63+
}),
64+
expect.objectContaining({
65+
description: 'ext - onPreResponse',
66+
op: 'server.ext.hapi',
67+
origin: 'auto.http.otel.hapi',
68+
data: expect.objectContaining({
69+
'hapi.type': 'server.ext',
70+
'server.ext.type': 'onPreResponse',
71+
'sentry.op': 'server.ext.hapi',
72+
'sentry.origin': 'auto.http.otel.hapi',
73+
}),
74+
}),
75+
]),
76+
},
77+
})
78+
.start();
79+
runner.makeRequest('get', '/plugin-route');
80+
await runner.completed();
81+
});
82+
4683
test('should handle returned plain errors in routes.', async () => {
4784
const runner = createRunner()
4885
.expect({

packages/aws-serverless/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@opentelemetry/api": "^1.9.1",
7070
"@opentelemetry/core": "^2.6.1",
7171
"@opentelemetry/instrumentation": "^0.214.0",
72-
"@opentelemetry/semantic-conventions": "^1.40.0",
72+
"@sentry/conventions": "^0.12.0",
7373
"@sentry/core": "10.58.0",
7474
"@sentry/node": "10.58.0",
7575
"@sentry/node-core": "10.58.0",

packages/aws-serverless/src/integration/aws/vendored/aws-sdk.ts

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright The OpenTelemetry Authors
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* SPDX-License-Identifier: Apache-2.0
154
*
165
* NOTICE from the Sentry authors:
176
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-aws-sdk
@@ -21,7 +10,7 @@
2110
*/
2211

2312
import { Span, SpanKind, context, trace, diag, SpanStatusCode } from '@opentelemetry/api';
24-
import { AttributeNames } from './enums';
13+
import { AWS_REQUEST_EXTENDED_ID, AWS_REQUEST_ID, CLOUD_REGION } from './enums';
2514
import { ServicesExtensions } from './services';
2615
import { AwsSdkInstrumentationConfig, NormalizedRequest, NormalizedResponse } from './types';
2716
import {
@@ -46,7 +35,7 @@ import {
4635
} from './utils';
4736
import { propwrap } from './propwrap';
4837
import { RequestMetadata } from './services/ServiceExtension';
49-
import { ATTR_HTTP_STATUS_CODE } from './semconv';
38+
import { HTTP_STATUS_CODE } from '@sentry/conventions/attributes';
5039
import { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core';
5140

5241
const PACKAGE_NAME = '@sentry/instrumentation-aws-sdk';
@@ -265,7 +254,7 @@ export class AwsInstrumentation extends InstrumentationBase<AwsSdkInstrumentatio
265254
Promise.resolve(regionPromise)
266255
.then(resolvedRegion => {
267256
normalizedRequest.region = resolvedRegion;
268-
span.setAttribute(AttributeNames.CLOUD_REGION, resolvedRegion);
257+
span.setAttribute(CLOUD_REGION, resolvedRegion);
269258
})
270259
.catch(e => {
271260
// there is nothing much we can do in this case.
@@ -284,18 +273,18 @@ export class AwsInstrumentation extends InstrumentationBase<AwsSdkInstrumentatio
284273
.then((response: any) => {
285274
const requestId = response.output?.$metadata?.requestId;
286275
if (requestId) {
287-
span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);
276+
span.setAttribute(AWS_REQUEST_ID, requestId);
288277
}
289278

290279
const httpStatusCode = response.output?.$metadata?.httpStatusCode;
291280
if (httpStatusCode) {
292-
// eslint-disable-next-line typescript/no-deprecated
293-
span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);
281+
// oxlint-disable-next-line typescript/no-deprecated
282+
span.setAttribute(HTTP_STATUS_CODE, httpStatusCode);
294283
}
295284

296285
const extendedRequestId = response.output?.$metadata?.extendedRequestId;
297286
if (extendedRequestId) {
298-
span.setAttribute(AttributeNames.AWS_REQUEST_EXTENDED_ID, extendedRequestId);
287+
span.setAttribute(AWS_REQUEST_EXTENDED_ID, extendedRequestId);
299288
}
300289

301290
const normalizedResponse: NormalizedResponse = {
@@ -313,18 +302,18 @@ export class AwsInstrumentation extends InstrumentationBase<AwsSdkInstrumentatio
313302
.catch((err: any) => {
314303
const requestId = err?.RequestId;
315304
if (requestId) {
316-
span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);
305+
span.setAttribute(AWS_REQUEST_ID, requestId);
317306
}
318307

319308
const httpStatusCode = err?.$metadata?.httpStatusCode;
320309
if (httpStatusCode) {
321-
// eslint-disable-next-line typescript/no-deprecated
322-
span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);
310+
// oxlint-disable-next-line typescript/no-deprecated
311+
span.setAttribute(HTTP_STATUS_CODE, httpStatusCode);
323312
}
324313

325314
const extendedRequestId = err?.extendedRequestId;
326315
if (extendedRequestId) {
327-
span.setAttribute(AttributeNames.AWS_REQUEST_EXTENDED_ID, extendedRequestId);
316+
span.setAttribute(AWS_REQUEST_EXTENDED_ID, extendedRequestId);
328317
}
329318

330319
span.setStatus({

packages/aws-serverless/src/integration/aws/vendored/aws-sdk.types.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright The OpenTelemetry Authors
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* SPDX-License-Identifier: Apache-2.0
154
*
165
* NOTICE from the Sentry authors:
176
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-aws-sdk
Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
11
/*
22
* Copyright The OpenTelemetry Authors
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* SPDX-License-Identifier: Apache-2.0
154
*
165
* NOTICE from the Sentry authors:
176
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-aws-sdk
187
* - Upstream version: @opentelemetry/instrumentation-aws-sdk@0.73.0
198
*/
209

21-
export enum AttributeNames {
22-
AWS_OPERATION = 'aws.operation',
23-
CLOUD_REGION = 'cloud.region',
24-
AWS_SERVICE_API = 'aws.service.api',
25-
AWS_SERVICE_NAME = 'aws.service.name',
26-
AWS_SERVICE_IDENTIFIER = 'aws.service.identifier',
27-
AWS_REQUEST_ID = 'aws.request.id',
28-
AWS_REQUEST_EXTENDED_ID = 'aws.request.extended_id',
29-
AWS_SIGNATURE_VERSION = 'aws.signature.version',
30-
31-
// TODO: Add these semantic attributes to:
32-
// - https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts
33-
// For S3, see specification: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/object-stores/s3.md
34-
AWS_S3_BUCKET = 'aws.s3.bucket',
35-
AWS_KINESIS_STREAM_NAME = 'aws.kinesis.stream.name',
36-
}
10+
export const CLOUD_REGION = 'cloud.region';
11+
export const AWS_REQUEST_ID = 'aws.request.id';
12+
export const AWS_REQUEST_EXTENDED_ID = 'aws.request.extended_id';
13+
export const AWS_S3_BUCKET = 'aws.s3.bucket';
14+
export const AWS_KINESIS_STREAM_NAME = 'aws.kinesis.stream.name';

packages/aws-serverless/src/integration/aws/vendored/propwrap.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright The OpenTelemetry Authors
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* SPDX-License-Identifier: Apache-2.0
154
*
165
* NOTICE from the Sentry authors:
176
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-aws-sdk

packages/aws-serverless/src/integration/aws/vendored/semconv-obsolete.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright The OpenTelemetry Authors
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* SPDX-License-Identifier: Apache-2.0
154
*
165
* NOTICE from the Sentry authors:
176
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-aws-sdk

0 commit comments

Comments
 (0)