@fluidframework/telemetry-utils 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/telemetry-utils.api.md +6 -6
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/error.d.ts +4 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +5 -5
- package/dist/error.js.map +1 -1
- package/dist/errorLogging.d.ts +3 -2
- package/dist/errorLogging.d.ts.map +1 -1
- package/dist/errorLogging.js.map +1 -1
- package/dist/eventEmitterWithErrorHandling.d.ts +1 -1
- package/dist/eventEmitterWithErrorHandling.d.ts.map +1 -1
- package/dist/eventEmitterWithErrorHandling.js +2 -2
- package/dist/eventEmitterWithErrorHandling.js.map +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/fluidErrorBase.d.ts.map +1 -1
- package/dist/fluidErrorBase.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +28 -0
- package/dist/logger.d.ts +2 -2
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/mockLogger.d.ts +1 -1
- package/dist/mockLogger.d.ts.map +1 -1
- package/dist/mockLogger.js +3 -3
- package/dist/mockLogger.js.map +1 -1
- package/dist/public.d.ts +20 -0
- package/dist/sampledTelemetryHelper.d.ts +2 -2
- package/dist/sampledTelemetryHelper.d.ts.map +1 -1
- package/dist/sampledTelemetryHelper.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +5 -1
- package/lib/config.js.map +1 -1
- package/lib/error.d.ts +4 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +1 -1
- package/lib/error.js.map +1 -1
- package/lib/errorLogging.d.ts +3 -2
- package/lib/errorLogging.d.ts.map +1 -1
- package/lib/errorLogging.js.map +1 -1
- package/lib/eventEmitterWithErrorHandling.d.ts +1 -1
- package/lib/eventEmitterWithErrorHandling.d.ts.map +1 -1
- package/lib/eventEmitterWithErrorHandling.js.map +1 -1
- package/lib/events.d.ts +1 -1
- package/lib/events.d.ts.map +1 -1
- package/lib/events.js.map +1 -1
- package/lib/fluidErrorBase.d.ts.map +1 -1
- package/lib/fluidErrorBase.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +28 -0
- package/lib/logger.d.ts +2 -2
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +2 -2
- package/lib/logger.js.map +1 -1
- package/lib/mockLogger.d.ts +1 -1
- package/lib/mockLogger.d.ts.map +1 -1
- package/lib/mockLogger.js +2 -2
- package/lib/mockLogger.js.map +1 -1
- package/lib/public.d.ts +20 -0
- package/lib/sampledTelemetryHelper.d.ts +2 -2
- package/lib/sampledTelemetryHelper.d.ts.map +1 -1
- package/lib/sampledTelemetryHelper.js.map +1 -1
- package/lib/utils.d.ts +4 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +4 -0
- package/lib/utils.js.map +1 -1
- package/package.json +27 -48
- package/src/config.ts +5 -3
- package/src/error.ts +4 -4
- package/src/errorLogging.ts +6 -8
- package/src/eventEmitterWithErrorHandling.ts +2 -1
- package/src/events.ts +2 -1
- package/src/fluidErrorBase.ts +1 -0
- package/src/index.ts +1 -0
- package/src/logger.ts +7 -6
- package/src/mockLogger.ts +4 -3
- package/src/sampledTelemetryHelper.ts +3 -2
- package/src/utils.ts +2 -0
- package/api-extractor-cjs.json +0 -8
- package/dist/telemetry-utils-alpha.d.ts +0 -282
- package/dist/telemetry-utils-beta.d.ts +0 -239
- package/dist/telemetry-utils-public.d.ts +0 -239
- package/dist/telemetry-utils-untrimmed.d.ts +0 -1077
- package/lib/telemetry-utils-alpha.d.ts +0 -282
- package/lib/telemetry-utils-beta.d.ts +0 -239
- package/lib/telemetry-utils-public.d.ts +0 -239
- package/lib/telemetry-utils-untrimmed.d.ts +0 -1077
- package/lib/test/EventEmitterWithErrorHandling.spec.js +0 -86
- package/lib/test/EventEmitterWithErrorHandling.spec.js.map +0 -1
- package/lib/test/childLogger.spec.js +0 -233
- package/lib/test/childLogger.spec.js.map +0 -1
- package/lib/test/config.spec.js +0 -229
- package/lib/test/config.spec.js.map +0 -1
- package/lib/test/error.spec.js +0 -161
- package/lib/test/error.spec.js.map +0 -1
- package/lib/test/errorLogging.spec.js +0 -801
- package/lib/test/errorLogging.spec.js.map +0 -1
- package/lib/test/errorTypeLoggingTest.spec.js +0 -107
- package/lib/test/errorTypeLoggingTest.spec.js.map +0 -1
- package/lib/test/mockLogger.spec.js +0 -164
- package/lib/test/mockLogger.spec.js.map +0 -1
- package/lib/test/multiSinkLogger.spec.js +0 -84
- package/lib/test/multiSinkLogger.spec.js.map +0 -1
- package/lib/test/performanceEvent.spec.js +0 -86
- package/lib/test/performanceEvent.spec.js.map +0 -1
- package/lib/test/sampledTelemetryHelper.spec.js +0 -169
- package/lib/test/sampledTelemetryHelper.spec.js.map +0 -1
- package/lib/test/telemetryLogger.spec.js +0 -357
- package/lib/test/telemetryLogger.spec.js.map +0 -1
- package/lib/test/thresholdCounter.spec.js +0 -51
- package/lib/test/thresholdCounter.spec.js.map +0 -1
- package/lib/test/types/validateTelemetryUtilsPrevious.generated.js +0 -132
- package/lib/test/types/validateTelemetryUtilsPrevious.generated.js.map +0 -1
- package/lib/test/utils.spec.js +0 -284
- package/lib/test/utils.spec.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/telemetry-utils",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3.0.0",
|
|
4
4
|
"description": "Collection of telemetry relates utilities for Fluid",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,31 +15,21 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": {
|
|
18
|
-
"types": "./lib/
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
|
-
"default": "./dist/index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./public": {
|
|
27
|
-
"import": {
|
|
28
|
-
"types": "./lib/telemetry-utils-public.d.ts",
|
|
18
|
+
"types": "./lib/public.d.ts",
|
|
29
19
|
"default": "./lib/index.js"
|
|
30
20
|
},
|
|
31
21
|
"require": {
|
|
32
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/public.d.ts",
|
|
33
23
|
"default": "./dist/index.js"
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
|
-
"./
|
|
26
|
+
"./legacy": {
|
|
37
27
|
"import": {
|
|
38
|
-
"types": "./lib/
|
|
28
|
+
"types": "./lib/legacy.d.ts",
|
|
39
29
|
"default": "./lib/index.js"
|
|
40
30
|
},
|
|
41
31
|
"require": {
|
|
42
|
-
"types": "./dist/
|
|
32
|
+
"types": "./dist/legacy.d.ts",
|
|
43
33
|
"default": "./dist/index.js"
|
|
44
34
|
}
|
|
45
35
|
},
|
|
@@ -54,8 +44,8 @@
|
|
|
54
44
|
}
|
|
55
45
|
}
|
|
56
46
|
},
|
|
57
|
-
"main": "
|
|
58
|
-
"types": "
|
|
47
|
+
"main": "lib/index.js",
|
|
48
|
+
"types": "lib/public.d.ts",
|
|
59
49
|
"c8": {
|
|
60
50
|
"all": true,
|
|
61
51
|
"cache-dir": "nyc/.cache",
|
|
@@ -77,20 +67,21 @@
|
|
|
77
67
|
"temp-directory": "nyc/.nyc_output"
|
|
78
68
|
},
|
|
79
69
|
"dependencies": {
|
|
80
|
-
"@fluid-internal/client-utils": ">=2.0.0-rc.
|
|
81
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.
|
|
82
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.
|
|
70
|
+
"@fluid-internal/client-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
71
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
72
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
83
73
|
"@fluidframework/protocol-definitions": "^3.2.0",
|
|
84
74
|
"debug": "^4.3.4",
|
|
85
75
|
"uuid": "^9.0.0"
|
|
86
76
|
},
|
|
87
77
|
"devDependencies": {
|
|
88
|
-
"@arethetypeswrong/cli": "^0.
|
|
89
|
-
"@
|
|
90
|
-
"@fluid-
|
|
78
|
+
"@arethetypeswrong/cli": "^0.15.2",
|
|
79
|
+
"@biomejs/biome": "^1.6.2",
|
|
80
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
81
|
+
"@fluid-tools/build-cli": "^0.37.0",
|
|
91
82
|
"@fluidframework/build-common": "^2.0.3",
|
|
92
|
-
"@fluidframework/build-tools": "^0.
|
|
93
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
83
|
+
"@fluidframework/build-tools": "^0.37.0",
|
|
84
|
+
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
94
85
|
"@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.0.0-internal.8.0.0",
|
|
95
86
|
"@microsoft/api-extractor": "^7.42.3",
|
|
96
87
|
"@types/debug": "^4.1.5",
|
|
@@ -111,18 +102,6 @@
|
|
|
111
102
|
"sinon": "^17.0.1",
|
|
112
103
|
"typescript": "~5.1.6"
|
|
113
104
|
},
|
|
114
|
-
"fluidBuild": {
|
|
115
|
-
"tasks": {
|
|
116
|
-
"build:docs": {
|
|
117
|
-
"dependsOn": [
|
|
118
|
-
"...",
|
|
119
|
-
"api-extractor:commonjs",
|
|
120
|
-
"api-extractor:esnext"
|
|
121
|
-
],
|
|
122
|
-
"script": false
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
105
|
"typeValidation": {
|
|
127
106
|
"broken": {
|
|
128
107
|
"RemovedInterfaceDeclaration_IConfigProviderBase": {
|
|
@@ -145,28 +124,28 @@
|
|
|
145
124
|
},
|
|
146
125
|
"scripts": {
|
|
147
126
|
"api": "fluid-build . --task api",
|
|
148
|
-
"api-extractor:commonjs": "
|
|
149
|
-
"api-extractor:esnext": "
|
|
127
|
+
"api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
|
|
128
|
+
"api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
|
|
150
129
|
"build": "fluid-build . --task build",
|
|
151
130
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
152
131
|
"build:compile": "fluid-build . --task compile",
|
|
153
|
-
"build:docs": "
|
|
132
|
+
"build:docs": "api-extractor run --local",
|
|
154
133
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
155
134
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
156
135
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
157
136
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
158
137
|
"bump-version": "npm version minor --no-push --no-git-tag-version && npm run build:genver",
|
|
159
|
-
"check:are-the-types-wrong": "attw --pack .
|
|
138
|
+
"check:are-the-types-wrong": "attw --pack .",
|
|
139
|
+
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
160
140
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
161
141
|
"ci:build:docs": "api-extractor run",
|
|
162
|
-
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
142
|
+
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
163
143
|
"eslint": "eslint --format stylish src",
|
|
164
144
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
165
|
-
"format": "
|
|
166
|
-
"
|
|
167
|
-
"lint
|
|
168
|
-
"
|
|
169
|
-
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
145
|
+
"format": "fluid-build --task format .",
|
|
146
|
+
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
147
|
+
"lint": "fluid-build . --task lint",
|
|
148
|
+
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
170
149
|
"test": "npm run test:mocha",
|
|
171
150
|
"test:coverage": "c8 npm test",
|
|
172
151
|
"test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
|
package/src/config.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
import {
|
|
6
|
-
ITelemetryBaseLogger,
|
|
7
|
-
IConfigProviderBase,
|
|
8
7
|
ConfigTypes,
|
|
8
|
+
IConfigProviderBase,
|
|
9
|
+
ITelemetryBaseLogger,
|
|
9
10
|
} from "@fluidframework/core-interfaces";
|
|
10
|
-
import { Lazy } from "@fluidframework/core-utils";
|
|
11
|
+
import { Lazy } from "@fluidframework/core-utils/internal";
|
|
12
|
+
|
|
11
13
|
import { createChildLogger, tagCodeArtifacts } from "./logger.js";
|
|
12
14
|
import { ITelemetryLoggerExt } from "./telemetryTypes.js";
|
|
13
15
|
|
package/src/error.ts
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
6
7
|
import {
|
|
7
8
|
FluidErrorTypes,
|
|
8
9
|
IGenericError,
|
|
9
|
-
IErrorBase,
|
|
10
|
-
ITelemetryBaseProperties,
|
|
11
10
|
IUsageError,
|
|
12
|
-
} from "@fluidframework/core-interfaces";
|
|
11
|
+
} from "@fluidframework/core-interfaces/internal";
|
|
13
12
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
13
|
|
|
15
14
|
import {
|
|
@@ -20,6 +19,7 @@ import {
|
|
|
20
19
|
wrapError,
|
|
21
20
|
} from "./errorLogging.js";
|
|
22
21
|
import { IFluidErrorBase } from "./fluidErrorBase.js";
|
|
22
|
+
import { ITelemetryPropertiesExt } from "./telemetryTypes.js";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Throws a UsageError with the given message if the condition is not met.
|
|
@@ -124,7 +124,7 @@ export class DataProcessingError extends LoggingError implements IErrorBase, IFl
|
|
|
124
124
|
errorMessage: string,
|
|
125
125
|
dataProcessingCodepath: string,
|
|
126
126
|
sequencedMessage?: ISequencedDocumentMessage,
|
|
127
|
-
props:
|
|
127
|
+
props: ITelemetryPropertiesExt = {},
|
|
128
128
|
): IFluidErrorBase {
|
|
129
129
|
const dataProcessingError = DataProcessingError.wrapIfUnrecognized(
|
|
130
130
|
errorMessage,
|
package/src/errorLogging.ts
CHANGED
|
@@ -3,24 +3,22 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
ITelemetryBaseProperties,
|
|
9
|
-
Tagged,
|
|
10
|
-
} from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { ITelemetryBaseProperties, Tagged } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { ILoggingError } from "@fluidframework/core-interfaces/internal";
|
|
11
8
|
import { v4 as uuid } from "uuid";
|
|
9
|
+
|
|
12
10
|
import {
|
|
13
|
-
hasErrorInstanceId,
|
|
14
11
|
IFluidErrorBase,
|
|
12
|
+
hasErrorInstanceId,
|
|
15
13
|
isFluidError,
|
|
16
14
|
isValidLegacyError,
|
|
17
15
|
} from "./fluidErrorBase.js";
|
|
16
|
+
import { convertToBasePropertyType } from "./logger.js";
|
|
18
17
|
import type {
|
|
19
18
|
ITelemetryLoggerExt,
|
|
20
|
-
TelemetryEventPropertyTypeExt,
|
|
21
19
|
ITelemetryPropertiesExt,
|
|
20
|
+
TelemetryEventPropertyTypeExt,
|
|
22
21
|
} from "./telemetryTypes.js";
|
|
23
|
-
import { convertToBasePropertyType } from "./logger.js";
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Determines if the provided value is an object but neither null nor an array.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { EventEmitterEventType, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
7
|
import { IEvent } from "@fluidframework/core-interfaces";
|
|
7
8
|
|
|
8
9
|
/**
|
package/src/events.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import type { ITelemetryLoggerExt } from "./telemetryTypes.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Note: The contents of this file really don't belong in this package, as they are only intended for internal use.
|
package/src/fluidErrorBase.ts
CHANGED
package/src/index.ts
CHANGED
package/src/logger.ts
CHANGED
|
@@ -3,35 +3,36 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { IsomorphicPerformance, performance } from "@fluid-internal/client-utils";
|
|
6
7
|
import {
|
|
7
8
|
ITelemetryBaseEvent,
|
|
8
9
|
ITelemetryBaseLogger,
|
|
10
|
+
ITelemetryBaseProperties,
|
|
9
11
|
LogLevel,
|
|
10
12
|
Tagged,
|
|
11
|
-
ITelemetryBaseProperties,
|
|
12
13
|
TelemetryBaseEventPropertyType,
|
|
13
14
|
} from "@fluidframework/core-interfaces";
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
import {
|
|
16
17
|
CachedConfigProvider,
|
|
17
18
|
loggerIsMonitoringContext,
|
|
18
19
|
mixinMonitoringContext,
|
|
19
20
|
} from "./config.js";
|
|
20
21
|
import {
|
|
21
|
-
isILoggingError,
|
|
22
22
|
extractLogSafeErrorProperties,
|
|
23
23
|
generateStack,
|
|
24
|
+
isILoggingError,
|
|
24
25
|
isTaggedTelemetryPropertyValue,
|
|
25
26
|
} from "./errorLogging.js";
|
|
26
27
|
import {
|
|
28
|
+
type ITelemetryErrorEventExt,
|
|
27
29
|
ITelemetryEventExt,
|
|
28
30
|
ITelemetryGenericEventExt,
|
|
29
31
|
ITelemetryLoggerExt,
|
|
30
32
|
ITelemetryPerformanceEventExt,
|
|
31
|
-
TelemetryEventPropertyTypeExt,
|
|
32
|
-
TelemetryEventCategory,
|
|
33
33
|
ITelemetryPropertiesExt,
|
|
34
|
-
|
|
34
|
+
TelemetryEventCategory,
|
|
35
|
+
TelemetryEventPropertyTypeExt,
|
|
35
36
|
} from "./telemetryTypes.js";
|
|
36
37
|
|
|
37
38
|
export interface Memory {
|
package/src/mockLogger.ts
CHANGED
|
@@ -8,15 +8,16 @@ import {
|
|
|
8
8
|
ITelemetryBaseLogger,
|
|
9
9
|
LogLevel,
|
|
10
10
|
} from "@fluidframework/core-interfaces";
|
|
11
|
-
import { assert } from "@fluidframework/core-utils";
|
|
12
|
-
|
|
11
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
|
+
|
|
13
13
|
import { createChildLogger } from "./logger.js";
|
|
14
|
+
import { ITelemetryLoggerExt, ITelemetryPropertiesExt } from "./telemetryTypes.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* The MockLogger records events sent to it, and then can walk back over those events
|
|
17
18
|
* searching for a set of expected events to match against the logged events.
|
|
18
19
|
*
|
|
19
|
-
* @
|
|
20
|
+
* @alpha
|
|
20
21
|
*/
|
|
21
22
|
export class MockLogger implements ITelemetryBaseLogger {
|
|
22
23
|
events: ITelemetryBaseEvent[] = [];
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { ITelemetryBaseProperties, IDisposable } from "@fluidframework/core-interfaces";
|
|
7
6
|
import { performance } from "@fluid-internal/client-utils";
|
|
7
|
+
import type { IDisposable, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
|
+
|
|
8
9
|
import {
|
|
9
|
-
ITelemetryLoggerExt,
|
|
10
10
|
type ITelemetryGenericEventExt,
|
|
11
|
+
ITelemetryLoggerExt,
|
|
11
12
|
type ITelemetryPerformanceEventExt,
|
|
12
13
|
} from "./telemetryTypes.js";
|
|
13
14
|
|
package/src/utils.ts
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
import { ITelemetryBaseEvent } from "@fluidframework/core-interfaces";
|
|
7
|
+
|
|
6
8
|
import { loggerToMonitoringContext } from "./config.js";
|
|
7
9
|
import { ITelemetryGenericEventExt, ITelemetryLoggerExt } from "./telemetryTypes.js";
|
|
8
10
|
|
package/api-extractor-cjs.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
|
|
4
|
-
// CJS is actually secondary; so, no report.
|
|
5
|
-
"apiReport": {
|
|
6
|
-
"enabled": false
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { ConfigTypes } from '@fluidframework/core-interfaces';
|
|
2
|
-
import type { EventEmitter } from '@fluid-internal/client-utils';
|
|
3
|
-
import { EventEmitterEventType } from '@fluid-internal/client-utils';
|
|
4
|
-
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
5
|
-
import type { IDisposable } from '@fluidframework/core-interfaces';
|
|
6
|
-
import { IErrorBase } from '@fluidframework/core-interfaces';
|
|
7
|
-
import { IEvent } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IGenericError } from '@fluidframework/core-interfaces';
|
|
9
|
-
import type { ILoggingError } from '@fluidframework/core-interfaces';
|
|
10
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ITelemetryBaseEvent } from '@fluidframework/core-interfaces';
|
|
12
|
-
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
13
|
-
import { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';
|
|
14
|
-
import { IUsageError } from '@fluidframework/core-interfaces';
|
|
15
|
-
import { Lazy } from '@fluidframework/core-utils';
|
|
16
|
-
import { LogLevel } from '@fluidframework/core-interfaces';
|
|
17
|
-
import { Tagged } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { TelemetryBaseEventPropertyType } from '@fluidframework/core-interfaces';
|
|
19
|
-
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
20
|
-
|
|
21
|
-
/* Excluded from this release type: connectedEventName */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create a child logger based on the provided props object.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.
|
|
28
|
-
*
|
|
29
|
-
* @param props - logger is the base logger the child will log to after it's processing, namespace will be prefixed to all event names, properties are default properties that will be applied events.
|
|
30
|
-
*
|
|
31
|
-
* @alpha
|
|
32
|
-
*/
|
|
33
|
-
export declare function createChildLogger(props?: {
|
|
34
|
-
logger?: ITelemetryBaseLogger;
|
|
35
|
-
namespace?: string;
|
|
36
|
-
properties?: ITelemetryLoggerPropertyBags;
|
|
37
|
-
}): ITelemetryLoggerExt;
|
|
38
|
-
|
|
39
|
-
/* Excluded from this release type: createChildMonitoringContext */
|
|
40
|
-
|
|
41
|
-
/* Excluded from this release type: createMultiSinkLogger */
|
|
42
|
-
|
|
43
|
-
/* Excluded from this release type: createSampledLogger */
|
|
44
|
-
|
|
45
|
-
/* Excluded from this release type: DataCorruptionError */
|
|
46
|
-
|
|
47
|
-
/* Excluded from this release type: DataProcessingError */
|
|
48
|
-
|
|
49
|
-
/* Excluded from this release type: disconnectedEventName */
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Event Emitter helper class
|
|
53
|
-
*
|
|
54
|
-
* @remarks
|
|
55
|
-
* Any exceptions thrown by listeners will be caught and raised through "error" event.
|
|
56
|
-
* Any exception thrown by "error" listeners will propagate to the caller.
|
|
57
|
-
* @privateRemarks
|
|
58
|
-
* This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.
|
|
59
|
-
* We should consider moving it to the `core-utils` package.
|
|
60
|
-
* @alpha
|
|
61
|
-
*/
|
|
62
|
-
export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> {
|
|
63
|
-
private readonly errorHandler;
|
|
64
|
-
constructor(errorHandler: (eventName: EventEmitterEventType, error: any) => void);
|
|
65
|
-
emit(event: EventEmitterEventType, ...args: unknown[]): boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Excluded from this release type: eventNamespaceSeparator */
|
|
69
|
-
|
|
70
|
-
/* Excluded from this release type: extractLogSafeErrorProperties */
|
|
71
|
-
|
|
72
|
-
/* Excluded from this release type: extractSafePropertiesFromMessage */
|
|
73
|
-
|
|
74
|
-
/* Excluded from this release type: formatTick */
|
|
75
|
-
|
|
76
|
-
/* Excluded from this release type: generateErrorWithStack */
|
|
77
|
-
|
|
78
|
-
/* Excluded from this release type: generateStack */
|
|
79
|
-
|
|
80
|
-
/* Excluded from this release type: GenericError */
|
|
81
|
-
|
|
82
|
-
/* Excluded from this release type: getCircularReplacer */
|
|
83
|
-
|
|
84
|
-
/* Excluded from this release type: hasErrorInstanceId */
|
|
85
|
-
|
|
86
|
-
/* Excluded from this release type: IConfigProvider */
|
|
87
|
-
|
|
88
|
-
/* Excluded from this release type: IEventSampler */
|
|
89
|
-
|
|
90
|
-
/* Excluded from this release type: IFluidErrorAnnotations */
|
|
91
|
-
|
|
92
|
-
/* Excluded from this release type: IFluidErrorBase */
|
|
93
|
-
|
|
94
|
-
/* Excluded from this release type: IGenericError */
|
|
95
|
-
|
|
96
|
-
/* Excluded from this release type: ILoggingError */
|
|
97
|
-
|
|
98
|
-
/* Excluded from this release type: IPerformanceEventMarkers */
|
|
99
|
-
|
|
100
|
-
/* Excluded from this release type: ISampledTelemetryLogger */
|
|
101
|
-
|
|
102
|
-
/* Excluded from this release type: isExternalError */
|
|
103
|
-
|
|
104
|
-
/* Excluded from this release type: isFluidError */
|
|
105
|
-
|
|
106
|
-
/* Excluded from this release type: isILoggingError */
|
|
107
|
-
|
|
108
|
-
/* Excluded from this release type: isTaggedTelemetryPropertyValue */
|
|
109
|
-
|
|
110
|
-
/* Excluded from this release type: isValidLegacyError */
|
|
111
|
-
|
|
112
|
-
/* Excluded from this release type: ITaggedTelemetryPropertyTypeExt */
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Error telemetry event.
|
|
116
|
-
* @remarks Maps to category = "error"
|
|
117
|
-
* @public
|
|
118
|
-
*/
|
|
119
|
-
export declare interface ITelemetryErrorEventExt extends ITelemetryPropertiesExt {
|
|
120
|
-
eventName: string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* Excluded from this release type: ITelemetryEventExt */
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Informational (non-error) telemetry event
|
|
127
|
-
* @remarks Maps to category = "generic"
|
|
128
|
-
* @public
|
|
129
|
-
*/
|
|
130
|
-
export declare interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
|
|
131
|
-
eventName: string;
|
|
132
|
-
category?: TelemetryEventCategory;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* An extended {@link @fluidframework/core-interfaces#ITelemetryBaseLogger} which allows for more lenient event types.
|
|
137
|
-
*
|
|
138
|
-
* @remarks
|
|
139
|
-
* This interface is meant to be used internally within the Fluid Framework,
|
|
140
|
-
* and `ITelemetryBaseLogger` should be used when loggers are passed between layers.
|
|
141
|
-
* @public
|
|
142
|
-
*/
|
|
143
|
-
export declare interface ITelemetryLoggerExt extends ITelemetryBaseLogger {
|
|
144
|
-
/**
|
|
145
|
-
* Send information telemetry event
|
|
146
|
-
* @param event - Event to send
|
|
147
|
-
* @param error - optional error object to log
|
|
148
|
-
* @param logLevel - optional level of the log.
|
|
149
|
-
*/
|
|
150
|
-
sendTelemetryEvent(event: ITelemetryGenericEventExt, error?: unknown, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
151
|
-
/**
|
|
152
|
-
* Send error telemetry event
|
|
153
|
-
* @param event - Event to send
|
|
154
|
-
* @param error - optional error object to log
|
|
155
|
-
*/
|
|
156
|
-
sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void;
|
|
157
|
-
/**
|
|
158
|
-
* Send performance telemetry event
|
|
159
|
-
* @param event - Event to send
|
|
160
|
-
* @param error - optional error object to log
|
|
161
|
-
* @param logLevel - optional level of the log.
|
|
162
|
-
*/
|
|
163
|
-
sendPerformanceEvent(event: ITelemetryPerformanceEventExt, error?: unknown, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* @alpha
|
|
168
|
-
*/
|
|
169
|
-
export declare interface ITelemetryLoggerPropertyBag {
|
|
170
|
-
[index: string]: TelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @alpha
|
|
175
|
-
*/
|
|
176
|
-
export declare interface ITelemetryLoggerPropertyBags {
|
|
177
|
-
all?: ITelemetryLoggerPropertyBag;
|
|
178
|
-
error?: ITelemetryLoggerPropertyBag;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Performance telemetry event.
|
|
183
|
-
* @remarks Maps to category = "performance"
|
|
184
|
-
* @public
|
|
185
|
-
*/
|
|
186
|
-
export declare interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt {
|
|
187
|
-
duration?: number;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* JSON-serializable properties, which will be logged with telemetry.
|
|
192
|
-
* @public
|
|
193
|
-
*/
|
|
194
|
-
export declare interface ITelemetryPropertiesExt {
|
|
195
|
-
[index: string]: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* Excluded from this release type: IUsageError */
|
|
199
|
-
|
|
200
|
-
/* Excluded from this release type: Lazy */
|
|
201
|
-
|
|
202
|
-
/* Excluded from this release type: loggerToMonitoringContext */
|
|
203
|
-
|
|
204
|
-
/* Excluded from this release type: LoggingError */
|
|
205
|
-
|
|
206
|
-
/* Excluded from this release type: mixinMonitoringContext */
|
|
207
|
-
|
|
208
|
-
/* Excluded from this release type: MockLogger */
|
|
209
|
-
|
|
210
|
-
/* Excluded from this release type: MonitoringContext */
|
|
211
|
-
|
|
212
|
-
/* Excluded from this release type: MultiSinkLoggerProperties */
|
|
213
|
-
|
|
214
|
-
/* Excluded from this release type: NORMALIZED_ERROR_TYPE */
|
|
215
|
-
|
|
216
|
-
/* Excluded from this release type: normalizeError */
|
|
217
|
-
|
|
218
|
-
/* Excluded from this release type: numberFromString */
|
|
219
|
-
|
|
220
|
-
/* Excluded from this release type: overwriteStack */
|
|
221
|
-
|
|
222
|
-
/* Excluded from this release type: PerformanceEvent */
|
|
223
|
-
|
|
224
|
-
/* Excluded from this release type: raiseConnectedEvent */
|
|
225
|
-
|
|
226
|
-
/* Excluded from this release type: safeRaiseEvent */
|
|
227
|
-
|
|
228
|
-
/* Excluded from this release type: SampledTelemetryHelper */
|
|
229
|
-
|
|
230
|
-
/* Excluded from this release type: sessionStorageConfigProvider */
|
|
231
|
-
|
|
232
|
-
/* Excluded from this release type: tagCodeArtifacts */
|
|
233
|
-
|
|
234
|
-
/* Excluded from this release type: tagData */
|
|
235
|
-
|
|
236
|
-
/* Excluded from this release type: TaggedLoggerAdapter */
|
|
237
|
-
|
|
238
|
-
/* Excluded from this release type: TelemetryDataTag */
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* The categories FF uses when instrumenting the code.
|
|
242
|
-
*
|
|
243
|
-
* generic - Informational log event
|
|
244
|
-
*
|
|
245
|
-
* error - Error log event, ideally 0 of these are logged during a session
|
|
246
|
-
*
|
|
247
|
-
* performance - Includes duration, and often has _start, _end, or _cancel suffixes for activity tracking
|
|
248
|
-
* @public
|
|
249
|
-
*/
|
|
250
|
-
export declare type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Property types that can be logged.
|
|
254
|
-
*
|
|
255
|
-
* @remarks
|
|
256
|
-
* Includes extra types beyond {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType}, which must be
|
|
257
|
-
* converted before sending to a base logger.
|
|
258
|
-
* @public
|
|
259
|
-
*/
|
|
260
|
-
export declare type TelemetryEventPropertyTypeExt = string | number | boolean | undefined | (string | number | boolean)[] | {
|
|
261
|
-
[key: string]: // Flat objects can have the same properties as the event itself
|
|
262
|
-
string | number | boolean | undefined | (string | number | boolean)[];
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @alpha
|
|
267
|
-
*/
|
|
268
|
-
export declare type TelemetryEventPropertyTypes = ITelemetryBaseProperties[string];
|
|
269
|
-
|
|
270
|
-
/* Excluded from this release type: ThresholdCounter */
|
|
271
|
-
|
|
272
|
-
/* Excluded from this release type: UsageError */
|
|
273
|
-
|
|
274
|
-
/* Excluded from this release type: validatePrecondition */
|
|
275
|
-
|
|
276
|
-
/* Excluded from this release type: wrapConfigProviderWithDefaults */
|
|
277
|
-
|
|
278
|
-
/* Excluded from this release type: wrapError */
|
|
279
|
-
|
|
280
|
-
/* Excluded from this release type: wrapErrorAndLog */
|
|
281
|
-
|
|
282
|
-
export { }
|