@fluidframework/fluid-telemetry 2.53.1 → 2.60.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/fluid-telemetry
2
2
 
3
+ ## 2.60.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.53.0
4
8
 
5
9
  Dependency updates only.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IFluidTelemetry } from "../index.js";
5
+ import type { IFluidTelemetry } from "../telemetry/index.js";
6
6
  /**
7
7
  * Base interface for all telemetry consumers.
8
8
  * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,OAAE;CAChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,OAAE;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidTelemetry } from \"../index.js\";\n\n/**\n * Base interface for all telemetry consumers.\n * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.\n * This could be sending the telemetry to a cloud platform or just console logging.\n *\n * @example\n * Here is an example of how we construct a consumer to send telemetry to Azure App Insights, a cloud logging platform:\n * ```ts\n * class AppInsightsTelemetryConsumer implements ITelemetryConsumer {\n *\t constructor(private readonly appInsightsClient: ApplicationInsights) {}\n *\n *\t consume(event: IFluidTelemetry) {\n *\t\t this.appInsightsClient.trackEvent({\n *\t\t\t name: event.eventName,\n *\t\t\t properties: event,\n *\t\t });\n *\t }\n * }\n *```\n *\n * @beta\n */\nexport interface ITelemetryConsumer {\n\t/**\n\t * This method is intended to take created {@link IFluidTelemetry} and do something with it.\n\t * This could be sending the telemetry to a cloud platform, just console logging or something else of your choice.\n\t */\n\tconsume(event: IFluidTelemetry);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidTelemetry } from \"../telemetry/index.js\";\n\n/**\n * Base interface for all telemetry consumers.\n * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.\n * This could be sending the telemetry to a cloud platform or just console logging.\n *\n * @example\n * Here is an example of how we construct a consumer to send telemetry to Azure App Insights, a cloud logging platform:\n * ```ts\n * class AppInsightsTelemetryConsumer implements ITelemetryConsumer {\n *\t constructor(private readonly appInsightsClient: ApplicationInsights) {}\n *\n *\t consume(event: IFluidTelemetry) {\n *\t\t this.appInsightsClient.trackEvent({\n *\t\t\t name: event.eventName,\n *\t\t\t properties: event,\n *\t\t });\n *\t }\n * }\n *```\n *\n * @beta\n */\nexport interface ITelemetryConsumer {\n\t/**\n\t * This method is intended to take created {@link IFluidTelemetry} and do something with it.\n\t * This could be sending the telemetry to a cloud platform, just console logging or something else of your choice.\n\t */\n\tconsume(event: IFluidTelemetry);\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IFluidTelemetry } from "../index.js";
5
+ import type { IFluidTelemetry } from "../common/index.js";
6
6
  import { type IFluidContainerSystemEventName } from "./containerSystemEvents.js";
7
7
  import { type IContainerTelemetry } from "./containerTelemetry.js";
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryProducer.d.ts","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACN,KAAK,8BAA8B,EAEnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,KAAK,mBAAmB,EAExB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,qBAAa,+BAA+B;IAMxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;gBAEV,WAAW,EAAE,MAAM;IAEhD,sBAAsB,CAC5B,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EAAE,OAAO,GACf,mBAAmB,GAAG,SAAS;IAkB3B,yBAAyB,QAAO,eAAe,CAMpD;IAEF,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAQ5C;IAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAYtC;CACF"}
1
+ {"version":3,"file":"telemetryProducer.d.ts","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACN,KAAK,8BAA8B,EAEnC,MAAM,4BAA4B,CAAC;AACpC,OA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D,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAC7C,CAAC;YACF,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;gBAClC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YACjC,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;IArDwD,CAAC;IAEpD,sBAAsB,CAC5B,SAAyC,EACzC,OAAiB;QAEjB,QAAQ,SAAS,EAAE,CAAC;YACnB,KAAK,0DAA+B,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChD,OAAO,IAAI,CAAC,6BAA6B,CAAC,oDAA4B,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC;YACD,KAAK,0DAA+B,CAAC,YAAY,CAAC,CAAC,CAAC;gBACnD,OAAO,IAAI,CAAC,6BAA6B,CAAC,oDAA4B,CAAC,YAAY,CAAC,CAAC;YACtF,CAAC;YACD,KAAK,0DAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC/C,MAAM,YAAY,GAAG,OAA8C,CAAC;gBACpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;CAiCD;AA5DD,0EA4DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { IFluidTelemetry } from \"../index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport {\n\tContainerTelemetryEventNames,\n\ttype ContainerTelemetryEventName,\n\ttype IContainerTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"./containerTelemetry.js\";\n\n/**\n * This class produces {@link IContainerTelemetry} from raw container system events {@link @fluidframework/fluid-static#IFluidContainerEvents}.\n * The class contains different helper methods for simplifying and standardizing logic for adding additional information necessary\n * to produce different {@link IContainerTelemetry}.\n */\nexport class ContainerEventTelemetryProducer {\n\t/**\n\t * Unique identifier for the instance of the container that this class is generating telemetry for.\n\t */\n\tprivate readonly containerInstanceId = uuid();\n\n\tpublic constructor(private readonly containerId: string) {}\n\n\tpublic produceFromSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): IContainerTelemetry | undefined {\n\t\tswitch (eventName) {\n\t\t\tcase IFluidContainerSystemEventNames.CONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.CONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISCONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.DISCONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISPOSED: {\n\t\t\t\tconst typedPayload = payload as { error?: ICriticalContainerError };\n\t\t\t\treturn this.produceDiposedTelemetry(typedPayload);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic produceHeartbeatTelemetry = (): IFluidTelemetry => {\n\t\treturn {\n\t\t\teventName: \"fluidframework.container.heartbeat\",\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} as unknown as IFluidTelemetry;\n\t};\n\n\tprivate readonly produceBaseContainerTelemetry = (\n\t\teventName: ContainerTelemetryEventName,\n\t): IContainerTelemetry => {\n\t\treturn {\n\t\t\teventName,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} satisfies IContainerTelemetry;\n\t};\n\n\tprivate readonly produceDiposedTelemetry = (payload?: {\n\t\terror?: ICriticalContainerError;\n\t}): ContainerDisposedTelemetry => {\n\t\tconst telemetry: ContainerDisposedTelemetry = {\n\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t};\n\t\tif (payload?.error !== undefined) {\n\t\t\ttelemetry.error = payload.error;\n\t\t}\n\t\treturn telemetry;\n\t};\n}\n"]}
1
+ {"version":3,"file":"telemetryProducer.js","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+BAAkC;AAIlC,yEAGoC;AACpC,mEAKiC;AAEjC;;;;GAIG;AACH,MAAa,+BAA+B;IAM3C,YAAoC,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QALvD;;WAEG;QACc,wBAAmB,GAAG,IAAA,SAAI,GAAE,CAAC;QAyBvC,8BAAyB,GAAG,GAAoB,EAAE;YACxD,OAAO;gBACN,SAAS,EAAE,oCAAoC;gBAC/C,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACf,CAAC;QACjC,CAAC,CAAC;QAEe,kCAA6B,GAAG,CAChD,SAAsC,EAChB,EAAE;YACxB,OAAO;gBACN,SAAS;gBACT,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACf,CAAC;QACjC,CAAC,CAAC;QAEe,4BAAuB,GAAG,CAAC,OAE3C,EAA8B,EAAE;YAChC,MAAM,SAAS,GAA+B;gBAC7C,SAAS,EAAE,oDAA4B,CAAC,QAAQ;gBAChD,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAC7C,CAAC;YACF,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;gBAClC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YACjC,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;IArDwD,CAAC;IAEpD,sBAAsB,CAC5B,SAAyC,EACzC,OAAiB;QAEjB,QAAQ,SAAS,EAAE,CAAC;YACnB,KAAK,0DAA+B,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChD,OAAO,IAAI,CAAC,6BAA6B,CAAC,oDAA4B,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC;YACD,KAAK,0DAA+B,CAAC,YAAY,CAAC,CAAC,CAAC;gBACnD,OAAO,IAAI,CAAC,6BAA6B,CAAC,oDAA4B,CAAC,YAAY,CAAC,CAAC;YACtF,CAAC;YACD,KAAK,0DAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC/C,MAAM,YAAY,GAAG,OAA8C,CAAC;gBACpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;CAiCD;AA5DD,0EA4DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { IFluidTelemetry } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport {\n\tContainerTelemetryEventNames,\n\ttype ContainerTelemetryEventName,\n\ttype IContainerTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"./containerTelemetry.js\";\n\n/**\n * This class produces {@link IContainerTelemetry} from raw container system events {@link @fluidframework/fluid-static#IFluidContainerEvents}.\n * The class contains different helper methods for simplifying and standardizing logic for adding additional information necessary\n * to produce different {@link IContainerTelemetry}.\n */\nexport class ContainerEventTelemetryProducer {\n\t/**\n\t * Unique identifier for the instance of the container that this class is generating telemetry for.\n\t */\n\tprivate readonly containerInstanceId = uuid();\n\n\tpublic constructor(private readonly containerId: string) {}\n\n\tpublic produceFromSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): IContainerTelemetry | undefined {\n\t\tswitch (eventName) {\n\t\t\tcase IFluidContainerSystemEventNames.CONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.CONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISCONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.DISCONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISPOSED: {\n\t\t\t\tconst typedPayload = payload as { error?: ICriticalContainerError };\n\t\t\t\treturn this.produceDiposedTelemetry(typedPayload);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic produceHeartbeatTelemetry = (): IFluidTelemetry => {\n\t\treturn {\n\t\t\teventName: \"fluidframework.container.heartbeat\",\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} as unknown as IFluidTelemetry;\n\t};\n\n\tprivate readonly produceBaseContainerTelemetry = (\n\t\teventName: ContainerTelemetryEventName,\n\t): IContainerTelemetry => {\n\t\treturn {\n\t\t\teventName,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} satisfies IContainerTelemetry;\n\t};\n\n\tprivate readonly produceDiposedTelemetry = (payload?: {\n\t\terror?: ICriticalContainerError;\n\t}): ContainerDisposedTelemetry => {\n\t\tconst telemetry: ContainerDisposedTelemetry = {\n\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t};\n\t\tif (payload?.error !== undefined) {\n\t\t\ttelemetry.error = payload.error;\n\t\t}\n\t\treturn telemetry;\n\t};\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IFluidTelemetry } from "../index.js";
5
+ import type { IFluidTelemetry } from "../telemetry/index.js";
6
6
  /**
7
7
  * Base interface for all telemetry consumers.
8
8
  * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,OAAE;CAChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,eAAe,OAAE;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidTelemetry } from \"../index.js\";\n\n/**\n * Base interface for all telemetry consumers.\n * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.\n * This could be sending the telemetry to a cloud platform or just console logging.\n *\n * @example\n * Here is an example of how we construct a consumer to send telemetry to Azure App Insights, a cloud logging platform:\n * ```ts\n * class AppInsightsTelemetryConsumer implements ITelemetryConsumer {\n *\t constructor(private readonly appInsightsClient: ApplicationInsights) {}\n *\n *\t consume(event: IFluidTelemetry) {\n *\t\t this.appInsightsClient.trackEvent({\n *\t\t\t name: event.eventName,\n *\t\t\t properties: event,\n *\t\t });\n *\t }\n * }\n *```\n *\n * @beta\n */\nexport interface ITelemetryConsumer {\n\t/**\n\t * This method is intended to take created {@link IFluidTelemetry} and do something with it.\n\t * This could be sending the telemetry to a cloud platform, just console logging or something else of your choice.\n\t */\n\tconsume(event: IFluidTelemetry);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/consumers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidTelemetry } from \"../telemetry/index.js\";\n\n/**\n * Base interface for all telemetry consumers.\n * Conusmers are intended to take incoming produced {@link IFluidTelemetry} and do something of your choice with it.\n * This could be sending the telemetry to a cloud platform or just console logging.\n *\n * @example\n * Here is an example of how we construct a consumer to send telemetry to Azure App Insights, a cloud logging platform:\n * ```ts\n * class AppInsightsTelemetryConsumer implements ITelemetryConsumer {\n *\t constructor(private readonly appInsightsClient: ApplicationInsights) {}\n *\n *\t consume(event: IFluidTelemetry) {\n *\t\t this.appInsightsClient.trackEvent({\n *\t\t\t name: event.eventName,\n *\t\t\t properties: event,\n *\t\t });\n *\t }\n * }\n *```\n *\n * @beta\n */\nexport interface ITelemetryConsumer {\n\t/**\n\t * This method is intended to take created {@link IFluidTelemetry} and do something with it.\n\t * This could be sending the telemetry to a cloud platform, just console logging or something else of your choice.\n\t */\n\tconsume(event: IFluidTelemetry);\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IFluidTelemetry } from "../index.js";
5
+ import type { IFluidTelemetry } from "../common/index.js";
6
6
  import { type IFluidContainerSystemEventName } from "./containerSystemEvents.js";
7
7
  import { type IContainerTelemetry } from "./containerTelemetry.js";
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryProducer.d.ts","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACN,KAAK,8BAA8B,EAEnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,KAAK,mBAAmB,EAExB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,qBAAa,+BAA+B;IAMxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;gBAEV,WAAW,EAAE,MAAM;IAEhD,sBAAsB,CAC5B,SAAS,EAAE,8BAA8B,EACzC,OAAO,CAAC,EAAE,OAAO,GACf,mBAAmB,GAAG,SAAS;IAkB3B,yBAAyB,QAAO,eAAe,CAMpD;IAEF,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAQ5C;IAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAYtC;CACF"}
1
+ {"version":3,"file":"telemetryProducer.d.ts","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACN,KAAK,8BAA8B,EAEnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,KAAK,mBAAmB,EAExB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,qBAAa,+BAA+B;IAMxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;gBAEV,WAAW,EAAE,MAAM;IAEhD,sBAAsB,CAC5B,SAAS,EAAE,8BAA8B,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AE,CAAC;gBAClC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YACjC,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;IArDwD,CAAC;IAEpD,sBAAsB,CAC5B,SAAyC,EACzC,OAAiB;QAEjB,QAAQ,SAAS,EAAE,CAAC;YACnB,KAAK,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChD,OAAO,IAAI,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC;YACD,KAAK,+BAA+B,CAAC,YAAY,CAAC,CAAC,CAAC;gBACnD,OAAO,IAAI,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;YACtF,CAAC;YACD,KAAK,+BAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC/C,MAAM,YAAY,GAAG,OAA8C,CAAC;gBACpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;CAiCD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { IFluidTelemetry } from \"../index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport {\n\tContainerTelemetryEventNames,\n\ttype ContainerTelemetryEventName,\n\ttype IContainerTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"./containerTelemetry.js\";\n\n/**\n * This class produces {@link IContainerTelemetry} from raw container system events {@link @fluidframework/fluid-static#IFluidContainerEvents}.\n * The class contains different helper methods for simplifying and standardizing logic for adding additional information necessary\n * to produce different {@link IContainerTelemetry}.\n */\nexport class ContainerEventTelemetryProducer {\n\t/**\n\t * Unique identifier for the instance of the container that this class is generating telemetry for.\n\t */\n\tprivate readonly containerInstanceId = uuid();\n\n\tpublic constructor(private readonly containerId: string) {}\n\n\tpublic produceFromSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): IContainerTelemetry | undefined {\n\t\tswitch (eventName) {\n\t\t\tcase IFluidContainerSystemEventNames.CONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.CONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISCONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.DISCONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISPOSED: {\n\t\t\t\tconst typedPayload = payload as { error?: ICriticalContainerError };\n\t\t\t\treturn this.produceDiposedTelemetry(typedPayload);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic produceHeartbeatTelemetry = (): IFluidTelemetry => {\n\t\treturn {\n\t\t\teventName: \"fluidframework.container.heartbeat\",\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} as unknown as IFluidTelemetry;\n\t};\n\n\tprivate readonly produceBaseContainerTelemetry = (\n\t\teventName: ContainerTelemetryEventName,\n\t): IContainerTelemetry => {\n\t\treturn {\n\t\t\teventName,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} satisfies IContainerTelemetry;\n\t};\n\n\tprivate readonly produceDiposedTelemetry = (payload?: {\n\t\terror?: ICriticalContainerError;\n\t}): ContainerDisposedTelemetry => {\n\t\tconst telemetry: ContainerDisposedTelemetry = {\n\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t};\n\t\tif (payload?.error !== undefined) {\n\t\t\ttelemetry.error = payload.error;\n\t\t}\n\t\treturn telemetry;\n\t};\n}\n"]}
1
+ {"version":3,"file":"telemetryProducer.js","sourceRoot":"","sources":["../../src/container/telemetryProducer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAIlC,OAAO,EAEN,+BAA+B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,4BAA4B,GAI5B,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,OAAO,+BAA+B;IAM3C,YAAoC,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QALvD;;WAEG;QACc,wBAAmB,GAAG,IAAI,EAAE,CAAC;QAyBvC,8BAAyB,GAAG,GAAoB,EAAE;YACxD,OAAO;gBACN,SAAS,EAAE,oCAAoC;gBAC/C,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACf,CAAC;QACjC,CAAC,CAAC;QAEe,kCAA6B,GAAG,CAChD,SAAsC,EAChB,EAAE;YACxB,OAAO;gBACN,SAAS;gBACT,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACf,CAAC;QACjC,CAAC,CAAC;QAEe,4BAAuB,GAAG,CAAC,OAE3C,EAA8B,EAAE;YAChC,MAAM,SAAS,GAA+B;gBAC7C,SAAS,EAAE,4BAA4B,CAAC,QAAQ;gBAChD,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAC7C,CAAC;YACF,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;gBAClC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YACjC,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;IArDwD,CAAC;IAEpD,sBAAsB,CAC5B,SAAyC,EACzC,OAAiB;QAEjB,QAAQ,SAAS,EAAE,CAAC;YACnB,KAAK,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC;gBAChD,OAAO,IAAI,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC;YACD,KAAK,+BAA+B,CAAC,YAAY,CAAC,CAAC,CAAC;gBACnD,OAAO,IAAI,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;YACtF,CAAC;YACD,KAAK,+BAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC/C,MAAM,YAAY,GAAG,OAA8C,CAAC;gBACpE,OAAO,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;CAiCD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { IFluidTelemetry } from \"../common/index.js\";\n\nimport {\n\ttype IFluidContainerSystemEventName,\n\tIFluidContainerSystemEventNames,\n} from \"./containerSystemEvents.js\";\nimport {\n\tContainerTelemetryEventNames,\n\ttype ContainerTelemetryEventName,\n\ttype IContainerTelemetry,\n\ttype ContainerDisposedTelemetry,\n} from \"./containerTelemetry.js\";\n\n/**\n * This class produces {@link IContainerTelemetry} from raw container system events {@link @fluidframework/fluid-static#IFluidContainerEvents}.\n * The class contains different helper methods for simplifying and standardizing logic for adding additional information necessary\n * to produce different {@link IContainerTelemetry}.\n */\nexport class ContainerEventTelemetryProducer {\n\t/**\n\t * Unique identifier for the instance of the container that this class is generating telemetry for.\n\t */\n\tprivate readonly containerInstanceId = uuid();\n\n\tpublic constructor(private readonly containerId: string) {}\n\n\tpublic produceFromSystemEvent(\n\t\teventName: IFluidContainerSystemEventName,\n\t\tpayload?: unknown,\n\t): IContainerTelemetry | undefined {\n\t\tswitch (eventName) {\n\t\t\tcase IFluidContainerSystemEventNames.CONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.CONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISCONNECTED: {\n\t\t\t\treturn this.produceBaseContainerTelemetry(ContainerTelemetryEventNames.DISCONNECTED);\n\t\t\t}\n\t\t\tcase IFluidContainerSystemEventNames.DISPOSED: {\n\t\t\t\tconst typedPayload = payload as { error?: ICriticalContainerError };\n\t\t\t\treturn this.produceDiposedTelemetry(typedPayload);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic produceHeartbeatTelemetry = (): IFluidTelemetry => {\n\t\treturn {\n\t\t\teventName: \"fluidframework.container.heartbeat\",\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} as unknown as IFluidTelemetry;\n\t};\n\n\tprivate readonly produceBaseContainerTelemetry = (\n\t\teventName: ContainerTelemetryEventName,\n\t): IContainerTelemetry => {\n\t\treturn {\n\t\t\teventName,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t} satisfies IContainerTelemetry;\n\t};\n\n\tprivate readonly produceDiposedTelemetry = (payload?: {\n\t\terror?: ICriticalContainerError;\n\t}): ContainerDisposedTelemetry => {\n\t\tconst telemetry: ContainerDisposedTelemetry = {\n\t\t\teventName: ContainerTelemetryEventNames.DISPOSED,\n\t\t\tcontainerId: this.containerId,\n\t\t\tcontainerInstanceId: this.containerInstanceId,\n\t\t};\n\t\tif (payload?.error !== undefined) {\n\t\t\ttelemetry.error = payload.error;\n\t\t}\n\t\treturn telemetry;\n\t};\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/fluid-telemetry",
3
- "version": "2.53.1",
3
+ "version": "2.60.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,22 +47,22 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/index.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/container-definitions": "~2.53.1",
51
- "@fluidframework/container-loader": "~2.53.1",
52
- "@fluidframework/fluid-static": "~2.53.1",
50
+ "@fluidframework/container-definitions": "~2.60.0",
51
+ "@fluidframework/container-loader": "~2.60.0",
52
+ "@fluidframework/fluid-static": "~2.60.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.17.1",
58
58
  "@biomejs/biome": "~1.9.3",
59
- "@fluid-internal/client-utils": "~2.53.1",
60
- "@fluid-internal/mocha-test-setup": "~2.53.1",
59
+ "@fluid-internal/client-utils": "~2.60.0",
60
+ "@fluid-internal/mocha-test-setup": "~2.60.0",
61
61
  "@fluid-tools/build-cli": "^0.57.0",
62
62
  "@fluidframework/build-tools": "^0.57.0",
63
- "@fluidframework/test-utils": "~2.53.1",
64
- "@fluidframework/tinylicious-client": "~2.53.1",
65
- "@fluidframework/tree": "~2.53.1",
63
+ "@fluidframework/test-utils": "~2.60.0",
64
+ "@fluidframework/tinylicious-client": "~2.60.0",
65
+ "@fluidframework/tree": "~2.60.0",
66
66
  "@microsoft/api-extractor": "7.52.8",
67
67
  "@types/chai": "^4.0.0",
68
68
  "@types/mocha": "^10.0.10",
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type { IFluidTelemetry } from "../index.js";
6
+ import type { IFluidTelemetry } from "../telemetry/index.js";
7
7
 
8
8
  /**
9
9
  * Base interface for all telemetry consumers.
@@ -6,7 +6,7 @@
6
6
  import type { ICriticalContainerError } from "@fluidframework/container-definitions";
7
7
  import { v4 as uuid } from "uuid";
8
8
 
9
- import type { IFluidTelemetry } from "../index.js";
9
+ import type { IFluidTelemetry } from "../common/index.js";
10
10
 
11
11
  import {
12
12
  type IFluidContainerSystemEventName,