Skip to content

Commit 632b096

Browse files
committed
rename constant
1 parent 4790096 commit 632b096

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/instrumentation-browser-navigation/src/instrumentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT =
3434
'browser.navigation.same_document';
3535
export const ATTR_BROWSER_NAVIGATION_HASH_CHANGE =
3636
'browser.navigation.hash_change';
37-
export const ATTR_BROWSER_NAVIGATION_HASH_TYPE = 'browser.navigation.type';
37+
export const ATTR_BROWSER_NAVIGATION_TYPE = 'browser.navigation.type';
3838

3939
export class BrowserNavigationInstrumentation extends InstrumentationBase<BrowserNavigationInstrumentationConfig> {
4040
applyCustomLogRecordData: ApplyCustomLogRecordDataFunction | undefined =
@@ -113,7 +113,7 @@ export class BrowserNavigationInstrumentation extends InstrumentationBase<Browse
113113
[ATTR_URL_FULL]: this.sanitizeUrl(currentUrl),
114114
[ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT]: sameDocument,
115115
[ATTR_BROWSER_NAVIGATION_HASH_CHANGE]: hashChange,
116-
...(navType ? { [ATTR_BROWSER_NAVIGATION_HASH_TYPE]: navType } : {}),
116+
...(navType ? { [ATTR_BROWSER_NAVIGATION_TYPE]: navType } : {}),
117117
},
118118
};
119119
this._applyCustomLogRecordData(navLogRecord, this.applyCustomLogRecordData);

packages/instrumentation-browser-navigation/test/navigation.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
EVENT_NAME,
2828
ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT,
2929
ATTR_BROWSER_NAVIGATION_HASH_CHANGE,
30-
ATTR_BROWSER_NAVIGATION_HASH_TYPE,
30+
ATTR_BROWSER_NAVIGATION_TYPE,
3131
} from '../src/instrumentation';
3232
import { ATTR_URL_FULL } from '@opentelemetry/semantic-conventions';
3333
import { logs } from '@opentelemetry/api-logs';
@@ -157,7 +157,7 @@ describe('Browser Navigation Instrumentation', () => {
157157
false
158158
);
159159
assert.strictEqual(
160-
(testRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_HASH_TYPE],
160+
(testRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_TYPE],
161161
'push'
162162
);
163163
assert.strictEqual(
@@ -204,7 +204,7 @@ describe('Browser Navigation Instrumentation', () => {
204204
false
205205
);
206206
assert.strictEqual(
207-
(navLogRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_HASH_TYPE],
207+
(navLogRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_TYPE],
208208
'replace'
209209
);
210210
assert.strictEqual(
@@ -314,7 +314,7 @@ describe('Browser Navigation Instrumentation', () => {
314314
);
315315
// Accept either 'push' or 'traverse' as browsers may vary
316316
const navType = (hashChangeRecord.attributes as any)[
317-
ATTR_BROWSER_NAVIGATION_HASH_TYPE
317+
ATTR_BROWSER_NAVIGATION_TYPE
318318
];
319319
assert.ok(
320320
navType === 'push' || navType === 'traverse',
@@ -368,7 +368,7 @@ describe('Browser Navigation Instrumentation', () => {
368368
false
369369
);
370370
assert.strictEqual(
371-
(navLogRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_HASH_TYPE],
371+
(navLogRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_TYPE],
372372
'traverse'
373373
);
374374
window.removeEventListener('popstate', popstateHandler);
@@ -549,7 +549,7 @@ describe('Browser Navigation Instrumentation', () => {
549549
assert.ok(typeof hashChange === 'boolean');
550550

551551
const navType = (navLogRecord.attributes as any)[
552-
ATTR_BROWSER_NAVIGATION_HASH_TYPE
552+
ATTR_BROWSER_NAVIGATION_TYPE
553553
];
554554
assert.ok(navType === 'push' || navType === 'traverse');
555555
cleanup();
@@ -696,7 +696,7 @@ describe('Browser Navigation Instrumentation', () => {
696696
assert.ok(testRecord, 'Should find navigation record for our test URL');
697697
assert.strictEqual(testRecord.eventName, EVENT_NAME);
698698
assert.strictEqual(
699-
(testRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_HASH_TYPE],
699+
(testRecord.attributes as any)[ATTR_BROWSER_NAVIGATION_TYPE],
700700
'push'
701701
);
702702
assert.strictEqual(

0 commit comments

Comments
 (0)