|
1 | 1 | 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'; |
2 | 4 | import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core'; |
3 | 5 | import { createTransport, NodeClient, setCurrentClient } from '@sentry/node'; |
4 | 6 | import * as fs from 'fs'; |
@@ -76,23 +78,23 @@ describe('GoogleCloudHttp tracing', () => { |
76 | 78 | const resp = await bigquery.query('SELECT true AS foo'); |
77 | 79 | expect(resp).toEqual([[{ foo: true }]]); |
78 | 80 | expect(mockStartInactiveSpan).toBeCalledWith({ |
79 | | - op: 'http.client', |
80 | 81 | name: 'POST /jobs', |
81 | 82 | onlyIfParent: true, |
82 | 83 | attributes: { |
| 84 | + [SENTRY_OP]: WEB_SERVER_HTTP_CLIENT_SPAN_OP, |
83 | 85 | [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', |
86 | 88 | }, |
87 | 89 | }); |
88 | 90 | expect(mockStartInactiveSpan).toBeCalledWith({ |
89 | | - op: 'http.client', |
90 | 91 | name: expect.stringMatching(/^GET \/queries\/.+/), |
91 | 92 | onlyIfParent: true, |
92 | 93 | attributes: { |
| 94 | + [SENTRY_OP]: WEB_SERVER_HTTP_CLIENT_SPAN_OP, |
93 | 95 | [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', |
96 | 98 | }, |
97 | 99 | }); |
98 | 100 | }); |
|
0 commit comments