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
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ test.describe('Lambda layer', () => {
type: 'Error',
value: 'test',
mechanism: {
type: 'auto.function.aws-serverless.otel',
type: 'auto.function.aws_serverless.otel',
handled: false,
},
}),
Expand Down Expand Up @@ -188,7 +188,7 @@ test.describe('Lambda layer', () => {
type: 'Error',
value: 'test esm',
mechanism: {
type: 'auto.function.aws-serverless.otel',
type: 'auto.function.aws_serverless.otel',
handled: false,
},
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-serverless/src/integration/awslambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const instrumentAwsLambda = generateInstrumentOnce(
},
responseHook(_span, { err }) {
if (err) {
captureException(err, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.otel'));
captureException(err, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.otel'));
}
},
};
Expand Down
8 changes: 4 additions & 4 deletions packages/aws-serverless/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ export function wrapHandler<TEvent, TResult>(
if (options.captureAllSettledReasons && Array.isArray(rv) && isPromiseAllSettledResult(rv)) {
const reasons = getRejectedReasons(rv);
reasons.forEach(exception => {
captureException(exception, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.promise'));
captureException(exception, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.promise'));
});
}
} catch (e) {
// Errors should already captured in the instrumentation's `responseHook`,
// we capture them here just to be safe. Double captures are deduplicated by the SDK.
captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.handler'));
captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.handler'));
throw e;
} finally {
clearTimeout(timeoutWarningTimer);
Expand Down Expand Up @@ -281,14 +281,14 @@ function wrapStreamingHandler<TEvent, TResult>(
enhanceScopeWithEnvironmentData(scope, context, startTime);

responseStream.on('error', error => {
captureException(error, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.stream'));
captureException(error, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.stream'));
});

return await handler(event, responseStream, context);
} catch (e) {
// Errors should already captured in the instrumentation's `responseHook`,
// we capture them here just to be safe. Double captures are deduplicated by the SDK.
captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.handler'));
captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.handler'));
throw e;
} finally {
if (timeoutWarningTimer) {
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-serverless/test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ describe('AWSLambda', () => {
// @ts-expect-error just mocking around...
expect(evtProcessor!(event).exception.values[0]?.mechanism).toEqual({
handled: false,
type: 'auto.function.aws-serverless.handler',
type: 'auto.function.aws_serverless.handler',
});
}
});
Expand Down Expand Up @@ -576,7 +576,7 @@ describe('AWSLambda', () => {
// @ts-expect-error just mocking around...
expect(evtProcessor(event).exception.values[0]?.mechanism).toEqual({
handled: false,
type: 'auto.function.aws-serverless.handler',
type: 'auto.function.aws_serverless.handler',
});
}
});
Expand Down