Skip to content

Commit

Permalink
♻️ rename internal monitoring files -> telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaudan committed May 23, 2022
1 parent 47ab4e9 commit c6363aa
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/boot/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setDebugMode } from '../domain/internalMonitoring'
import { setDebugMode } from '../domain/telemetry'
import { catchUserErrors } from '../tools/catchUserErrors'
import { assign } from '../tools/utils'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/browser/fetchObservable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monitor, callMonitored } from '../domain/internalMonitoring'
import { monitor, callMonitored } from '../domain/telemetry'
import { instrumentMethod } from '../tools/instrumentMethod'
import { Observable } from '../tools/observable'
import type { Duration, ClocksState } from '../tools/timeUtils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/browser/xhrObservable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monitor } from '../domain/internalMonitoring'
import { monitor } from '../domain/telemetry'
import { instrumentMethodAndCallOriginal } from '../tools/instrumentMethod'
import { Observable } from '../tools/observable'
import type { Duration, RelativeTime, ClocksState } from '../tools/timeUtils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/domain/console/consoleObservable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { callMonitored } from '../internalMonitoring'
import { callMonitored } from '../telemetry'
import { computeStackTrace } from '../tracekit'
import { createHandlingStack, formatErrorMessage, toStackTraceString } from '../../tools/error'
import { mergeObservables, Observable } from '../../tools/observable'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/domain/report/reportObservable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { toStackTraceString } from '../../tools/error'
import { mergeObservables, Observable } from '../../tools/observable'
import { DOM_EVENT, includes, addEventListener, safeTruncate } from '../../tools/utils'
import { monitor } from '../internalMonitoring'
import { monitor } from '../telemetry'
import type { Report, BrowserWindow, ReportType } from './browser.types'

export const RawReportType = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/domain/session/sessionCookieStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CookieOptions } from '../../browser/cookie'
import { getCookie, setCookie } from '../../browser/cookie'
import { isChromium } from '../../tools/browserDetection'
import * as utils from '../../tools/utils'
import { monitor } from '../internalMonitoring'
import { monitor } from '../telemetry'
import type { SessionState } from './sessionStore'
import { SESSION_EXPIRATION_DELAY } from './sessionStore'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/domain/session/sessionManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CookieOptions } from '../../browser/cookie'
import type { Observable } from '../../tools/observable'
import * as utils from '../../tools/utils'
import { monitor } from '../internalMonitoring'
import { monitor } from '../telemetry'
import type { Context } from '../../tools/context'
import { ContextHistory } from '../../tools/contextHistory'
import type { RelativeTime } from '../../tools/timeUtils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/domain/session/sessionStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CookieOptions } from '../../browser/cookie'
import { COOKIE_ACCESS_DELAY } from '../../browser/cookie'
import { Observable } from '../../tools/observable'
import * as utils from '../../tools/utils'
import { monitor } from '../internalMonitoring'
import { monitor } from '../telemetry'
import { retrieveSession, withCookieLockAccess } from './sessionCookieStore'

export interface SessionStore {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export {
InternalMonitoring,
Telemetry,
MonitoringMessage,
monitored,
monitor,
Expand All @@ -11,5 +11,5 @@ export {
setDebugMode,
startInternalMonitoring,
isTelemetryReplicationAllowed,
} from './internalMonitoring'
} from './telemetry'
export * from './telemetryEvent.types'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Context } from '../../tools/context'
import { display } from '../../tools/display'
import type { Configuration } from '../configuration'
import { INTAKE_SITE_US1, INTAKE_SITE_US1_FED } from '../configuration'
import type { InternalMonitoring } from './internalMonitoring'
import type { Telemetry } from './telemetry'
import {
monitor,
monitored,
Expand All @@ -12,7 +12,7 @@ import {
callMonitored,
setDebugMode,
scrubCustomerFrames,
} from './internalMonitoring'
} from './telemetry'
import type { TelemetryEvent, TelemetryErrorEvent } from './telemetryEvent.types'

const configuration: Partial<Configuration> = {
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('internal monitoring', () => {
})

describe('telemetry context', () => {
let internalMonitoring: InternalMonitoring
let internalMonitoring: Telemetry
let notifySpy: jasmine.Spy<(event: TelemetryEvent) => void>

beforeEach(() => {
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('internal monitoring', () => {
})

describe('sampling', () => {
let internalMonitoring: InternalMonitoring
let internalMonitoring: Telemetry
let notifySpy: jasmine.Spy<(event: TelemetryEvent & Context) => void>

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ALLOWED_FRAME_URLS = [
'<anonymous>',
]

export interface InternalMonitoring {
export interface Telemetry {
setTelemetryContextProvider: (provider: () => Context) => void
telemetryEventObservable: Observable<TelemetryEvent & Context>
}
Expand All @@ -50,7 +50,7 @@ const monitoringConfiguration: {

let onInternalMonitoringMessageCollected: ((message: MonitoringMessage) => void) | undefined

export function startInternalMonitoring(configuration: Configuration): InternalMonitoring {
export function startInternalMonitoring(configuration: Configuration): Telemetry {
let telemetryContextProvider: () => Context
const telemetryEventObservable = new Observable<TelemetryEvent & Context>()

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export { defineGlobal, makePublicApi } from './boot/init'
export { initReportObservable, RawReport, RawReportType } from './domain/report/reportObservable'
export {
startInternalMonitoring,
InternalMonitoring,
Telemetry,
MonitoringMessage,
monitored,
monitor,
Expand All @@ -29,7 +29,7 @@ export {
TelemetryErrorEvent,
TelemetryDebugEvent,
isTelemetryReplicationAllowed,
} from './domain/internalMonitoring'
} from './domain/telemetry'
export { Observable, Subscription } from './tools/observable'
export {
startSessionManager,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tools/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { callMonitored } from '../domain/internalMonitoring'
import { callMonitored } from '../domain/telemetry'
import type { StackTrace } from '../domain/tracekit'
import { computeStackTrace } from '../domain/tracekit'
import type { ClocksState } from './timeUtils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tools/instrumentMethod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { callMonitored, monitor } from '../domain/internalMonitoring'
import { callMonitored, monitor } from '../domain/telemetry'
import { noop } from './utils'

export function instrumentMethod<OBJECT extends { [key: string]: any }, METHOD extends keyof OBJECT>(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/tools/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monitor } from '../domain/internalMonitoring'
import { monitor } from '../domain/telemetry'

export const ONE_SECOND = 1000
export const ONE_MINUTE = 60 * ONE_SECOND
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/transport/batch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { display } from '../tools/display'
import type { Context } from '../tools/context'
import { addEventListener, DOM_EVENT, jsonStringify, noop, objectValues } from '../tools/utils'
import { monitor } from '../domain/internalMonitoring'
import { monitor } from '../domain/telemetry'
import type { HttpRequest } from './httpRequest'

// https://en.wikipedia.org/wiki/UTF-8
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/transport/failedSendBeacon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { mockClock } from '../../test/specHelper'
import { startsWith } from '../tools/utils'
import type { Configuration } from '../domain/configuration'
import { resetExperimentalFeatures, updateExperimentalFeatures } from '../domain/configuration'
import type { TelemetryEvent } from '../domain/internalMonitoring'
import { resetInternalMonitoring, startInternalMonitoring } from '../domain/internalMonitoring'
import type { TelemetryEvent } from '../domain/telemetry'
import { resetInternalMonitoring, startInternalMonitoring } from '../domain/telemetry'
import { addFailedSendBeacon, LOCAL_STORAGE_KEY, startFlushFailedSendBeacons } from './failedSendBeacon'

describe('failedSendBeacon', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/transport/failedSendBeacon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isExperimentalFeatureEnabled } from '../domain/configuration'
import { addMonitoringMessage, monitor } from '../domain/internalMonitoring'
import { addMonitoringMessage, monitor } from '../domain/telemetry'
import { generateUUID, startsWith } from '../tools/utils'

// replaced at build time
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/transport/httpRequest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EndpointBuilder } from '../domain/configuration'
import { addMonitoringError } from '../domain/internalMonitoring'
import { addMonitoringError } from '../domain/telemetry'
import { addFailedSendBeacon } from './failedSendBeacon'

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-schema-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
'rum-events-schema.json'
)
await generateTypesFromSchema(
path.join(__dirname, '../packages/core/src/domain/internalMonitoring/telemetryEvent.types.ts'),
path.join(__dirname, '../packages/core/src/domain/telemetry/telemetryEvent.types.ts'),
'telemetry-events-schema.json'
)
}
Expand Down
File renamed without changes.

0 comments on commit c6363aa

Please sign in to comment.