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 @@ -88,3 +88,4 @@ If you are relying on `undefined` being passed in and having tracing enabled bec
8888- Deprecated ` processThreadBreadcrumbIntegration ` in favor of ` childProcessIntegration ` . Functionally they are the same.
8989- Deprecated ` nestIntegration ` . Use the NestJS SDK (` @sentry/nestjs ` ) instead.
9090- Deprecated ` setupNestErrorHandler ` . Use the NestJS SDK (` @sentry/nestjs ` ) instead.
91+ - 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 {
1111 addBreadcrumb ,
1212 addEventProcessor ,
1313 addIntegration ,
14+ // eslint-disable-next-line deprecation/deprecation
1415 addOpenTelemetryInstrumentation ,
1516 // eslint-disable-next-line deprecation/deprecation
1617 addRequestDataToEvent ,
Original file line number Diff line number Diff line change 6464 "access" : " public"
6565 },
6666 "dependencies" : {
67+ "@opentelemetry/instrumentation" : " ^0.54.0" ,
6768 "@opentelemetry/instrumentation-aws-lambda" : " 0.44.0" ,
6869 "@opentelemetry/instrumentation-aws-sdk" : " 0.45.0" ,
6970 "@sentry/core" : " 8.40.0" ,
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export {
120120 spanToTraceHeader ,
121121 spanToBaggageHeader ,
122122 trpcMiddleware ,
123+ // eslint-disable-next-line deprecation/deprecation
123124 addOpenTelemetryInstrumentation ,
124125 zodErrorsIntegration ,
125126 profiler ,
Original file line number Diff line number Diff line change 1+ import { registerInstrumentations } from '@opentelemetry/instrumentation' ;
12import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk' ;
23import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN , defineIntegration } from '@sentry/core' ;
3- import { addOpenTelemetryInstrumentation } from '@sentry/node' ;
4- import type { IntegrationFn } from '@sentry/types' ;
54
6- const _awsIntegration = ( ( ) => {
5+ /**
6+ * Instrumentation for aws-sdk package
7+ */
8+ export const awsIntegration = defineIntegration ( ( ) => {
79 return {
810 name : 'Aws' ,
911 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+ } ) ;
1721 } ,
1822 } ;
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 {
140140 spanToTraceHeader ,
141141 spanToBaggageHeader ,
142142 trpcMiddleware ,
143+ // eslint-disable-next-line deprecation/deprecation
143144 addOpenTelemetryInstrumentation ,
144145 zodErrorsIntegration ,
145146 profiler ,
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ export {
117117 spanToTraceHeader ,
118118 spanToBaggageHeader ,
119119 trpcMiddleware ,
120+ // eslint-disable-next-line deprecation/deprecation
120121 addOpenTelemetryInstrumentation ,
121122 zodErrorsIntegration ,
122123 profiler ,
Original file line number Diff line number Diff line change 11import { context , propagation , trace } from '@opentelemetry/api' ;
2+ import { registerInstrumentations } from '@opentelemetry/instrumentation' ;
23import type { UndiciRequest , UndiciResponse } from '@opentelemetry/instrumentation-undici' ;
34import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici' ;
45import {
@@ -9,11 +10,7 @@ import {
910 hasTracingEnabled ,
1011} from '@sentry/core' ;
1112import { 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' ;
1714import type { IntegrationFn , SanitizedRequestData } from '@sentry/types' ;
1815
1916interface NodeFetchOptions {
@@ -94,7 +91,7 @@ const _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {
9491 } ,
9592 } ) ;
9693
97- addOpenTelemetryInstrumentation ( instrumentation ) ;
94+ registerInstrumentations ( { instrumentations : [ instrumentation ] } ) ;
9895 } ,
9996 } ;
10097} ) 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' ;
32
43/** Exported only for tests. */
54export const INSTRUMENTED : Record < string , Instrumentation > = { } ;
@@ -26,7 +25,9 @@ export function generateInstrumentOnce<Options = unknown>(
2625 const instrumentation = creator ( options ) ;
2726 INSTRUMENTED [ name ] = instrumentation ;
2827
29- addOpenTelemetryInstrumentation ( instrumentation ) ;
28+ registerInstrumentations ( {
29+ instrumentations : [ instrumentation ] ,
30+ } ) ;
3031 } ,
3132 { id : name } ,
3233 ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export {
4646
4747export { openTelemetrySetupCheck } from './utils/setupCheck' ;
4848
49+ // eslint-disable-next-line deprecation/deprecation
4950export { addOpenTelemetryInstrumentation } from './instrumentation' ;
5051
5152// Legacy
You can’t perform that action at this time.
0 commit comments