Skip to content

Commit 43dfada

Browse files
committed
review suggestions
1 parent e4d2ced commit 43dfada

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎packages/google-cloud-serverless/src/gcpfunction/events.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
GCP_FUNCTION_CONTEXT_EVENT_ID,
88
GCP_FUNCTION_CONTEXT_RESOURCE,
99
GCP_FUNCTION_CONTEXT_TIMESTAMP,
10+
SENTRY_ORIGIN,
1011
} from '@sentry/conventions/attributes';
1112
import { FUNCTION_GCP } from '@sentry/conventions/op';
1213
import {
1314
debug,
1415
getClient,
1516
handleCallbackErrors,
1617
hasSpanStreamingEnabled,
17-
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
1818
SERVERLESS_FUNCTION_SPAN_NAME_FALLBACK,
1919
} from '@sentry/core';
2020
import { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';
@@ -66,8 +66,7 @@ function _wrapEventFunction<F extends EventFunction | EventFunctionWithCallback>
6666
[FAAS_NAME]: functionName,
6767
[FAAS_TRIGGER]: 'event',
6868
[SENTRY_SEGMENT_NAME_SOURCE]: 'component',
69-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',
70-
// not yet in conventions but this attribute will also determine the span description
69+
[SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',
7170
[GCP_FUNCTION_CONTEXT_EVENT_TYPE]: context.eventType,
7271
[GCP_FUNCTION_CONTEXT_EVENT_ID]: context.eventId,
7372
[GCP_FUNCTION_CONTEXT_RESOURCE]: context.resource,

‎packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ describe('wrapCloudEventFunction', () => {
312312
const wrappedHandler = wrapCloudEventFunction(handler);
313313
await expect(handleCloudEvent(wrappedHandler)).rejects.toThrowError(error);
314314

315-
const expectedStartSapanOptions = {
315+
const expectedStartSpanOptions = {
316316
name: 'google.cloud.pubsub.topic.v1.messagePublished',
317317
attributes: {
318318
[SENTRY_OP]: FUNCTION_GCP,
@@ -328,7 +328,7 @@ describe('wrapCloudEventFunction', () => {
328328
},
329329
};
330330

331-
expect(mockStartSpanManual).toBeCalledWith(expectedStartSapanOptions, expect.any(Function));
331+
expect(mockStartSpanManual).toBeCalledWith(expectedStartSpanOptions, expect.any(Function));
332332
expect(mockCaptureException).toBeCalledWith(error, expect.any(Function));
333333

334334
const scopeFunction = mockCaptureException.mock.calls[0][1];

0 commit comments

Comments
 (0)