Skip to content

Commit a747a97

Browse files
committed
fix test
1 parent 64b75b0 commit a747a97

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

packages/google-cloud-serverless/test/integrations/google-cloud-http.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { BigQuery } from '@google-cloud/bigquery';
2+
import { HTTP_REQUEST_METHOD, SENTRY_OP, SERVER_ADDRESS } from '@sentry/conventions/attributes';
3+
import { WEB_SERVER_HTTP_CLIENT_SPAN_OP } from '@sentry/conventions/op';
24
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
35
import { createTransport, NodeClient, setCurrentClient } from '@sentry/node';
46
import * as fs from 'fs';
@@ -76,23 +78,23 @@ describe('GoogleCloudHttp tracing', () => {
7678
const resp = await bigquery.query('SELECT true AS foo');
7779
expect(resp).toEqual([[{ foo: true }]]);
7880
expect(mockStartInactiveSpan).toBeCalledWith({
79-
op: 'http.client',
8081
name: 'POST /jobs',
8182
onlyIfParent: true,
8283
attributes: {
84+
[SENTRY_OP]: WEB_SERVER_HTTP_CLIENT_SPAN_OP,
8385
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',
84-
'http.request.method': 'POST',
85-
'server.address': 'bigquery.googleapis.com',
86+
[HTTP_REQUEST_METHOD]: 'POST',
87+
[SERVER_ADDRESS]: 'bigquery.googleapis.com',
8688
},
8789
});
8890
expect(mockStartInactiveSpan).toBeCalledWith({
89-
op: 'http.client',
9091
name: expect.stringMatching(/^GET \/queries\/.+/),
9192
onlyIfParent: true,
9293
attributes: {
94+
[SENTRY_OP]: WEB_SERVER_HTTP_CLIENT_SPAN_OP,
9395
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',
94-
'http.request.method': 'GET',
95-
'server.address': 'bigquery.googleapis.com',
96+
[HTTP_REQUEST_METHOD]: 'GET',
97+
[SERVER_ADDRESS]: 'bigquery.googleapis.com',
9698
},
9799
});
98100
});

0 commit comments

Comments
 (0)