Skip to content

Commit ab72f62

Browse files
committed
more renaming
1 parent 52f6d98 commit ab72f62

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

packages/node/test/integrations/http.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as sentryCore from '@sentry/core';
22
import { Hub } from '@sentry/hub';
33
import * as hubModule from '@sentry/hub';
4-
import { addExtensionMethods, Span, TRACEPARENT_REGEXP, Transaction } from '@sentry/tracing';
4+
import { addExtensionMethods, SENTRY_TRACE_REGEX, Span, Transaction } from '@sentry/tracing';
55
import * as http from 'http';
66
import * as nock from 'nock';
77

@@ -77,7 +77,7 @@ describe('tracing', () => {
7777

7878
expect(sentryTraceHeader).toBeDefined();
7979
expect(tracestateHeader).toBeDefined();
80-
expect(TRACEPARENT_REGEXP.test(sentryTraceHeader as string)).toBe(true);
80+
expect(SENTRY_TRACE_REGEX.test(sentryTraceHeader as string)).toBe(true);
8181
});
8282

8383
it("doesn't attach tracing headers to outgoing sentry requests", () => {

packages/tracing/src/span.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,11 @@ export class Span implements SpanInterface {
380380
// `dsn.publicKey` required and remove the `!`.
381381

382382
return `sentry=${computeTracestateValue({
383-
trace_id: this.traceId,
383+
traceId: this.traceId,
384384
environment,
385385
release,
386386
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
387-
public_key: dsn.publicKey!,
387+
publicKey: dsn.publicKey!,
388388
})}`;
389389
}
390390
}

packages/tracing/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ export function secToMs(time: number): number {
147147
export { stripUrlQueryAndFragment } from '@sentry/utils';
148148

149149
type SentryTracestateData = {
150-
trace_id: string;
150+
traceId: string;
151151
environment: string | undefined | null;
152152
release: string | undefined | null;
153-
public_key: string;
153+
publicKey: string;
154154
};
155155

156156
/**

packages/tracing/test/browser/request.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ describe('callbacks', () => {
241241

242242
expect(setRequestHeader).toHaveBeenCalledWith(
243243
'sentry-trace',
244-
expect.stringMatching(tracingUtils.TRACEPARENT_REGEXP),
244+
expect.stringMatching(tracingUtils.SENTRY_TRACE_REGEX),
245245
);
246246
expect(setRequestHeader).toHaveBeenCalledWith('tracestate', expect.stringMatching(TRACESTATE_HEADER_REGEX));
247247
});

packages/tracing/test/hub.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { logger } from '@sentry/utils';
99
import { BrowserTracing } from '../src/browser/browsertracing';
1010
import { addExtensionMethods } from '../src/hubextensions';
1111
import { Transaction } from '../src/transaction';
12-
import { computeTracestateValue, extractSentrytraceData, TRACEPARENT_REGEXP } from '../src/utils';
12+
import { computeTracestateValue, extractSentrytraceData, SENTRY_TRACE_REGEX } from '../src/utils';
1313
import { addDOMPropertiesToGlobal, getSymbolObjectKeyByName, testOnlyIfNodeVersionAtLeast } from './testutils';
1414

1515
addExtensionMethods();
@@ -63,10 +63,10 @@ describe('Hub', () => {
6363
const transaction = hub.startTransaction({ name: 'FETCH /ball' });
6464

6565
const b64Value = computeTracestateValue({
66-
trace_id: transaction.traceId,
66+
traceId: transaction.traceId,
6767
environment,
6868
release,
69-
public_key: 'dogsarebadatkeepingsecrets',
69+
publicKey: 'dogsarebadatkeepingsecrets',
7070
});
7171

7272
expect(transaction.metadata?.tracestate?.sentry).toEqual(`sentry=${b64Value}`);
@@ -81,10 +81,10 @@ describe('Hub', () => {
8181
const transaction = getCurrentHub().startTransaction({ name: 'FETCH /ball' });
8282

8383
const b64Value = computeTracestateValue({
84-
trace_id: transaction.traceId,
84+
traceId: transaction.traceId,
8585
environment: 'production',
8686
release,
87-
public_key: 'dogsarebadatkeepingsecrets',
87+
publicKey: 'dogsarebadatkeepingsecrets',
8888
});
8989

9090
expect(transaction.metadata?.tracestate?.sentry).toEqual(`sentry=${b64Value}`);
@@ -404,7 +404,7 @@ describe('Hub', () => {
404404

405405
// check that sentry-trace header is added to request
406406
expect(headers).toEqual(
407-
expect.objectContaining({ 'sentry-trace': expect.stringMatching(TRACEPARENT_REGEXP) }),
407+
expect.objectContaining({ 'sentry-trace': expect.stringMatching(SENTRY_TRACE_REGEX) }),
408408
);
409409

410410
// check that sampling decision is passed down correctly
@@ -446,7 +446,7 @@ describe('Hub', () => {
446446

447447
// check that sentry-trace header is added to request
448448
expect(headers).toEqual(
449-
expect.objectContaining({ 'sentry-trace': expect.stringMatching(TRACEPARENT_REGEXP) }),
449+
expect.objectContaining({ 'sentry-trace': expect.stringMatching(SENTRY_TRACE_REGEX) }),
450450
);
451451

452452
// check that sampling decision is passed down correctly

packages/tracing/test/span.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BrowserClient } from '@sentry/browser';
22
import { Hub, Scope } from '@sentry/hub';
33

44
import { Span, SpanStatus, Transaction } from '../src';
5-
import { TRACEPARENT_REGEXP } from '../src/utils';
5+
import { SENTRY_TRACE_REGEX } from '../src/utils';
66

77
describe('Span', () => {
88
let hub: Hub;
@@ -94,10 +94,10 @@ describe('Span', () => {
9494

9595
describe('toTraceparent', () => {
9696
test('simple', () => {
97-
expect(new Span().toTraceparent()).toMatch(TRACEPARENT_REGEXP);
97+
expect(new Span().toTraceparent()).toMatch(SENTRY_TRACE_REGEX);
9898
});
9999
test('with sample', () => {
100-
expect(new Span({ sampled: true }).toTraceparent()).toMatch(TRACEPARENT_REGEXP);
100+
expect(new Span({ sampled: true }).toTraceparent()).toMatch(SENTRY_TRACE_REGEX);
101101
});
102102
});
103103

0 commit comments

Comments
 (0)