@fluidframework/fluid-telemetry 2.91.0 → 2.93.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 +8 -0
- package/beta.d.ts +1 -1
- package/dist/beta.d.ts +1 -1
- package/dist/public.d.ts +1 -1
- package/eslint.config.mts +12 -2
- package/internal.d.ts +1 -1
- package/lib/beta.d.ts +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/test/containerTelemetry.spec.js +11 -1
- package/lib/test/containerTelemetry.spec.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +18 -28
- package/tsconfig.json +1 -1
- package/lib/test/containerTelemetry.spec.d.ts +0 -6
- package/lib/test/containerTelemetry.spec.d.ts.map +0 -1
- package/lib/test/containerTelemetryEndToEnd.spec.realsvc.d.ts +0 -6
- package/lib/test/containerTelemetryEndToEnd.spec.realsvc.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
package/beta.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export * from "./lib/beta.js";
|
package/dist/beta.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/eslint.config.mts
CHANGED
|
@@ -4,8 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Linter } from "eslint";
|
|
7
|
-
import { strict } from "
|
|
7
|
+
import { strict } from "@fluidframework/eslint-config-fluid/flat.mts";
|
|
8
8
|
|
|
9
|
-
const config: Linter.Config[] = [
|
|
9
|
+
const config: Linter.Config[] = [
|
|
10
|
+
...strict,
|
|
11
|
+
{
|
|
12
|
+
files: ["src/test/**/*.spec.ts"],
|
|
13
|
+
rules: {
|
|
14
|
+
// Allow named functions in mocha hooks (before, beforeEach, etc.) so that
|
|
15
|
+
// the function name appears in error output and stack traces.
|
|
16
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
10
20
|
|
|
11
21
|
export default config;
|
package/internal.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export * from "./lib/index.js";
|
package/lib/beta.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/lib/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -30,7 +30,11 @@ describe("container telemetry via", () => {
|
|
|
30
30
|
let appInsightsClient;
|
|
31
31
|
let trackEventSpy;
|
|
32
32
|
let telemetryConfig;
|
|
33
|
-
|
|
33
|
+
// Create the ApplicationInsights instance once for the suite and eagerly initialize it.
|
|
34
|
+
// Without loadAppInsights(), the first trackEvent call triggers an expensive fallback
|
|
35
|
+
// initialization path (~250ms locally, potentially much worse in CI). Calling
|
|
36
|
+
// loadAppInsights() up front avoids that path entirely, reducing first trackEvent to ~1ms.
|
|
37
|
+
before(function initializeAppInsights() {
|
|
34
38
|
appInsightsClient = new ApplicationInsights({
|
|
35
39
|
config: {
|
|
36
40
|
connectionString:
|
|
@@ -38,6 +42,9 @@ describe("container telemetry via", () => {
|
|
|
38
42
|
"InstrumentationKey=abcdefgh-ijkl-mnop-qrst-uvwxyz6ffd9c;IngestionEndpoint=https://westus2-2.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/",
|
|
39
43
|
},
|
|
40
44
|
});
|
|
45
|
+
appInsightsClient.loadAppInsights();
|
|
46
|
+
});
|
|
47
|
+
beforeEach(function createSpiesAndConfig() {
|
|
41
48
|
trackEventSpy = spy(appInsightsClient, "trackEvent");
|
|
42
49
|
mockFluidContainer = new MockFluidContainer();
|
|
43
50
|
telemetryConfig = {
|
|
@@ -46,6 +53,9 @@ describe("container telemetry via", () => {
|
|
|
46
53
|
consumers: [new AppInsightsTelemetryConsumer(appInsightsClient)],
|
|
47
54
|
};
|
|
48
55
|
});
|
|
56
|
+
afterEach(function restoreSpy() {
|
|
57
|
+
trackEventSpy.restore();
|
|
58
|
+
});
|
|
49
59
|
it("Emitting 'connected' container system event produces expected ContainerConnectedTelemetry using Azure App Insights", () => {
|
|
50
60
|
startTelemetry(telemetryConfig);
|
|
51
61
|
mockFluidContainer.connect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerTelemetry.spec.js","sourceRoot":"","sources":["../../src/test/containerTelemetry.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAwB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EACN,+BAA+B,GAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACN,4BAA4B,EAC5B,4BAA4B,GAI5B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,kBAAmB,SAAQ,iBAAwC;IACjE,OAAO;QACb,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;IAEM,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,+BAA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CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAE3C,iEAAiE;QACjE,MAAM,0BAA0B,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAoB,CAAC;QACvF,MAAM,wBAAwB,GAC7B,0BAA0B,CAAC,UAAiC,CAAC;QAE9D,MAAM,4BAA4B,GAAoB;YACrD,IAAI,EAAE,4BAA4B,CAAC,QAAQ;YAC3C,UAAU,EAAE;gBACX,SAAS,EAAE,4BAA4B,CAAC,QAAQ;gBAChD,WAAW,EAAE,eAAe;gBAC5B,mBAAmB,EAAE,wBAAwB,CAAC,mBAAmB;gBACjE,KAAK,EAAE,cAAc;aACgB;SACtC,CAAC;QAEF,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC/E,0GAA0G;QAC1G,MAAM,CAAC,wBAAwB,CAAC,mBAAmB,CAAC;aAClD,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;aACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport type { IFluidContainer, IFluidContainerEvents } from \"@fluidframework/fluid-static\";\nimport { ApplicationInsights, type IEventTelemetry } from \"@microsoft/applicationinsights-web\";\nimport { expect } from \"chai\";\nimport { spy } from \"sinon\";\nimport type Sinon from \"sinon\";\n\nimport {\n\tIFluidContainerSystemEventNames,\n\ttype IContainerTelemetry,\n} from \"../container/index.js\";\nimport { startTelemetry, type TelemetryConfig } from \"../factory/index.js\";\nimport {\n\tAppInsightsTelemetryConsumer,\n\tContainerTelemetryEventNames,\n\ttype ContainerConnectedTelemetry,\n\ttype ContainerDisconnectedTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"../index.js\";\n\n/**\n * For these unit tests, we are just interested in the event emitter part of the Fluid container.\n * The rest of the functionality of IFluidContainer is irrelevant.\n */\nclass MockFluidContainer extends TypedEventEmitter<IFluidContainerEvents> {\n\tpublic connect(): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.CONNECTED);\n\t}\n\n\tpublic disconnect(): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.DISCONNECTED);\n\t}\n\n\tpublic dispose(error?: ICriticalContainerError): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.DISPOSED, error);\n\t}\n}\n\ndescribe(\"container telemetry via\", () => {\n\tlet mockFluidContainer: MockFluidContainer;\n\tconst mockContainerId = \"mockContainerId\";\n\tlet appInsightsClient: ApplicationInsights;\n\tlet trackEventSpy: Sinon.SinonSpy;\n\tlet telemetryConfig: TelemetryConfig;\n\n\tbeforeEach(() => {\n\t\tappInsightsClient = new ApplicationInsights({\n\t\t\tconfig: {\n\t\t\t\tconnectionString:\n\t\t\t\t\t// (this is an example string)\n\t\t\t\t\t\"InstrumentationKey=abcdefgh-ijkl-mnop-qrst-uvwxyz6ffd9c;IngestionEndpoint=https://westus2-2.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/\",\n\t\t\t},\n\t\t});\n\n\t\ttrackEventSpy = spy(appInsightsClient, \"trackEvent\");\n\t\tmockFluidContainer = new MockFluidContainer();\n\n\t\ttelemetryConfig = {\n\t\t\tcontainer: mockFluidContainer as unknown as IFluidContainer,\n\t\t\tcontainerId: mockContainerId,\n\t\t\tconsumers: [new AppInsightsTelemetryConsumer(appInsightsClient)],\n\t\t};\n\t});\n\n\tit(\"Emitting 'connected' container system event produces expected ContainerConnectedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.connect();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.CONNECTED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.CONNECTED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerConnectedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disconnected' container system event produces expected ContainerDisconnectedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.disconnect();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISCONNECTED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISCONNECTED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerDisconnectedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disposed' system event produces expected ContainerDisposedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.dispose();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerDisposedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disposed' system event with an error produces expected ContainerDisposedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tconst containerError: ICriticalContainerError = {\n\t\t\terrorType: \"unknown error\",\n\t\t\tmessage: \"An unknown error occured\",\n\t\t\tstack: \"example stack error at line 52 of Container.ts\",\n\t\t};\n\n\t\tmockFluidContainer.dispose(containerError);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t\terror: containerError,\n\t\t\t} satisfies ContainerDisposedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"containerTelemetry.spec.js","sourceRoot":"","sources":["../../src/test/containerTelemetry.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAwB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EACN,+BAA+B,GAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACN,4BAA4B,EAC5B,4BAA4B,GAI5B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,kBAAmB,SAAQ,iBAAwC;IACjE,OAAO;QACb,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;IAEM,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAEM,OAA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AC,sHAAsH,EAAE,GAAG,EAAE;QAC/H,cAAc,CAAC,eAAe,CAAC,CAAC;QAEhC,MAAM,cAAc,GAA4B;YAC/C,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE,0BAA0B;YACnC,KAAK,EAAE,gDAAgD;SACvD,CAAC;QAEF,kBAAkB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAE3C,iEAAiE;QACjE,MAAM,0BAA0B,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAoB,CAAC;QACvF,MAAM,wBAAwB,GAC7B,0BAA0B,CAAC,UAAiC,CAAC;QAE9D,MAAM,4BAA4B,GAAoB;YACrD,IAAI,EAAE,4BAA4B,CAAC,QAAQ;YAC3C,UAAU,EAAE;gBACX,SAAS,EAAE,4BAA4B,CAAC,QAAQ;gBAChD,WAAW,EAAE,eAAe;gBAC5B,mBAAmB,EAAE,wBAAwB,CAAC,mBAAmB;gBACjE,KAAK,EAAE,cAAc;aACgB;SACtC,CAAC;QAEF,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC/E,0GAA0G;QAC1G,MAAM,CAAC,wBAAwB,CAAC,mBAAmB,CAAC;aAClD,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;aACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport type { IFluidContainer, IFluidContainerEvents } from \"@fluidframework/fluid-static\";\nimport { ApplicationInsights, type IEventTelemetry } from \"@microsoft/applicationinsights-web\";\nimport { expect } from \"chai\";\nimport { spy } from \"sinon\";\nimport type Sinon from \"sinon\";\n\nimport {\n\tIFluidContainerSystemEventNames,\n\ttype IContainerTelemetry,\n} from \"../container/index.js\";\nimport { startTelemetry, type TelemetryConfig } from \"../factory/index.js\";\nimport {\n\tAppInsightsTelemetryConsumer,\n\tContainerTelemetryEventNames,\n\ttype ContainerConnectedTelemetry,\n\ttype ContainerDisconnectedTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"../index.js\";\n\n/**\n * For these unit tests, we are just interested in the event emitter part of the Fluid container.\n * The rest of the functionality of IFluidContainer is irrelevant.\n */\nclass MockFluidContainer extends TypedEventEmitter<IFluidContainerEvents> {\n\tpublic connect(): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.CONNECTED);\n\t}\n\n\tpublic disconnect(): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.DISCONNECTED);\n\t}\n\n\tpublic dispose(error?: ICriticalContainerError): void {\n\t\tthis.emit(IFluidContainerSystemEventNames.DISPOSED, error);\n\t}\n}\n\ndescribe(\"container telemetry via\", () => {\n\tlet mockFluidContainer: MockFluidContainer;\n\tconst mockContainerId = \"mockContainerId\";\n\tlet appInsightsClient: ApplicationInsights;\n\tlet trackEventSpy: Sinon.SinonSpy;\n\tlet telemetryConfig: TelemetryConfig;\n\n\t// Create the ApplicationInsights instance once for the suite and eagerly initialize it.\n\t// Without loadAppInsights(), the first trackEvent call triggers an expensive fallback\n\t// initialization path (~250ms locally, potentially much worse in CI). Calling\n\t// loadAppInsights() up front avoids that path entirely, reducing first trackEvent to ~1ms.\n\tbefore(function initializeAppInsights() {\n\t\tappInsightsClient = new ApplicationInsights({\n\t\t\tconfig: {\n\t\t\t\tconnectionString:\n\t\t\t\t\t// (this is an example string)\n\t\t\t\t\t\"InstrumentationKey=abcdefgh-ijkl-mnop-qrst-uvwxyz6ffd9c;IngestionEndpoint=https://westus2-2.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/\",\n\t\t\t},\n\t\t});\n\t\tappInsightsClient.loadAppInsights();\n\t});\n\n\tbeforeEach(function createSpiesAndConfig() {\n\t\ttrackEventSpy = spy(appInsightsClient, \"trackEvent\");\n\t\tmockFluidContainer = new MockFluidContainer();\n\n\t\ttelemetryConfig = {\n\t\t\tcontainer: mockFluidContainer as unknown as IFluidContainer,\n\t\t\tcontainerId: mockContainerId,\n\t\t\tconsumers: [new AppInsightsTelemetryConsumer(appInsightsClient)],\n\t\t};\n\t});\n\n\tafterEach(function restoreSpy() {\n\t\ttrackEventSpy.restore();\n\t});\n\n\tit(\"Emitting 'connected' container system event produces expected ContainerConnectedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.connect();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.CONNECTED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.CONNECTED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerConnectedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disconnected' container system event produces expected ContainerDisconnectedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.disconnect();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISCONNECTED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISCONNECTED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerDisconnectedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disposed' system event produces expected ContainerDisposedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tmockFluidContainer.dispose();\n\n\t\texpect(trackEventSpy.callCount).to.equal(1);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t} satisfies ContainerDisposedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n\n\tit(\"Emitting 'disposed' system event with an error produces expected ContainerDisposedTelemetry using Azure App Insights\", () => {\n\t\tstartTelemetry(telemetryConfig);\n\n\t\tconst containerError: ICriticalContainerError = {\n\t\t\terrorType: \"unknown error\",\n\t\t\tmessage: \"An unknown error occured\",\n\t\t\tstack: \"example stack error at line 52 of Container.ts\",\n\t\t};\n\n\t\tmockFluidContainer.dispose(containerError);\n\n\t\t// Obtain the events from the method that the spy was called with\n\t\tconst actualAppInsightsTelemetry = trackEventSpy.getCall(0).args[0] as IEventTelemetry;\n\t\tconst actualContainerTelemetry =\n\t\t\tactualAppInsightsTelemetry.properties as IContainerTelemetry;\n\n\t\tconst expectedAppInsightsTelemetry: IEventTelemetry = {\n\t\t\tname: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tproperties: {\n\t\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\t\tcontainerId: mockContainerId,\n\t\t\t\tcontainerInstanceId: actualContainerTelemetry.containerInstanceId,\n\t\t\t\terror: containerError,\n\t\t\t} satisfies ContainerDisposedTelemetry,\n\t\t};\n\n\t\texpect(expectedAppInsightsTelemetry).to.deep.equal(actualAppInsightsTelemetry);\n\t\t// We won't know what the container containerInstanceId will be but we can still check that it is defined.\n\t\texpect(actualContainerTelemetry.containerInstanceId)\n\t\t\t.to.be.a(\"string\")\n\t\t\t.with.length.above(0);\n\t});\n});\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-telemetry",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.93.0",
|
|
4
4
|
"description": "Customer facing Fluid telemetry types and classes for both producing and consuming said telemetry",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -47,27 +47,27 @@
|
|
|
47
47
|
"main": "lib/index.js",
|
|
48
48
|
"types": "lib/index.d.ts",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@fluidframework/container-definitions": "~2.
|
|
51
|
-
"@fluidframework/container-loader": "~2.
|
|
52
|
-
"@fluidframework/fluid-static": "~2.
|
|
50
|
+
"@fluidframework/container-definitions": "~2.93.0",
|
|
51
|
+
"@fluidframework/container-loader": "~2.93.0",
|
|
52
|
+
"@fluidframework/fluid-static": "~2.93.0",
|
|
53
53
|
"@microsoft/applicationinsights-web": "^2.8.11",
|
|
54
54
|
"uuid": "^11.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
58
58
|
"@biomejs/biome": "~2.4.5",
|
|
59
|
-
"@fluid-internal/client-utils": "~2.
|
|
60
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
61
|
-
"@fluid-tools/build-cli": "^0.
|
|
62
|
-
"@fluidframework/build-tools": "^0.
|
|
63
|
-
"@fluidframework/test-utils": "~2.
|
|
64
|
-
"@fluidframework/tinylicious-client": "~2.
|
|
65
|
-
"@fluidframework/tree": "~2.
|
|
66
|
-
"@microsoft/api-extractor": "7.
|
|
59
|
+
"@fluid-internal/client-utils": "~2.93.0",
|
|
60
|
+
"@fluid-internal/mocha-test-setup": "~2.93.0",
|
|
61
|
+
"@fluid-tools/build-cli": "^0.64.0",
|
|
62
|
+
"@fluidframework/build-tools": "^0.64.0",
|
|
63
|
+
"@fluidframework/test-utils": "~2.93.0",
|
|
64
|
+
"@fluidframework/tinylicious-client": "~2.93.0",
|
|
65
|
+
"@fluidframework/tree": "~2.93.0",
|
|
66
|
+
"@microsoft/api-extractor": "7.58.1",
|
|
67
67
|
"@types/chai": "^4.0.0",
|
|
68
68
|
"@types/mocha": "^10.0.10",
|
|
69
69
|
"@types/sinon": "^17.0.3",
|
|
70
|
-
"chai": "^4.
|
|
70
|
+
"chai": "^4.5.0",
|
|
71
71
|
"concurrently": "^9.2.1",
|
|
72
72
|
"copyfiles": "^2.4.1",
|
|
73
73
|
"eslint": "~9.39.1",
|
|
@@ -80,30 +80,21 @@
|
|
|
80
80
|
"tslib": "^1.10.0",
|
|
81
81
|
"typescript": "~5.4.5"
|
|
82
82
|
},
|
|
83
|
-
"fluidBuild": {
|
|
84
|
-
"tasks": {
|
|
85
|
-
"build:esnext": [
|
|
86
|
-
"...",
|
|
87
|
-
"typetests:gen"
|
|
88
|
-
],
|
|
89
|
-
"tsc": [
|
|
90
|
-
"...",
|
|
91
|
-
"typetests:gen"
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
83
|
"typeValidation": {
|
|
96
84
|
"disabled": true
|
|
97
85
|
},
|
|
98
86
|
"scripts": {
|
|
99
87
|
"api": "fluid-build . --task api",
|
|
100
|
-
"api-extractor:commonjs": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./dist",
|
|
88
|
+
"api-extractor:commonjs": "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist",
|
|
101
89
|
"api-extractor:esnext": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat",
|
|
102
90
|
"build": "fluid-build . --task build",
|
|
103
91
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
104
92
|
"build:compile": "fluid-build . --task compile",
|
|
105
93
|
"build:docs": "api-extractor run --local",
|
|
106
94
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
95
|
+
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
96
|
+
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
97
|
+
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
107
98
|
"check:are-the-types-wrong": "attw --pack .",
|
|
108
99
|
"check:biome": "biome check .",
|
|
109
100
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
@@ -138,7 +129,6 @@
|
|
|
138
129
|
"test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7070 test:realsvc:tinylicious:run",
|
|
139
130
|
"test:realsvc:tinylicious:run": "npm run test:mocha:end-to-end",
|
|
140
131
|
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
141
|
-
"typetests:gen": "flub generate typetests --dir . -v"
|
|
142
|
-
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
132
|
+
"typetests:gen": "flub generate typetests --dir . -v"
|
|
143
133
|
}
|
|
144
134
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../../../common/build/build-common/tsconfig.node16.json",
|
|
3
3
|
"include": ["src/**/*"],
|
|
4
|
+
"exclude": ["src/test/**/*"],
|
|
4
5
|
"compilerOptions": {
|
|
5
6
|
"rootDir": "src",
|
|
6
7
|
"outDir": "./lib",
|
|
7
|
-
"types": ["mocha"],
|
|
8
8
|
"exactOptionalPropertyTypes": false,
|
|
9
9
|
},
|
|
10
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerTelemetry.spec.d.ts","sourceRoot":"","sources":["../../src/test/containerTelemetry.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"containerTelemetryEndToEnd.spec.realsvc.d.ts","sourceRoot":"","sources":["../../src/test/containerTelemetryEndToEnd.spec.realsvc.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|