File tree Expand file tree Collapse file tree 11 files changed +32
-25
lines changed
google-cloud-serverless/src Expand file tree Collapse file tree 11 files changed +32
-25
lines changed Original file line number Diff line number Diff line change 90
90
- Deprecated ` processThreadBreadcrumbIntegration ` in favor of ` childProcessIntegration ` . Functionally they are the same.
91
91
- Deprecated ` nestIntegration ` . Use the NestJS SDK (` @sentry/nestjs ` ) instead.
92
92
- Deprecated ` setupNestErrorHandler ` . Use the NestJS SDK (` @sentry/nestjs ` ) instead.
93
+ - Deprecated ` addOpenTelemetryInstrumentation ` . Use the ` openTelemetryInstrumentations ` option in ` Sentry.init() ` or your custom Sentry Client instead.
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export {
11
11
addBreadcrumb ,
12
12
addEventProcessor ,
13
13
addIntegration ,
14
+ // eslint-disable-next-line deprecation/deprecation
14
15
addOpenTelemetryInstrumentation ,
15
16
// eslint-disable-next-line deprecation/deprecation
16
17
addRequestDataToEvent ,
Original file line number Diff line number Diff line change 64
64
"access" : " public"
65
65
},
66
66
"dependencies" : {
67
+ "@opentelemetry/instrumentation" : " ^0.54.0" ,
67
68
"@opentelemetry/instrumentation-aws-lambda" : " 0.44.0" ,
68
69
"@opentelemetry/instrumentation-aws-sdk" : " 0.45.0" ,
69
70
"@sentry/core" : " 8.40.0" ,
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export {
120
120
spanToTraceHeader ,
121
121
spanToBaggageHeader ,
122
122
trpcMiddleware ,
123
+ // eslint-disable-next-line deprecation/deprecation
123
124
addOpenTelemetryInstrumentation ,
124
125
zodErrorsIntegration ,
125
126
profiler ,
Original file line number Diff line number Diff line change
1
+ import { registerInstrumentations } from '@opentelemetry/instrumentation' ;
1
2
import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk' ;
2
3
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , defineIntegration } from '@sentry/core' ;
3
- import { addOpenTelemetryInstrumentation } from '@sentry/node' ;
4
- import type { IntegrationFn } from '@sentry/types' ;
5
4
6
- const _awsIntegration = ( ( ) => {
5
+ /**
6
+ * Instrumentation for aws-sdk package
7
+ */
8
+ export const awsIntegration = defineIntegration ( ( ) => {
7
9
return {
8
10
name : 'Aws' ,
9
11
setupOnce ( ) {
10
- addOpenTelemetryInstrumentation (
11
- new AwsInstrumentation ( {
12
- preRequestHook ( span ) {
13
- span . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , 'auto.otel.aws' ) ;
14
- } ,
15
- } ) ,
16
- ) ;
12
+ registerInstrumentations ( {
13
+ instrumentations : [
14
+ new AwsInstrumentation ( {
15
+ preRequestHook ( span ) {
16
+ span . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , 'auto.otel.aws' ) ;
17
+ } ,
18
+ } ) ,
19
+ ] ,
20
+ } ) ;
17
21
} ,
18
22
} ;
19
- } ) satisfies IntegrationFn ;
20
-
21
- /**
22
- * Instrumentation for aws-sdk package
23
- */
24
- export const awsIntegration = defineIntegration ( _awsIntegration ) ;
23
+ } ) ;
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ export {
140
140
spanToTraceHeader ,
141
141
spanToBaggageHeader ,
142
142
trpcMiddleware ,
143
+ // eslint-disable-next-line deprecation/deprecation
143
144
addOpenTelemetryInstrumentation ,
144
145
zodErrorsIntegration ,
145
146
profiler ,
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ export {
117
117
spanToTraceHeader ,
118
118
spanToBaggageHeader ,
119
119
trpcMiddleware ,
120
+ // eslint-disable-next-line deprecation/deprecation
120
121
addOpenTelemetryInstrumentation ,
121
122
zodErrorsIntegration ,
122
123
profiler ,
Original file line number Diff line number Diff line change 1
1
import { context , propagation , trace } from '@opentelemetry/api' ;
2
+ import { registerInstrumentations } from '@opentelemetry/instrumentation' ;
2
3
import type { UndiciRequest , UndiciResponse } from '@opentelemetry/instrumentation-undici' ;
3
4
import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici' ;
4
5
import {
@@ -9,11 +10,7 @@ import {
9
10
hasTracingEnabled ,
10
11
} from '@sentry/core' ;
11
12
import { getBreadcrumbLogLevelFromHttpStatusCode , getSanitizedUrlString , parseUrl } from '@sentry/core' ;
12
- import {
13
- addOpenTelemetryInstrumentation ,
14
- generateSpanContextForPropagationContext ,
15
- getPropagationContextFromSpan ,
16
- } from '@sentry/opentelemetry' ;
13
+ import { generateSpanContextForPropagationContext , getPropagationContextFromSpan } from '@sentry/opentelemetry' ;
17
14
import type { IntegrationFn , SanitizedRequestData } from '@sentry/types' ;
18
15
19
16
interface NodeFetchOptions {
@@ -94,7 +91,7 @@ const _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {
94
91
} ,
95
92
} ) ;
96
93
97
- addOpenTelemetryInstrumentation ( instrumentation ) ;
94
+ registerInstrumentations ( { instrumentations : [ instrumentation ] } ) ;
98
95
} ,
99
96
} ;
100
97
} ) satisfies IntegrationFn ;
Original file line number Diff line number Diff line change 1
- import type { Instrumentation } from '@opentelemetry/instrumentation' ;
2
- import { addOpenTelemetryInstrumentation } from '@sentry/opentelemetry' ;
1
+ import { type Instrumentation , registerInstrumentations } from '@opentelemetry/instrumentation' ;
3
2
4
3
/** Exported only for tests. */
5
4
export const INSTRUMENTED : Record < string , Instrumentation > = { } ;
@@ -26,7 +25,9 @@ export function generateInstrumentOnce<Options = unknown>(
26
25
const instrumentation = creator ( options ) ;
27
26
INSTRUMENTED [ name ] = instrumentation ;
28
27
29
- addOpenTelemetryInstrumentation ( instrumentation ) ;
28
+ registerInstrumentations ( {
29
+ instrumentations : [ instrumentation ] ,
30
+ } ) ;
30
31
} ,
31
32
{ id : name } ,
32
33
) ;
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export {
53
53
54
54
export { openTelemetrySetupCheck } from './utils/setupCheck' ;
55
55
56
+ // eslint-disable-next-line deprecation/deprecation
56
57
export { addOpenTelemetryInstrumentation } from './instrumentation' ;
57
58
58
59
// Legacy
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import { registerInstrumentations } from '@opentelemetry/instrumentation';
4
4
/**
5
5
* This method takes an OpenTelemetry instrumentation or
6
6
* array of instrumentations and registers them with OpenTelemetry.
7
+ *
8
+ * @deprecated This method will be removed in the next major version of the SDK.
9
+ * Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead.
7
10
*/
8
11
export function addOpenTelemetryInstrumentation ( ...instrumentations : Instrumentation [ ] ) : void {
9
12
registerInstrumentations ( {
You can’t perform that action at this time.
0 commit comments