@fluidframework/telemetry-utils 2.101.1 → 2.103.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,13 @@
1
1
  # @fluidframework/telemetry-utils
2
2
 
3
+ ## 2.103.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.102.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.101.0
4
12
 
5
13
  Dependency updates only.
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAChC,IAAI,CACH,yBAAyB,EACvB,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,WAAW,CACb,CACD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,wBAAwB,GAC9B,OAAO,CAAC,SAAS,CAInB;AAuGD;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,aAAa,EAAE,eAAe;aAatE,KAAK,CAAC;IAZvB,SAAgB,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AE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}
package/dist/error.js CHANGED
@@ -194,7 +194,7 @@ class DataProcessingError extends errorLogging_js_1.LoggingError {
194
194
  * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.
195
195
  */
196
196
  static wrapIfUnrecognized(originalError, dataProcessingCodepath, messageLike) {
197
- return wrapDataProcessingErrorIfUnrecognized((errorMessage, props) => new DataProcessingError(errorMessage, props), originalError, dataProcessingCodepath, messageLike);
197
+ return wrapDataProcessingErrorIfUnrecognized((errorMessage) => new DataProcessingError(errorMessage), originalError, dataProcessingCodepath, messageLike);
198
198
  }
199
199
  }
200
200
  exports.DataProcessingError = DataProcessingError;
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAKkD;AAGlD,uDAM2B;AAoB3B;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AARD,oDAQC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAChC,OAA4D,EAC5D,YAAoB,EACpB,QAAgB,EAChB,WAAyB,EACzB,QAAiC,EAAE,EACnC,eAAwB;IAExB,MAAM,WAAW,GAAG,KAA+C,CAAC;IACpE,MAAM,uBAAuB,GAAG,WAAW,CAAC,eAAe,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AChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAxCD,8DAwCC;AAED;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC;AAhBU,QAAA,gCAAgC,oCAgB1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string, props?: ITelemetryBaseProperties) =>\n\t\t\t\tnew DataProcessingError(errorMessage, props),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAKkD;AAGlD,uDAM2B;AAoB3B;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AARD,oDAQC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAChC,OAA4D,EAC5D,YAAoB,EACpB,QAAgB,EAChB,WAAyB,EACzB,QAAiC,EAAE,E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AAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC;QAChE,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,iCAAiC;YACrC,oBAAoB,CAAC,iCAAiC,CAAC;QACxD,IAAI,CAAC,wBAAwB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC;QAC9E,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAC7C,CAAC;CACD;AAxCD,8DAwCC;AAED;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,CAC/C,WAAwB,EAQvB,EAAE,CAAC,CAAC;IACL,eAAe,EAAE,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;IAC9E,qBAAqB,EAAE,WAAW,CAAC,cAAc;IACjD,2BAA2B,EAAE,WAAW,CAAC,oBAAoB;IAC7D,8BAA8B,EAAE,WAAW,CAAC,uBAAuB;IACnE,4BAA4B,EAAE,WAAW,CAAC,qBAAqB;IAC/D,gBAAgB,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC;AAhBU,QAAA,gCAAgC,oCAgB1C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string) => new DataProcessingError(errorMessage),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
@@ -17,15 +17,4 @@ export type { ITelemetryEventExt, TelemetryLoggerExt, } from "./telemetryTypes.j
17
17
  export type { ITelemetryGenericEventExt, ITelemetryErrorEventExt, ITelemetryPerformanceEventExt, TelemetryEventCategory, } from "./telemetryTypesUndeprecated.js";
18
18
  export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
19
19
  export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
20
- import type { TelemetryLoggerExt } from "./telemetryTypes.js";
21
- /**
22
- * Renamed version of TelemetryLoggerExt for convenience of internal use.
23
- * Where "`ITelemetryLoggerExt`" is exposed in customer API surface, true
24
- * `ITelemetryLoggerExt` (that is an erased type) must be used. To access
25
- * use `@fluidframework/telemetry-utils/legacy` import spec. All internal
26
- * usages should be promoted to `TelemetryLoggerExt` naming.
27
- *
28
- * @internal
29
- */
30
- export type ITelemetryLoggerExt = TelemetryLoggerExt;
31
20
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,4BAA4B,EAC5B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,eAAe,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,WAAW,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAClB,KAAK,eAAe,EACpB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EACV,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,g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B,OAAA;AACvB,8GAAA,iBAAiB,OAAA;AACjB,kHAAA,qBAAqB,OAAA;AACrB,sHAAA,yBAAyB,OAAA;AACzB,uGAAA,UAAU,OAAA;AAGV,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,oGAAA,OAAO,OAAA;AACP,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,kHAAA,qBAAqB,OAAA;AAEtB,iDAIyB;AAHxB,oHAAA,mBAAmB,OAAA;AAEnB,2GAAA,UAAU,OAAA;AAEX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,yEAKqC;AAJpC,mIAAA,sBAAsB,OAAA;AAKvB,uCAKoB;AAJnB,+GAAA,mBAAmB,OAAA;AAGnB,mGAAA,OAAO,OAAA;AAYR,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,6DAA+F;AAAtF,iIAAA,0BAA0B,OAAA;AAAE,iIAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./main.js\";\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n\ttype MessageLike,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\textractTelemetryLoggerExt,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttoITelemetryLoggerExt,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tITelemetryEventExt,\n\tTelemetryLoggerExt,\n} from \"./telemetryTypes.js\";\nexport type {\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n\nimport type { TelemetryLoggerExt } from \"./telemetryTypes.js\";\n\n/**\n * Renamed version of TelemetryLoggerExt for convenience of internal use.\n * Where \"`ITelemetryLoggerExt`\" is exposed in customer API surface, true\n * `ITelemetryLoggerExt` (that is an erased type) must be used. To access\n * use `@fluidframework/telemetry-utils/legacy` import spec. All internal\n * usages should be promoted to `TelemetryLoggerExt` naming.\n *\n * @internal\n */\nexport type ITelemetryLoggerExt = TelemetryLoggerExt;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;AAEH,8HAA8H;AAC9H,gDAAgD;AAChD,4CAA0B;AAE1B,yCAUqB;AATpB,yHAAA,4BAA4B,OAAA;AAE5B,yHAAA,4BAA4B,OAAA;AAC5B,mHAAA,sBAAsB,OAAA;AAEtB,sHAAA,yBAAyB,OAAA;AACzB,2HAAA,8BAA8B,OAAA;AAC9B,0HAAA,6BAA6B,OAAA;AAG9B,uCASoB;AARnB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,4HAAA,gCAAgC,OAAA;AAChC,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,gHAAA,oBAAoB,OAAA;AACpB,qHAAA,yBAAyB,OAAA;AAG1B,qDAe2B;AAd1B,gIAAA,6BAA6B,OAAA;AAC7B,yHAAA,sBAAsB,OAAA;AACtB,gHAAA,aAAa,OAAA;AACb,sHAAA,mBAAmB,OAAA;AAEnB,kHAAA,eAAe,OAAA;AACf,kHAAA,eAAe,OAAA;AACf,iIAAA,8BAA8B,OAAA;AAC9B,+GAAA,YAAY,OAAA;AACZ,wHAAA,qBAAqB,OAAA;AACrB,iHAAA,cAAc,OAAA;AACd,iHAAA,cAAc,OAAA;AACd,4GAAA,SAAS,OAAA;AACT,kHAAA,eAAe,OAAA;AAEhB,yCAKqB;AAJpB,+GAAA,kBAAkB,OAAA;AAClB,kHAAA,qBAAqB,OAAA;AACrB,gHAAA,mBAAmB,OAAA;AACnB,2GAAA,cAAc,OAAA;AAEf,yDAK6B;AAJ5B,uHAAA,kBAAkB,OAAA;AAElB,iHAAA,YAAY,OAAA;AACZ,gIAAA,2BAA2B,OAAA;AAE5B,yCAeqB;AAdpB,oHAAA,uBAAuB,OAAA;AACvB,8GAAA,iBAAiB,OAAA;AACjB,kHAAA,qBAAqB,OAAA;AACrB,sHAAA,yBAAyB,OAAA;AACzB,uGAAA,UAAU,OAAA;AAGV,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,oGAAA,OAAO,OAAA;AACP,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,kHAAA,qBAAqB,OAAA;AAEtB,iDAIyB;AAHxB,oHAAA,mBAAmB,OAAA;AAEnB,2GAAA,UAAU,OAAA;AAEX,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,yEAKqC;AAJpC,mIAAA,sBAAsB,OAAA;AAKvB,uCAKoB;AAJnB,+GAAA,mBAAmB,OAAA;AAGnB,mGAAA,OAAO,OAAA;AAYR,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,6DAA+F;AAAtF,iIAAA,0BAA0B,OAAA;AAAE,iIAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./main.js\";\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n\ttype MessageLike,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\textractTelemetryLoggerExt,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttoITelemetryLoggerExt,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tITelemetryEventExt,\n\tTelemetryLoggerExt,\n} from \"./telemetryTypes.js\";\nexport type {\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n"]}
package/dist/logger.d.ts CHANGED
@@ -287,6 +287,10 @@ export interface IPerformanceEventMarkers {
287
287
  start?: true;
288
288
  end?: true;
289
289
  cancel?: "generic" | "error";
290
+ /**
291
+ * If specified, _end events whose duration is greater than this threshold are logged as essential.
292
+ */
293
+ endEventEssentialDurationThresholdMs?: number;
290
294
  }
291
295
  /**
292
296
  * Helper class to log performance events.
@@ -362,6 +366,14 @@ export declare class PerformanceEvent {
362
366
  * Report the event, if it hasn't already been reported.
363
367
  */
364
368
  reportEvent(eventNameSuffix: string, props?: ITelemetryPropertiesExt, error?: unknown): void;
369
+ /**
370
+ * Get the LogLevel for performance events.
371
+ * @param eventNameSuffix - The suffix of the event name.
372
+ * @param event - The telemetry performance event.
373
+ * @returns The log level for the event.
374
+ *
375
+ */
376
+ private getLogLevel;
365
377
  private static readonly eventHits;
366
378
  private static shouldReport;
367
379
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,8BAA8B,EACnC,MAAM,iCAAiC,CAAC;AAazC,OAAO,KAAK,EAEX,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,6BAA6B,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,mBAAmB,CAErF;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sBA,cAAc,CACpB,KAAK,CAAC,EAAE,uBAAuB,EAC/B,eAAe,GAAE,MAAiB,GAChC,IAAI;IAIP,OAAO,CAAC,OAAO;IAWR,GAAG,CAAC,KAAK,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAQjD,OAAO,CAAC,kBAAkB;IASnB,MAAM,CAAC,KAAK,CAAC,EAAE,uBAAuB,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IASrE;;OAEG;IACI,WAAW,CACjB,eAAe,EAAE,MAAM,EACvB,KAAK,CAAC,EAAE,uBAAuB,EAC/B,KAAK,CAAC,EAAE,OAAO,GACb,IAAI;IAoBP;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAA6B;IAC9D,OAAO,CAAC,MAAM,CAAC,YAAY;CAS3B;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,CAAC,EAAE,6BAA6B,GAAG,MAAM,CAAC,6BAA6B,CAAC,GACtE,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAOzE;AA0BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,gGAIsB,8BAA8B,SAGlE,CAAC,UACE,CAAC,2CAGc,8BAA8B;;SAG3C,CAAC;;;SAID,CAAC;oDAoB0B,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,oEAGa,8BAA8B,YAG/D,CAAC,2CAGc,8BAA8B;;SAG3C,iBAAiB,YAAY;;;SAI7B,iBAAiB,YAAY;oDAG6C,CAAC"}
package/dist/logger.js CHANGED
@@ -614,7 +614,28 @@ class PerformanceEvent {
614
614
  if (eventNameSuffix !== "start") {
615
615
  event.duration = this.duration;
616
616
  }
617
- this.logger.sendPerformanceEvent(event, error, this.logLevel);
617
+ this.logger.sendPerformanceEvent(event, error, this.getLogLevel(eventNameSuffix, event));
618
+ }
619
+ /**
620
+ * Get the LogLevel for performance events.
621
+ * @param eventNameSuffix - The suffix of the event name.
622
+ * @param event - The telemetry performance event.
623
+ * @returns The log level for the event.
624
+ *
625
+ */
626
+ getLogLevel(eventNameSuffix, event) {
627
+ if (eventNameSuffix === "cancel") {
628
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
629
+ return undefined;
630
+ }
631
+ if (eventNameSuffix === "end" &&
632
+ event.duration !== undefined &&
633
+ this.markers.endEventEssentialDurationThresholdMs !== undefined &&
634
+ event.duration > this.markers.endEventEssentialDurationThresholdMs) {
635
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
636
+ return undefined;
637
+ }
638
+ return this.logLevel;
618
639
  }
619
640
  static shouldReport(event, sampleThreshold) {
620
641
  const eventKey = `.${event.category}.${event.eventName}`;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,qEAMyC;AAEzC,2CAIqB;AACrB,uDAK2B;AAe3B;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAA0B;IAC/D,OAAO,MAAwC,CAAC;AACjD,CAAC;AAFD,sDAEC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,yBAAyB,CAMxC,KAGkE;IAElE,OAAO,KAAsC,CAAC;AAC/C,CAAC;AAZD,8DAYC;AAED;;;;;;GAMG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,iDAA6B,CAAA;IAC7B;;OAEG;IACH,yCAAqB,CAAA;AACtB,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B;AA6BD;;;;;;;;;GASG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,GAA8B;IAC9D,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC;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,EAAE,EAAE,EAAE,EAAE,EAAE;IAClB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;IACxB,iDAAiD;IACjD,kDAAkD;IAClD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QACjC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE;YACd,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC,EAAE,EAAE,CAA+B,CAAC;AAtC1B,QAAA,OAAO,WAsCmB;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,gBAAgB,GAAG,CAM/B,MAAS,EAaR,EAAE,CAAC,IAAA,eAAO,EAAmC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAnBzE,QAAA,gBAAgB,oBAmByD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport {\n\ttype ITelemetryBaseEvent,\n\ttype ITelemetryBaseLogger,\n\tLogLevel,\n\ttype Tagged,\n\ttype TelemetryBaseEventPropertyType,\n} from \"@fluidframework/core-interfaces\";\n\nimport {\n\tCachedConfigProvider,\n\tloggerIsMonitoringContext,\n\tmixinMonitoringContext,\n} from \"./config.js\";\nimport {\n\textractLogSafeErrorProperties,\n\tgenerateStack,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n} from \"./errorLogging.js\";\nimport type {\n\tITelemetryEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryLoggerExt,\n\tTelemetryEventPropertyTypeExt,\n} from \"./telemetryTypes.js\";\nimport type {\n\tITelemetryErrorEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\n\n/**\n * Type erase a {@link TelemetryLoggerExt} to an {@link ITelemetryLoggerExt}.\n * @internal\n */\nexport function toITelemetryLoggerExt(logger: TelemetryLoggerExt): ITelemetryLoggerExt {\n\treturn logger as unknown as ITelemetryLoggerExt;\n}\n\n/**\n * Un-type-erase the {@link ITelemetryLoggerExt}.\n * @remarks\n * This is the extraction helper as documented by {@link @fluidframework/core-interfaces#BrandedType}.\n *\n * @typeParam options - options for the extraction, currently only supports making\n * the output possibly undefined (when `PossiblyUndefined: true`), which is useful\n * for cases where we want to allow passing `undefined` through.\n *\n * @privateRemarks `ITelemetryLoggerExt` is not currently a branded type, but will\n * be when the breaking change is made. At that time, use of this helper will be\n * required.\n *\n * @internal\n */\nexport function extractTelemetryLoggerExt<\n\toptions extends {\n\t\tPossiblyUndefined?: true;\n\t} = // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- empty object without PossiblyUndefined is the correct type\n\t{},\n>(\n\tinput:\n\t\t| ITelemetryLoggerExt\n\t\t| TelemetryLoggerExt\n\t\t| (options[\"PossiblyUndefined\"] extends true ? undefined : never),\n): TelemetryLoggerExt | (options[\"PossiblyUndefined\"] extends true ? undefined : never) {\n\treturn input as unknown as TelemetryLoggerExt;\n}\n\n/**\n * Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry.\n *\n * @privateRemarks Please do not modify existing entries, to maintain backwards compatibility.\n *\n * @internal\n */\nexport enum TelemetryDataTag {\n\t/**\n\t * Data containing terms or IDs from code packages that may have been dynamically loaded\n\t */\n\tCodeArtifact = \"CodeArtifact\",\n\t/**\n\t * Personal data of a variety of classifications that pertains to the user\n\t */\n\tUserData = \"UserData\",\n}\n\n/**\n * @legacy\n * @beta\n */\nexport type TelemetryEventPropertyTypes = ITelemetryPropertiesExt[string];\n\n/**\n * @legacy\n * @beta\n */\nexport type ITelemetryLoggerPropertyBag = Record<\n\tstring,\n\tTelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes)\n>;\n\n/**\n * @legacy\n * @beta\n *\n * @privateRemarks\n * This is exposed to support {@link createChildLogger} properties parameter.\n */\nexport interface ITelemetryLoggerPropertyBags {\n\tall?: ITelemetryLoggerPropertyBag;\n\terror?: ITelemetryLoggerPropertyBag;\n}\n\n/**\n * Attempts to parse number from string.\n * If it fails, it will return the original string.\n *\n * @remarks\n * Used to make telemetry data typed (and support math operations, like comparison),\n * in places where we do expect numbers (like contentsize/duration property in http header).\n *\n * @internal\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function numberFromString(str: string | null | undefined): string | number | undefined {\n\tif (str === undefined || str === null) {\n\t\treturn undefined;\n\t}\n\tconst num = Number(str);\n\treturn Number.isNaN(num) ? str : num;\n}\n\n// TODO: add docs\n// eslint-disable-next-line jsdoc/require-description\n/**\n * @internal\n */\nexport function formatTick(tick: number): number {\n\treturn Math.floor(tick);\n}\n\n/**\n * String used to concatenate the namespace of parent loggers and their child loggers.\n * @internal\n */\nexport const eventNamespaceSeparator = \":\";\n\n/**\n * TelemetryLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n */\nexport abstract class TelemetryLogger implements TelemetryLoggerExt {\n\t/**\n\t * {@inheritDoc eventNamespaceSeparator}\n\t */\n\tpublic static readonly eventNamespaceSeparator = eventNamespaceSeparator;\n\n\tpublic static sanitizePkgName(name: string): string {\n\t\treturn name.replace(\"@\", \"\").replace(\"/\", \"-\");\n\t}\n\n\t/**\n\t * Take an unknown error object and add the appropriate info from it to the event. Message and stack will be copied\n\t * over from the error object, along with other telemetry properties if it's an ILoggingError.\n\t * @param event - Event being logged\n\t * @param error - Error to extract info from\n\t * @param fetchStack - Whether to fetch the current callstack if error.stack is undefined\n\t */\n\tpublic static prepareErrorObject(\n\t\tevent: ITelemetryBaseEvent,\n\t\terror: unknown,\n\t\tfetchStack: boolean,\n\t): void {\n\t\tconst { message, errorType, stack } = extractLogSafeErrorProperties(\n\t\t\terror,\n\t\t\ttrue /* sanitizeStack */,\n\t\t);\n\t\t// First, copy over error message, stack, and errorType directly (overwrite if present on event)\n\t\tevent.stack = stack;\n\t\tevent.error = message; // Note that the error message goes on the 'error' field\n\t\tevent.errorType = errorType;\n\n\t\tif (isILoggingError(error)) {\n\t\t\t// Add any other telemetry properties from the LoggingError\n\t\t\tconst telemetryProp = error.getTelemetryProperties();\n\t\t\tfor (const key of Object.keys(telemetryProp)) {\n\t\t\t\tif (event[key] !== undefined) {\n\t\t\t\t\t// Don't overwrite existing properties on the event\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tevent[key] = telemetryProp[key];\n\t\t\t}\n\t\t}\n\n\t\t// Collect stack if we were not able to extract it from error\n\t\tif (event.stack === undefined && fetchStack) {\n\t\t\tevent.stack = generateStack();\n\t\t}\n\t}\n\n\tpublic constructor(\n\t\tprotected readonly namespace?: string,\n\t\tprotected readonly properties?: ITelemetryLoggerPropertyBags,\n\t) {}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic abstract send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendTelemetryEvent(\n\t\tevent: ITelemetryGenericEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{ ...event, category: event.category ?? \"generic\" },\n\t\t\terror,\n\t\t\tevent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - level of the log.\n\t */\n\tprivate sendTelemetryEventCore(\n\t\tevent: ITelemetryGenericEventExt & { category: TelemetryEventCategory },\n\t\terror: unknown,\n\t\tlogLevel: LogLevel,\n\t): void {\n\t\tconst newEvent = convertToBaseEvent(event);\n\t\tif (error !== undefined) {\n\t\t\tTelemetryLogger.prepareErrorObject(newEvent, error, false);\n\t\t}\n\n\t\t// Will include Nan & Infinity, but probably we do not care\n\t\tif (typeof newEvent.duration === \"number\") {\n\t\t\tnewEvent.duration = formatTick(newEvent.duration);\n\t\t}\n\n\t\tthis.send(newEvent, logLevel);\n\t}\n\n\t/**\n\t * Send an error telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t */\n\tpublic sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{\n\t\t\t\t// ensure the error field has some value,\n\t\t\t\t// this can and will be overridden by event, or error\n\t\t\t\terror: event.eventName,\n\t\t\t\t...event,\n\t\t\t\tcategory: \"error\",\n\t\t\t},\n\t\t\terror,\n\t\t\tLogLevel.essential,\n\t\t);\n\t}\n\n\t/**\n\t * Send a performance telemetry event with the logger\n\t *\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tconst perfEvent = {\n\t\t\t...event,\n\t\t\tcategory: event.category ?? \"performance\",\n\t\t};\n\n\t\tthis.sendTelemetryEventCore(\n\t\t\tperfEvent,\n\t\t\terror,\n\t\t\tperfEvent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\tprotected prepareEvent(event: ITelemetryBaseEvent): ITelemetryBaseEvent {\n\t\tconst includeErrorProps = event.category === \"error\" || event.error !== undefined;\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\t...event,\n\t\t};\n\t\tif (this.namespace !== undefined) {\n\t\t\tnewEvent.eventName = `${this.namespace}${TelemetryLogger.eventNamespaceSeparator}${newEvent.eventName}`;\n\t\t}\n\t\treturn this.extendProperties(newEvent, includeErrorProps);\n\t}\n\n\tprivate extendProperties<\n\t\tT extends ITelemetryLoggerPropertyBag = ITelemetryLoggerPropertyBag,\n\t>(toExtend: T, includeErrorProps: boolean): T {\n\t\tconst eventLike: ITelemetryLoggerPropertyBag = toExtend;\n\t\tif (this.properties) {\n\t\t\tconst properties: (undefined | ITelemetryLoggerPropertyBag)[] = [];\n\t\t\tproperties.push(this.properties.all);\n\t\t\tif (includeErrorProps) {\n\t\t\t\tproperties.push(this.properties.error);\n\t\t\t}\n\t\t\tfor (const props of properties) {\n\t\t\t\tif (props !== undefined) {\n\t\t\t\t\tfor (const [key, getterOrValue] of Object.entries(props)) {\n\t\t\t\t\t\tif (eventLike[key] !== undefined) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this throws, hopefully it is handled elsewhere\n\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\ttypeof getterOrValue === \"function\" ? getterOrValue() : getterOrValue;\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\teventLike[key] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toExtend;\n\t}\n}\n\n/**\n * @deprecated 0.56, remove TaggedLoggerAdapter once its usage is removed from\n * container-runtime. Issue: #8191\n * TaggedLoggerAdapter class can add tag handling to your logger.\n *\n * @internal\n */\nexport class TaggedLoggerAdapter implements ITelemetryBaseLogger {\n\tpublic constructor(private readonly logger: ITelemetryBaseLogger) {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#ITelemetryBaseLogger.send}\n\t */\n\tpublic send(eventWithTagsMaybe: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\tcategory: eventWithTagsMaybe.category,\n\t\t\teventName: eventWithTagsMaybe.eventName,\n\t\t};\n\t\tfor (const [key, taggableProp] of Object.entries(eventWithTagsMaybe)) {\n\t\t\tconst { value, tag } =\n\t\t\t\ttypeof taggableProp === \"object\"\n\t\t\t\t\t? taggableProp\n\t\t\t\t\t: { value: taggableProp, tag: undefined };\n\t\t\tswitch (tag) {\n\t\t\t\tcase undefined: {\n\t\t\t\t\t// No tag means we can log plainly\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"PackageData\": // For back-compat\n\t\t\t\tcase TelemetryDataTag.CodeArtifact: {\n\t\t\t\t\t// For Microsoft applications, CodeArtifact is safe for now\n\t\t\t\t\t// (we don't load 3P code in 1P apps)\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TelemetryDataTag.UserData: {\n\t\t\t\t\t// Strip out anything tagged explicitly as UserData.\n\t\t\t\t\t// Alternate strategy would be to hash these props\n\t\t\t\t\tnewEvent[key] = \"REDACTED (UserData)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t// If we encounter a tag we don't recognize\n\t\t\t\t\t// then we must assume we should scrub.\n\t\t\t\t\tnewEvent[key] = \"REDACTED (unknown tag)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.logger.send(newEvent);\n\t}\n}\n\nfunction toEitherTelemetryLoggerExt(\n\tlogger: TelemetryLoggerExt,\n): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn logger as TelemetryLoggerExt & ITelemetryLoggerExt;\n}\n\n/**\n * Create a child logger based on the provided props object.\n *\n * @remarks\n * Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.\n *\n * @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.\n *\n * @internal\n *\n * @privateRemarks\n * Return type is both TelemetryLoggerExt and ITelemetryLoggerExt to allow for\n * easier internal usage without needing to type erase or un-type-erase the\n * logger.\n *\n * If always creating a child logger for direct external exposure, consider\n * using {@link createChildLogger} from /legacy API instead, which returns\n * exactly an {@link ITelemetryLoggerExt}.\n */\nexport function createChildLogger(props?: {\n\tlogger?: ITelemetryBaseLogger;\n\tnamespace?: string;\n\tproperties?: ITelemetryLoggerPropertyBags;\n}): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn toEitherTelemetryLoggerExt(\n\t\tChildLogger.create(props?.logger, props?.namespace, props?.properties),\n\t);\n}\n\n/**\n * ChildLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events.\n */\nexport class ChildLogger extends TelemetryLogger {\n\t/**\n\t * Create child logger\n\t * @param baseLogger - Base logger to use to output events. If undefined, proper child logger\n\t * is created, but it does not send telemetry events anywhere.\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t */\n\tpublic static create(\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): TelemetryLogger {\n\t\t// if we are creating a child of a child, rather than nest, which will increase\n\t\t// the callstack overhead, just generate a new logger that includes everything from the previous\n\t\tif (baseLogger instanceof ChildLogger) {\n\t\t\tconst combinedProperties: ITelemetryLoggerPropertyBags = {};\n\t\t\tfor (const extendedProps of [baseLogger.properties, properties]) {\n\t\t\t\tif (extendedProps !== undefined) {\n\t\t\t\t\tif (extendedProps.all !== undefined) {\n\t\t\t\t\t\tcombinedProperties.all = {\n\t\t\t\t\t\t\t...combinedProperties.all,\n\t\t\t\t\t\t\t...extendedProps.all,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (extendedProps.error !== undefined) {\n\t\t\t\t\t\tcombinedProperties.error = {\n\t\t\t\t\t\t\t...combinedProperties.error,\n\t\t\t\t\t\t\t...extendedProps.error,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst combinedNamespace =\n\t\t\t\tbaseLogger.namespace === undefined\n\t\t\t\t\t? namespace\n\t\t\t\t\t: namespace === undefined\n\t\t\t\t\t\t? baseLogger.namespace\n\t\t\t\t\t\t: `${baseLogger.namespace}${TelemetryLogger.eventNamespaceSeparator}${namespace}`;\n\n\t\t\tconst child = new ChildLogger(\n\t\t\t\tbaseLogger.baseLogger,\n\t\t\t\tcombinedNamespace,\n\t\t\t\tcombinedProperties,\n\t\t\t);\n\n\t\t\tif (!loggerIsMonitoringContext(child) && loggerIsMonitoringContext(baseLogger)) {\n\t\t\t\tmixinMonitoringContext(child, baseLogger.config);\n\t\t\t}\n\t\t\treturn child;\n\t\t}\n\n\t\treturn new ChildLogger(baseLogger ?? { send(): void {} }, namespace, properties);\n\t}\n\n\tprivate constructor(\n\t\tprotected readonly baseLogger: ITelemetryBaseLogger,\n\t\tnamespace: string | undefined,\n\t\tproperties: ITelemetryLoggerPropertyBags | undefined,\n\t) {\n\t\tsuper(namespace, properties);\n\n\t\t// propagate the monitoring context\n\t\tif (loggerIsMonitoringContext(baseLogger)) {\n\t\t\tmixinMonitoringContext(this, new CachedConfigProvider(this, baseLogger.config));\n\t\t}\n\t}\n\n\tpublic get minLogLevel(): LogLevel | undefined {\n\t\treturn this.baseLogger.minLogLevel;\n\t}\n\n\tprivate shouldFilterOutEvent(event: ITelemetryBaseEvent, logLevel?: LogLevel): boolean {\n\t\tconst eventLogLevel = logLevel ?? LogLevel.essential;\n\t\tconst configLogLevel = this.baseLogger.minLogLevel ?? LogLevel.info;\n\t\t// Filter out in case event log level is below what is wanted in config.\n\t\treturn eventLogLevel < configLogLevel;\n\t}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tif (this.shouldFilterOutEvent(event, logLevel)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseLogger.send(this.prepareEvent(event), logLevel ?? LogLevel.essential);\n\t}\n}\n\n/**\n * Input properties for {@link createMultiSinkLogger}.\n *\n * @internal\n */\nexport interface MultiSinkLoggerProperties {\n\t/**\n\t * Will be prefixed to all event names.\n\t */\n\tnamespace?: string;\n\n\t/**\n\t * Default properties that will be applied to all events flowing through this logger.\n\t */\n\tproperties?: ITelemetryLoggerPropertyBags;\n\n\t/**\n\t * The base loggers that this logger will forward the logs to, after it processes them.\n\t */\n\tloggers?: (ITelemetryBaseLogger | undefined)[];\n\n\t/**\n\t * If true, the logger will attempt to copy the custom properties (if they are of a known type, i.e. one from this package) of all the base loggers passed to it, to apply them itself to logs that flow through.\n\t */\n\ttryInheritProperties?: true;\n}\n\n/**\n * Create a logger which logs to multiple other loggers based on the provided props object.\n *\n * @internal\n */\nexport function createMultiSinkLogger(props: MultiSinkLoggerProperties): TelemetryLoggerExt {\n\treturn new MultiSinkLogger(\n\t\tprops.namespace,\n\t\tprops.properties,\n\t\tprops.loggers?.filter((l): l is ITelemetryBaseLogger => l !== undefined),\n\t\tprops.tryInheritProperties,\n\t);\n}\n\n/**\n * Multi-sink logger\n * Takes multiple ITelemetryBaseLogger objects (sinks) and logs all events into each sink\n */\nexport class MultiSinkLogger extends TelemetryLogger {\n\tprotected loggers: ITelemetryBaseLogger[];\n\t// This is minimum of minLlogLevel of all loggers.\n\tprivate _minLogLevelOfAllLoggers: LogLevel;\n\n\t/**\n\t * Create multiple sink logger (i.e. logger that sends events to multiple sinks)\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param loggers - The list of loggers to use as sinks\n\t * @param tryInheritProperties - Will attempted to copy those loggers properties to this loggers if they are of a known type e.g. one from this package\n\t */\n\tpublic constructor(\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t\tloggers: ITelemetryBaseLogger[] = [],\n\t\ttryInheritProperties?: true,\n\t) {\n\t\tlet realProperties = properties === undefined ? undefined : { ...properties };\n\t\tif (tryInheritProperties === true) {\n\t\t\tconst merge = (realProperties ??= {});\n\t\t\tloggers\n\t\t\t\t.filter((l): l is this => l instanceof TelemetryLogger)\n\t\t\t\t.map((l) => l.properties ?? {})\n\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t.forEach((cv) => {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t\tObject.keys(cv).forEach((k) => {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\tmerge[k] = { ...cv[k], ...merge?.[k] };\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\tsuper(namespace, realProperties);\n\t\tthis.loggers = loggers;\n\t\tthis._minLogLevelOfAllLoggers = LogLevel.info;\n\t\tthis.calculateMinLogLevel();\n\t}\n\n\tpublic get minLogLevel(): LogLevel {\n\t\treturn this._minLogLevelOfAllLoggers;\n\t}\n\n\tprivate calculateMinLogLevel(): void {\n\t\tif (this.loggers.length > 0) {\n\t\t\tconst logLevels: LogLevel[] = [];\n\t\t\tfor (const logger of this.loggers) {\n\t\t\t\tlogLevels.push(logger.minLogLevel ?? LogLevel.info);\n\t\t\t}\n\t\t\tthis._minLogLevelOfAllLoggers = Math.min(...logLevels) as LogLevel;\n\t\t}\n\t}\n\n\t/**\n\t * Add logger to send all events to\n\t * @param logger - Logger to add\n\t */\n\tpublic addLogger(logger?: ITelemetryBaseLogger): void {\n\t\tif (logger !== undefined && logger !== null) {\n\t\t\tthis.loggers.push(logger);\n\t\t\t// Update in case the logLevel of added logger is less than the current.\n\t\t\tthis.calculateMinLogLevel();\n\t\t}\n\t}\n\n\t/**\n\t * Send an event to the loggers\n\t *\n\t * @param event - the event to send to all the registered logger\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tconst newEvent = this.prepareEvent(event);\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.send(newEvent, logLevel ?? LogLevel.essential);\n\t\t}\n\t}\n}\n\n/**\n * Describes what events {@link PerformanceEvent} should log.\n *\n * @remarks\n * By default, all events are logged, but the client can override this behavior.\n *\n * For example, there is rarely a need to record a start event, as we're really after\n * success / failure tracking, including duration (on success).\n *\n * @internal\n */\nexport interface IPerformanceEventMarkers {\n\tstart?: true;\n\tend?: true;\n\tcancel?: \"generic\" | \"error\"; // tells wether to issue \"generic\" or \"error\" category cancel event\n}\n\n/**\n * Helper class to log performance events.\n *\n * @internal\n */\nexport class PerformanceEvent {\n\t/**\n\t * Creates an instance of {@link PerformanceEvent} and starts measurements\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param emitLogs - should this instance emit logs. If set to false, logs will not be emitted to the logger,\n\t * but measurements will still be performed and any specified markers will be generated.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns An instance of {@link PerformanceEvent}\n\t */\n\tpublic static start(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\temitLogs: boolean = true,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): PerformanceEvent {\n\t\treturn new PerformanceEvent(\n\t\t\textractTelemetryLoggerExt(logger),\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\temitLogs,\n\t\t\tlogLevel,\n\t\t);\n\t}\n\n\t/**\n\t * Measure a synchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static timedExec<T>(\n\t\tlogger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => T,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): T {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Measure an asynchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static async timedExecAsync<T>(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => Promise<T>,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): Promise<T> {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = await callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic get duration(): number {\n\t\treturn performanceNow() - this.startTime;\n\t}\n\n\tprivate event?: ITelemetryGenericEventExt;\n\tprivate readonly startTime = performanceNow();\n\tprivate startMark?: string;\n\n\tprivate constructor(\n\t\tprivate readonly logger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tprivate readonly markers: IPerformanceEventMarkers = { end: true, cancel: \"generic\" },\n\t\tprivate readonly emitLogs: boolean = true,\n\t\tprivate readonly logLevel: typeof LogLevel.verbose | typeof LogLevel.info | undefined,\n\t) {\n\t\tthis.event = { ...event };\n\t\tif (this.markers.start) {\n\t\t\tthis.reportEvent(\"start\");\n\t\t}\n\n\t\tif (\n\t\t\ttypeof window === \"object\" &&\n\t\t\twindow?.performance?.mark !== undefined &&\n\t\t\twindow?.performance?.mark !== null\n\t\t) {\n\t\t\tthis.startMark = `${event.eventName}-start`;\n\t\t\twindow.performance.mark(this.startMark);\n\t\t}\n\t}\n\n\tpublic reportProgress(\n\t\tprops?: ITelemetryPropertiesExt,\n\t\teventNameSuffix: string = \"update\",\n\t): void {\n\t\tthis.reportEvent(eventNameSuffix, props);\n\t}\n\n\tprivate autoEnd(): void {\n\t\t// Event might have been cancelled or ended in the callback\n\t\tif (this.event && this.markers.end) {\n\t\t\tthis.reportEvent(\"end\");\n\t\t}\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tpublic end(props?: ITelemetryPropertiesExt): void {\n\t\tthis.reportEvent(\"end\", props);\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tprivate performanceEndMark(): void {\n\t\tif (this.startMark !== undefined && this.event) {\n\t\t\tconst endMark = `${this.event.eventName}-end`;\n\t\t\twindow.performance.mark(endMark);\n\t\t\twindow.performance.measure(`${this.event.eventName}`, this.startMark, endMark);\n\t\t\tthis.startMark = undefined;\n\t\t}\n\t}\n\n\tpublic cancel(props?: ITelemetryPropertiesExt, error?: unknown): void {\n\t\tif (this.markers.cancel !== undefined) {\n\t\t\tthis.reportEvent(\"cancel\", { category: this.markers.cancel, ...props }, error);\n\t\t}\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\t/**\n\t * Report the event, if it hasn't already been reported.\n\t */\n\tpublic reportEvent(\n\t\teventNameSuffix: string,\n\t\tprops?: ITelemetryPropertiesExt,\n\t\terror?: unknown,\n\t): void {\n\t\t// If the caller invokes cancel or end directly inside the callback for timedExec[Async],\n\t\t// then it's possible to come back through reportEvent twice. Only the first time counts.\n\t\tif (!this.event) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.emitLogs) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event: ITelemetryPerformanceEventExt = { ...this.event, ...props };\n\t\tevent.eventName = `${event.eventName}_${eventNameSuffix}`;\n\t\tif (eventNameSuffix !== \"start\") {\n\t\t\tevent.duration = this.duration;\n\t\t}\n\n\t\tthis.logger.sendPerformanceEvent(event, error, this.logLevel);\n\t}\n\n\tprivate static readonly eventHits = new Map<string, number>();\n\tprivate static shouldReport(\n\t\tevent: ITelemetryGenericEventExt,\n\t\tsampleThreshold: number,\n\t): boolean {\n\t\tconst eventKey = `.${event.category}.${event.eventName}`;\n\t\tconst hitCount = PerformanceEvent.eventHits.get(eventKey) ?? 0;\n\t\tPerformanceEvent.eventHits.set(eventKey, hitCount >= sampleThreshold ? 1 : hitCount + 1);\n\t\treturn hitCount % sampleThreshold === 0;\n\t}\n}\n\n/**\n * Takes in an event object, and converts all of its values to a basePropertyType.\n * In the case of an invalid property type, the value will be converted to an error string.\n * @param event - Event with fields you want to stringify.\n */\nfunction convertToBaseEvent({\n\tcategory,\n\teventName,\n\t...props\n}: ITelemetryEventExt): ITelemetryBaseEvent {\n\tconst newEvent: ITelemetryBaseEvent = { category, eventName };\n\tfor (const key of Object.keys(props)) {\n\t\tnewEvent[key] = convertToBasePropertyType(props[key]);\n\t}\n\treturn newEvent;\n}\n\n/**\n * Takes in value, and does one of 4 things.\n * if value is of primitive type - returns the original value.\n * If the value is a flat array or object - returns a stringified version of the array/object.\n * If the value is an object of type Tagged<TelemetryBaseEventPropertyType> - returns the object\n * with its values recursively converted to base property Type.\n * If none of these cases are reached - returns an error string\n * @param x - value passed in to convert to a base property type\n */\nexport function convertToBasePropertyType(\n\tx: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>,\n): TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType> {\n\treturn isTaggedTelemetryPropertyValue(x)\n\t\t? {\n\t\t\t\tvalue: convertToBasePropertyTypeUntagged(x.value),\n\t\t\t\ttag: x.tag,\n\t\t\t}\n\t\t: convertToBasePropertyTypeUntagged(x);\n}\n\nfunction convertToBasePropertyTypeUntagged(\n\tx: TelemetryEventPropertyTypeExt,\n): TelemetryBaseEventPropertyType {\n\tswitch (typeof x) {\n\t\tcase \"string\":\n\t\tcase \"number\":\n\t\tcase \"boolean\":\n\t\tcase \"undefined\": {\n\t\t\treturn x;\n\t\t}\n\t\tcase \"object\": {\n\t\t\t// We assume this is an array or flat object based on the input types\n\t\t\treturn JSON.stringify(x);\n\t\t}\n\t\tdefault: {\n\t\t\t// should never reach this case based on the input types\n\t\t\tconsole.error(\n\t\t\t\t`convertToBasePropertyTypeUntagged: INVALID PROPERTY (typed as ${typeof x})`,\n\t\t\t);\n\t\t\treturn `INVALID PROPERTY (typed as ${typeof x})`;\n\t\t}\n\t}\n}\n\n/**\n * Tags all given `values` with the same `tag`.\n *\n * @param tag - The tag with which all `values` will be annotated.\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagData(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged.\n *\n * @internal\n */\nexport const tagData = <\n\tT extends TelemetryDataTag,\n\tV extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\ttag: T,\n\tvalues: V,\n): {\n\t[P in keyof V]:\n\t\t| (V[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<V[P]>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<V[P], undefined>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t})\n\t\t| (V[P] extends undefined ? undefined : never);\n} =>\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\tObject.entries(values)\n\t\t.filter((e) => e[1] !== undefined)\n\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t.reduce((pv, cv) => {\n\t\t\tconst [key, value] = cv;\n\t\t\t// The ternary form is less legible in this case.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tpv[key] = () => {\n\t\t\t\t\treturn { tag, value: value() };\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tpv[key] = { tag, value };\n\t\t\t}\n\t\t\treturn pv;\n\t\t}, {}) as ReturnType<typeof tagData>;\n\n/**\n * Tags all provided `values` as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagCodeArtifacts(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @see {@link tagData}\n *\n * @internal\n */\nexport const tagCodeArtifacts = <\n\tT extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\tvalues: T,\n): {\n\t[P in keyof T]:\n\t\t| (T[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<T[P]>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<T[P], undefined>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t})\n\t\t| (T[P] extends undefined ? undefined : never);\n} => tagData<TelemetryDataTag.CodeArtifact, T>(TelemetryDataTag.CodeArtifact, values);\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,qEAMyC;AAEzC,2CAIqB;AACrB,uDAK2B;AAe3B;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAA0B;IAC/D,OAAO,MAAwC,CAAC;AACjD,CAAC;AAFD,sDAEC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,yBAAyB,CAMxC,KAGkE;IAElE,OAAO,KAAsC,CAAC;AAC/C,CAAC;AAZD,8DAYC;AAED;;;;;;GAMG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,iDAA6B,CAAA;IAC7B;;OAEG;IACH,yCAAqB,CAAA;AACtB,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B;AA6BD;;;;;;;;;GASG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,GAA8B;IAC9D,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC;AAND,4CAMC;AAED,iBAAiB;AACjB,qDAAqD;AACrD;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAFD,gCAEC;AAED;;;GAGG;AACU,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;;;GAIG;AACH,MAAsB,eAAe;IAM7B,MAAM,C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AmD;KAClD,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IAClB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;IACxB,iDAAiD;IACjD,kDAAkD;IAClD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QACjC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE;YACd,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC,EAAE,EAAE,CAA+B,CAAC;AAtC1B,QAAA,OAAO,WAsCmB;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,gBAAgB,GAAG,CAM/B,MAAS,EAaR,EAAE,CAAC,IAAA,eAAO,EAAmC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAnBzE,QAAA,gBAAgB,oBAmByD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport {\n\ttype ITelemetryBaseEvent,\n\ttype ITelemetryBaseLogger,\n\tLogLevel,\n\ttype Tagged,\n\ttype TelemetryBaseEventPropertyType,\n} from \"@fluidframework/core-interfaces\";\n\nimport {\n\tCachedConfigProvider,\n\tloggerIsMonitoringContext,\n\tmixinMonitoringContext,\n} from \"./config.js\";\nimport {\n\textractLogSafeErrorProperties,\n\tgenerateStack,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n} from \"./errorLogging.js\";\nimport type {\n\tITelemetryEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryLoggerExt,\n\tTelemetryEventPropertyTypeExt,\n} from \"./telemetryTypes.js\";\nimport type {\n\tITelemetryErrorEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\n\n/**\n * Type erase a {@link TelemetryLoggerExt} to an {@link ITelemetryLoggerExt}.\n * @internal\n */\nexport function toITelemetryLoggerExt(logger: TelemetryLoggerExt): ITelemetryLoggerExt {\n\treturn logger as unknown as ITelemetryLoggerExt;\n}\n\n/**\n * Un-type-erase the {@link ITelemetryLoggerExt}.\n * @remarks\n * This is the extraction helper as documented by {@link @fluidframework/core-interfaces#BrandedType}.\n *\n * @typeParam options - options for the extraction, currently only supports making\n * the output possibly undefined (when `PossiblyUndefined: true`), which is useful\n * for cases where we want to allow passing `undefined` through.\n *\n * @privateRemarks `ITelemetryLoggerExt` is not currently a branded type, but will\n * be when the breaking change is made. At that time, use of this helper will be\n * required.\n *\n * @internal\n */\nexport function extractTelemetryLoggerExt<\n\toptions extends {\n\t\tPossiblyUndefined?: true;\n\t} = // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- empty object without PossiblyUndefined is the correct type\n\t{},\n>(\n\tinput:\n\t\t| ITelemetryLoggerExt\n\t\t| TelemetryLoggerExt\n\t\t| (options[\"PossiblyUndefined\"] extends true ? undefined : never),\n): TelemetryLoggerExt | (options[\"PossiblyUndefined\"] extends true ? undefined : never) {\n\treturn input as unknown as TelemetryLoggerExt;\n}\n\n/**\n * Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry.\n *\n * @privateRemarks Please do not modify existing entries, to maintain backwards compatibility.\n *\n * @internal\n */\nexport enum TelemetryDataTag {\n\t/**\n\t * Data containing terms or IDs from code packages that may have been dynamically loaded\n\t */\n\tCodeArtifact = \"CodeArtifact\",\n\t/**\n\t * Personal data of a variety of classifications that pertains to the user\n\t */\n\tUserData = \"UserData\",\n}\n\n/**\n * @legacy\n * @beta\n */\nexport type TelemetryEventPropertyTypes = ITelemetryPropertiesExt[string];\n\n/**\n * @legacy\n * @beta\n */\nexport type ITelemetryLoggerPropertyBag = Record<\n\tstring,\n\tTelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes)\n>;\n\n/**\n * @legacy\n * @beta\n *\n * @privateRemarks\n * This is exposed to support {@link createChildLogger} properties parameter.\n */\nexport interface ITelemetryLoggerPropertyBags {\n\tall?: ITelemetryLoggerPropertyBag;\n\terror?: ITelemetryLoggerPropertyBag;\n}\n\n/**\n * Attempts to parse number from string.\n * If it fails, it will return the original string.\n *\n * @remarks\n * Used to make telemetry data typed (and support math operations, like comparison),\n * in places where we do expect numbers (like contentsize/duration property in http header).\n *\n * @internal\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function numberFromString(str: string | null | undefined): string | number | undefined {\n\tif (str === undefined || str === null) {\n\t\treturn undefined;\n\t}\n\tconst num = Number(str);\n\treturn Number.isNaN(num) ? str : num;\n}\n\n// TODO: add docs\n// eslint-disable-next-line jsdoc/require-description\n/**\n * @internal\n */\nexport function formatTick(tick: number): number {\n\treturn Math.floor(tick);\n}\n\n/**\n * String used to concatenate the namespace of parent loggers and their child loggers.\n * @internal\n */\nexport const eventNamespaceSeparator = \":\";\n\n/**\n * TelemetryLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n */\nexport abstract class TelemetryLogger implements TelemetryLoggerExt {\n\t/**\n\t * {@inheritDoc eventNamespaceSeparator}\n\t */\n\tpublic static readonly eventNamespaceSeparator = eventNamespaceSeparator;\n\n\tpublic static sanitizePkgName(name: string): string {\n\t\treturn name.replace(\"@\", \"\").replace(\"/\", \"-\");\n\t}\n\n\t/**\n\t * Take an unknown error object and add the appropriate info from it to the event. Message and stack will be copied\n\t * over from the error object, along with other telemetry properties if it's an ILoggingError.\n\t * @param event - Event being logged\n\t * @param error - Error to extract info from\n\t * @param fetchStack - Whether to fetch the current callstack if error.stack is undefined\n\t */\n\tpublic static prepareErrorObject(\n\t\tevent: ITelemetryBaseEvent,\n\t\terror: unknown,\n\t\tfetchStack: boolean,\n\t): void {\n\t\tconst { message, errorType, stack } = extractLogSafeErrorProperties(\n\t\t\terror,\n\t\t\ttrue /* sanitizeStack */,\n\t\t);\n\t\t// First, copy over error message, stack, and errorType directly (overwrite if present on event)\n\t\tevent.stack = stack;\n\t\tevent.error = message; // Note that the error message goes on the 'error' field\n\t\tevent.errorType = errorType;\n\n\t\tif (isILoggingError(error)) {\n\t\t\t// Add any other telemetry properties from the LoggingError\n\t\t\tconst telemetryProp = error.getTelemetryProperties();\n\t\t\tfor (const key of Object.keys(telemetryProp)) {\n\t\t\t\tif (event[key] !== undefined) {\n\t\t\t\t\t// Don't overwrite existing properties on the event\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tevent[key] = telemetryProp[key];\n\t\t\t}\n\t\t}\n\n\t\t// Collect stack if we were not able to extract it from error\n\t\tif (event.stack === undefined && fetchStack) {\n\t\t\tevent.stack = generateStack();\n\t\t}\n\t}\n\n\tpublic constructor(\n\t\tprotected readonly namespace?: string,\n\t\tprotected readonly properties?: ITelemetryLoggerPropertyBags,\n\t) {}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic abstract send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendTelemetryEvent(\n\t\tevent: ITelemetryGenericEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{ ...event, category: event.category ?? \"generic\" },\n\t\t\terror,\n\t\t\tevent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - level of the log.\n\t */\n\tprivate sendTelemetryEventCore(\n\t\tevent: ITelemetryGenericEventExt & { category: TelemetryEventCategory },\n\t\terror: unknown,\n\t\tlogLevel: LogLevel,\n\t): void {\n\t\tconst newEvent = convertToBaseEvent(event);\n\t\tif (error !== undefined) {\n\t\t\tTelemetryLogger.prepareErrorObject(newEvent, error, false);\n\t\t}\n\n\t\t// Will include Nan & Infinity, but probably we do not care\n\t\tif (typeof newEvent.duration === \"number\") {\n\t\t\tnewEvent.duration = formatTick(newEvent.duration);\n\t\t}\n\n\t\tthis.send(newEvent, logLevel);\n\t}\n\n\t/**\n\t * Send an error telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t */\n\tpublic sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{\n\t\t\t\t// ensure the error field has some value,\n\t\t\t\t// this can and will be overridden by event, or error\n\t\t\t\terror: event.eventName,\n\t\t\t\t...event,\n\t\t\t\tcategory: \"error\",\n\t\t\t},\n\t\t\terror,\n\t\t\tLogLevel.essential,\n\t\t);\n\t}\n\n\t/**\n\t * Send a performance telemetry event with the logger\n\t *\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tconst perfEvent = {\n\t\t\t...event,\n\t\t\tcategory: event.category ?? \"performance\",\n\t\t};\n\n\t\tthis.sendTelemetryEventCore(\n\t\t\tperfEvent,\n\t\t\terror,\n\t\t\tperfEvent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\tprotected prepareEvent(event: ITelemetryBaseEvent): ITelemetryBaseEvent {\n\t\tconst includeErrorProps = event.category === \"error\" || event.error !== undefined;\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\t...event,\n\t\t};\n\t\tif (this.namespace !== undefined) {\n\t\t\tnewEvent.eventName = `${this.namespace}${TelemetryLogger.eventNamespaceSeparator}${newEvent.eventName}`;\n\t\t}\n\t\treturn this.extendProperties(newEvent, includeErrorProps);\n\t}\n\n\tprivate extendProperties<\n\t\tT extends ITelemetryLoggerPropertyBag = ITelemetryLoggerPropertyBag,\n\t>(toExtend: T, includeErrorProps: boolean): T {\n\t\tconst eventLike: ITelemetryLoggerPropertyBag = toExtend;\n\t\tif (this.properties) {\n\t\t\tconst properties: (undefined | ITelemetryLoggerPropertyBag)[] = [];\n\t\t\tproperties.push(this.properties.all);\n\t\t\tif (includeErrorProps) {\n\t\t\t\tproperties.push(this.properties.error);\n\t\t\t}\n\t\t\tfor (const props of properties) {\n\t\t\t\tif (props !== undefined) {\n\t\t\t\t\tfor (const [key, getterOrValue] of Object.entries(props)) {\n\t\t\t\t\t\tif (eventLike[key] !== undefined) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this throws, hopefully it is handled elsewhere\n\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\ttypeof getterOrValue === \"function\" ? getterOrValue() : getterOrValue;\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\teventLike[key] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toExtend;\n\t}\n}\n\n/**\n * @deprecated 0.56, remove TaggedLoggerAdapter once its usage is removed from\n * container-runtime. Issue: #8191\n * TaggedLoggerAdapter class can add tag handling to your logger.\n *\n * @internal\n */\nexport class TaggedLoggerAdapter implements ITelemetryBaseLogger {\n\tpublic constructor(private readonly logger: ITelemetryBaseLogger) {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#ITelemetryBaseLogger.send}\n\t */\n\tpublic send(eventWithTagsMaybe: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\tcategory: eventWithTagsMaybe.category,\n\t\t\teventName: eventWithTagsMaybe.eventName,\n\t\t};\n\t\tfor (const [key, taggableProp] of Object.entries(eventWithTagsMaybe)) {\n\t\t\tconst { value, tag } =\n\t\t\t\ttypeof taggableProp === \"object\"\n\t\t\t\t\t? taggableProp\n\t\t\t\t\t: { value: taggableProp, tag: undefined };\n\t\t\tswitch (tag) {\n\t\t\t\tcase undefined: {\n\t\t\t\t\t// No tag means we can log plainly\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"PackageData\": // For back-compat\n\t\t\t\tcase TelemetryDataTag.CodeArtifact: {\n\t\t\t\t\t// For Microsoft applications, CodeArtifact is safe for now\n\t\t\t\t\t// (we don't load 3P code in 1P apps)\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TelemetryDataTag.UserData: {\n\t\t\t\t\t// Strip out anything tagged explicitly as UserData.\n\t\t\t\t\t// Alternate strategy would be to hash these props\n\t\t\t\t\tnewEvent[key] = \"REDACTED (UserData)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t// If we encounter a tag we don't recognize\n\t\t\t\t\t// then we must assume we should scrub.\n\t\t\t\t\tnewEvent[key] = \"REDACTED (unknown tag)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.logger.send(newEvent);\n\t}\n}\n\nfunction toEitherTelemetryLoggerExt(\n\tlogger: TelemetryLoggerExt,\n): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn logger as TelemetryLoggerExt & ITelemetryLoggerExt;\n}\n\n/**\n * Create a child logger based on the provided props object.\n *\n * @remarks\n * Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.\n *\n * @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.\n *\n * @internal\n *\n * @privateRemarks\n * Return type is both TelemetryLoggerExt and ITelemetryLoggerExt to allow for\n * easier internal usage without needing to type erase or un-type-erase the\n * logger.\n *\n * If always creating a child logger for direct external exposure, consider\n * using {@link createChildLogger} from /legacy API instead, which returns\n * exactly an {@link ITelemetryLoggerExt}.\n */\nexport function createChildLogger(props?: {\n\tlogger?: ITelemetryBaseLogger;\n\tnamespace?: string;\n\tproperties?: ITelemetryLoggerPropertyBags;\n}): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn toEitherTelemetryLoggerExt(\n\t\tChildLogger.create(props?.logger, props?.namespace, props?.properties),\n\t);\n}\n\n/**\n * ChildLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events.\n */\nexport class ChildLogger extends TelemetryLogger {\n\t/**\n\t * Create child logger\n\t * @param baseLogger - Base logger to use to output events. If undefined, proper child logger\n\t * is created, but it does not send telemetry events anywhere.\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t */\n\tpublic static create(\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): TelemetryLogger {\n\t\t// if we are creating a child of a child, rather than nest, which will increase\n\t\t// the callstack overhead, just generate a new logger that includes everything from the previous\n\t\tif (baseLogger instanceof ChildLogger) {\n\t\t\tconst combinedProperties: ITelemetryLoggerPropertyBags = {};\n\t\t\tfor (const extendedProps of [baseLogger.properties, properties]) {\n\t\t\t\tif (extendedProps !== undefined) {\n\t\t\t\t\tif (extendedProps.all !== undefined) {\n\t\t\t\t\t\tcombinedProperties.all = {\n\t\t\t\t\t\t\t...combinedProperties.all,\n\t\t\t\t\t\t\t...extendedProps.all,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (extendedProps.error !== undefined) {\n\t\t\t\t\t\tcombinedProperties.error = {\n\t\t\t\t\t\t\t...combinedProperties.error,\n\t\t\t\t\t\t\t...extendedProps.error,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst combinedNamespace =\n\t\t\t\tbaseLogger.namespace === undefined\n\t\t\t\t\t? namespace\n\t\t\t\t\t: namespace === undefined\n\t\t\t\t\t\t? baseLogger.namespace\n\t\t\t\t\t\t: `${baseLogger.namespace}${TelemetryLogger.eventNamespaceSeparator}${namespace}`;\n\n\t\t\tconst child = new ChildLogger(\n\t\t\t\tbaseLogger.baseLogger,\n\t\t\t\tcombinedNamespace,\n\t\t\t\tcombinedProperties,\n\t\t\t);\n\n\t\t\tif (!loggerIsMonitoringContext(child) && loggerIsMonitoringContext(baseLogger)) {\n\t\t\t\tmixinMonitoringContext(child, baseLogger.config);\n\t\t\t}\n\t\t\treturn child;\n\t\t}\n\n\t\treturn new ChildLogger(baseLogger ?? { send(): void {} }, namespace, properties);\n\t}\n\n\tprivate constructor(\n\t\tprotected readonly baseLogger: ITelemetryBaseLogger,\n\t\tnamespace: string | undefined,\n\t\tproperties: ITelemetryLoggerPropertyBags | undefined,\n\t) {\n\t\tsuper(namespace, properties);\n\n\t\t// propagate the monitoring context\n\t\tif (loggerIsMonitoringContext(baseLogger)) {\n\t\t\tmixinMonitoringContext(this, new CachedConfigProvider(this, baseLogger.config));\n\t\t}\n\t}\n\n\tpublic get minLogLevel(): LogLevel | undefined {\n\t\treturn this.baseLogger.minLogLevel;\n\t}\n\n\tprivate shouldFilterOutEvent(event: ITelemetryBaseEvent, logLevel?: LogLevel): boolean {\n\t\tconst eventLogLevel = logLevel ?? LogLevel.essential;\n\t\tconst configLogLevel = this.baseLogger.minLogLevel ?? LogLevel.info;\n\t\t// Filter out in case event log level is below what is wanted in config.\n\t\treturn eventLogLevel < configLogLevel;\n\t}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tif (this.shouldFilterOutEvent(event, logLevel)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseLogger.send(this.prepareEvent(event), logLevel ?? LogLevel.essential);\n\t}\n}\n\n/**\n * Input properties for {@link createMultiSinkLogger}.\n *\n * @internal\n */\nexport interface MultiSinkLoggerProperties {\n\t/**\n\t * Will be prefixed to all event names.\n\t */\n\tnamespace?: string;\n\n\t/**\n\t * Default properties that will be applied to all events flowing through this logger.\n\t */\n\tproperties?: ITelemetryLoggerPropertyBags;\n\n\t/**\n\t * The base loggers that this logger will forward the logs to, after it processes them.\n\t */\n\tloggers?: (ITelemetryBaseLogger | undefined)[];\n\n\t/**\n\t * If true, the logger will attempt to copy the custom properties (if they are of a known type, i.e. one from this package) of all the base loggers passed to it, to apply them itself to logs that flow through.\n\t */\n\ttryInheritProperties?: true;\n}\n\n/**\n * Create a logger which logs to multiple other loggers based on the provided props object.\n *\n * @internal\n */\nexport function createMultiSinkLogger(props: MultiSinkLoggerProperties): TelemetryLoggerExt {\n\treturn new MultiSinkLogger(\n\t\tprops.namespace,\n\t\tprops.properties,\n\t\tprops.loggers?.filter((l): l is ITelemetryBaseLogger => l !== undefined),\n\t\tprops.tryInheritProperties,\n\t);\n}\n\n/**\n * Multi-sink logger\n * Takes multiple ITelemetryBaseLogger objects (sinks) and logs all events into each sink\n */\nexport class MultiSinkLogger extends TelemetryLogger {\n\tprotected loggers: ITelemetryBaseLogger[];\n\t// This is minimum of minLlogLevel of all loggers.\n\tprivate _minLogLevelOfAllLoggers: LogLevel;\n\n\t/**\n\t * Create multiple sink logger (i.e. logger that sends events to multiple sinks)\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param loggers - The list of loggers to use as sinks\n\t * @param tryInheritProperties - Will attempted to copy those loggers properties to this loggers if they are of a known type e.g. one from this package\n\t */\n\tpublic constructor(\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t\tloggers: ITelemetryBaseLogger[] = [],\n\t\ttryInheritProperties?: true,\n\t) {\n\t\tlet realProperties = properties === undefined ? undefined : { ...properties };\n\t\tif (tryInheritProperties === true) {\n\t\t\tconst merge = (realProperties ??= {});\n\t\t\tloggers\n\t\t\t\t.filter((l): l is this => l instanceof TelemetryLogger)\n\t\t\t\t.map((l) => l.properties ?? {})\n\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t.forEach((cv) => {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t\tObject.keys(cv).forEach((k) => {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\tmerge[k] = { ...cv[k], ...merge?.[k] };\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\tsuper(namespace, realProperties);\n\t\tthis.loggers = loggers;\n\t\tthis._minLogLevelOfAllLoggers = LogLevel.info;\n\t\tthis.calculateMinLogLevel();\n\t}\n\n\tpublic get minLogLevel(): LogLevel {\n\t\treturn this._minLogLevelOfAllLoggers;\n\t}\n\n\tprivate calculateMinLogLevel(): void {\n\t\tif (this.loggers.length > 0) {\n\t\t\tconst logLevels: LogLevel[] = [];\n\t\t\tfor (const logger of this.loggers) {\n\t\t\t\tlogLevels.push(logger.minLogLevel ?? LogLevel.info);\n\t\t\t}\n\t\t\tthis._minLogLevelOfAllLoggers = Math.min(...logLevels) as LogLevel;\n\t\t}\n\t}\n\n\t/**\n\t * Add logger to send all events to\n\t * @param logger - Logger to add\n\t */\n\tpublic addLogger(logger?: ITelemetryBaseLogger): void {\n\t\tif (logger !== undefined && logger !== null) {\n\t\t\tthis.loggers.push(logger);\n\t\t\t// Update in case the logLevel of added logger is less than the current.\n\t\t\tthis.calculateMinLogLevel();\n\t\t}\n\t}\n\n\t/**\n\t * Send an event to the loggers\n\t *\n\t * @param event - the event to send to all the registered logger\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tconst newEvent = this.prepareEvent(event);\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.send(newEvent, logLevel ?? LogLevel.essential);\n\t\t}\n\t}\n}\n\n/**\n * Describes what events {@link PerformanceEvent} should log.\n *\n * @remarks\n * By default, all events are logged, but the client can override this behavior.\n *\n * For example, there is rarely a need to record a start event, as we're really after\n * success / failure tracking, including duration (on success).\n *\n * @internal\n */\nexport interface IPerformanceEventMarkers {\n\tstart?: true;\n\tend?: true;\n\tcancel?: \"generic\" | \"error\"; // tells whether to issue \"generic\" or \"error\" category cancel event\n\t/**\n\t * If specified, _end events whose duration is greater than this threshold are logged as essential.\n\t */\n\tendEventEssentialDurationThresholdMs?: number;\n}\n\n/**\n * Helper class to log performance events.\n *\n * @internal\n */\nexport class PerformanceEvent {\n\t/**\n\t * Creates an instance of {@link PerformanceEvent} and starts measurements\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param emitLogs - should this instance emit logs. If set to false, logs will not be emitted to the logger,\n\t * but measurements will still be performed and any specified markers will be generated.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns An instance of {@link PerformanceEvent}\n\t */\n\tpublic static start(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\temitLogs: boolean = true,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): PerformanceEvent {\n\t\treturn new PerformanceEvent(\n\t\t\textractTelemetryLoggerExt(logger),\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\temitLogs,\n\t\t\tlogLevel,\n\t\t);\n\t}\n\n\t/**\n\t * Measure a synchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static timedExec<T>(\n\t\tlogger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => T,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): T {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Measure an asynchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static async timedExecAsync<T>(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => Promise<T>,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): Promise<T> {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = await callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic get duration(): number {\n\t\treturn performanceNow() - this.startTime;\n\t}\n\n\tprivate event?: ITelemetryGenericEventExt;\n\tprivate readonly startTime = performanceNow();\n\tprivate startMark?: string;\n\n\tprivate constructor(\n\t\tprivate readonly logger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tprivate readonly markers: IPerformanceEventMarkers = { end: true, cancel: \"generic\" },\n\t\tprivate readonly emitLogs: boolean = true,\n\t\tprivate readonly logLevel: typeof LogLevel.verbose | typeof LogLevel.info | undefined,\n\t) {\n\t\tthis.event = { ...event };\n\t\tif (this.markers.start) {\n\t\t\tthis.reportEvent(\"start\");\n\t\t}\n\n\t\tif (\n\t\t\ttypeof window === \"object\" &&\n\t\t\twindow?.performance?.mark !== undefined &&\n\t\t\twindow?.performance?.mark !== null\n\t\t) {\n\t\t\tthis.startMark = `${event.eventName}-start`;\n\t\t\twindow.performance.mark(this.startMark);\n\t\t}\n\t}\n\n\tpublic reportProgress(\n\t\tprops?: ITelemetryPropertiesExt,\n\t\teventNameSuffix: string = \"update\",\n\t): void {\n\t\tthis.reportEvent(eventNameSuffix, props);\n\t}\n\n\tprivate autoEnd(): void {\n\t\t// Event might have been cancelled or ended in the callback\n\t\tif (this.event && this.markers.end) {\n\t\t\tthis.reportEvent(\"end\");\n\t\t}\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tpublic end(props?: ITelemetryPropertiesExt): void {\n\t\tthis.reportEvent(\"end\", props);\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tprivate performanceEndMark(): void {\n\t\tif (this.startMark !== undefined && this.event) {\n\t\t\tconst endMark = `${this.event.eventName}-end`;\n\t\t\twindow.performance.mark(endMark);\n\t\t\twindow.performance.measure(`${this.event.eventName}`, this.startMark, endMark);\n\t\t\tthis.startMark = undefined;\n\t\t}\n\t}\n\n\tpublic cancel(props?: ITelemetryPropertiesExt, error?: unknown): void {\n\t\tif (this.markers.cancel !== undefined) {\n\t\t\tthis.reportEvent(\"cancel\", { category: this.markers.cancel, ...props }, error);\n\t\t}\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\t/**\n\t * Report the event, if it hasn't already been reported.\n\t */\n\tpublic reportEvent(\n\t\teventNameSuffix: string,\n\t\tprops?: ITelemetryPropertiesExt,\n\t\terror?: unknown,\n\t): void {\n\t\t// If the caller invokes cancel or end directly inside the callback for timedExec[Async],\n\t\t// then it's possible to come back through reportEvent twice. Only the first time counts.\n\t\tif (!this.event) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.emitLogs) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event: ITelemetryPerformanceEventExt = { ...this.event, ...props };\n\t\tevent.eventName = `${event.eventName}_${eventNameSuffix}`;\n\t\tif (eventNameSuffix !== \"start\") {\n\t\t\tevent.duration = this.duration;\n\t\t}\n\n\t\tthis.logger.sendPerformanceEvent(event, error, this.getLogLevel(eventNameSuffix, event));\n\t}\n\n\t/**\n\t * Get the LogLevel for performance events.\n\t * @param eventNameSuffix - The suffix of the event name.\n\t * @param event - The telemetry performance event.\n\t * @returns The log level for the event.\n\t *\n\t */\n\tprivate getLogLevel(\n\t\teventNameSuffix: string,\n\t\tevent: ITelemetryPerformanceEventExt,\n\t): typeof LogLevel.verbose | typeof LogLevel.info | undefined {\n\t\tif (eventNameSuffix === \"cancel\") {\n\t\t\t// \tWhen undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (\n\t\t\teventNameSuffix === \"end\" &&\n\t\t\tevent.duration !== undefined &&\n\t\t\tthis.markers.endEventEssentialDurationThresholdMs !== undefined &&\n\t\t\tevent.duration > this.markers.endEventEssentialDurationThresholdMs\n\t\t) {\n\t\t\t// When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.logLevel;\n\t}\n\n\tprivate static readonly eventHits = new Map<string, number>();\n\tprivate static shouldReport(\n\t\tevent: ITelemetryGenericEventExt,\n\t\tsampleThreshold: number,\n\t): boolean {\n\t\tconst eventKey = `.${event.category}.${event.eventName}`;\n\t\tconst hitCount = PerformanceEvent.eventHits.get(eventKey) ?? 0;\n\t\tPerformanceEvent.eventHits.set(eventKey, hitCount >= sampleThreshold ? 1 : hitCount + 1);\n\t\treturn hitCount % sampleThreshold === 0;\n\t}\n}\n\n/**\n * Takes in an event object, and converts all of its values to a basePropertyType.\n * In the case of an invalid property type, the value will be converted to an error string.\n * @param event - Event with fields you want to stringify.\n */\nfunction convertToBaseEvent({\n\tcategory,\n\teventName,\n\t...props\n}: ITelemetryEventExt): ITelemetryBaseEvent {\n\tconst newEvent: ITelemetryBaseEvent = { category, eventName };\n\tfor (const key of Object.keys(props)) {\n\t\tnewEvent[key] = convertToBasePropertyType(props[key]);\n\t}\n\treturn newEvent;\n}\n\n/**\n * Takes in value, and does one of 4 things.\n * if value is of primitive type - returns the original value.\n * If the value is a flat array or object - returns a stringified version of the array/object.\n * If the value is an object of type Tagged<TelemetryBaseEventPropertyType> - returns the object\n * with its values recursively converted to base property Type.\n * If none of these cases are reached - returns an error string\n * @param x - value passed in to convert to a base property type\n */\nexport function convertToBasePropertyType(\n\tx: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>,\n): TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType> {\n\treturn isTaggedTelemetryPropertyValue(x)\n\t\t? {\n\t\t\t\tvalue: convertToBasePropertyTypeUntagged(x.value),\n\t\t\t\ttag: x.tag,\n\t\t\t}\n\t\t: convertToBasePropertyTypeUntagged(x);\n}\n\nfunction convertToBasePropertyTypeUntagged(\n\tx: TelemetryEventPropertyTypeExt,\n): TelemetryBaseEventPropertyType {\n\tswitch (typeof x) {\n\t\tcase \"string\":\n\t\tcase \"number\":\n\t\tcase \"boolean\":\n\t\tcase \"undefined\": {\n\t\t\treturn x;\n\t\t}\n\t\tcase \"object\": {\n\t\t\t// We assume this is an array or flat object based on the input types\n\t\t\treturn JSON.stringify(x);\n\t\t}\n\t\tdefault: {\n\t\t\t// should never reach this case based on the input types\n\t\t\tconsole.error(\n\t\t\t\t`convertToBasePropertyTypeUntagged: INVALID PROPERTY (typed as ${typeof x})`,\n\t\t\t);\n\t\t\treturn `INVALID PROPERTY (typed as ${typeof x})`;\n\t\t}\n\t}\n}\n\n/**\n * Tags all given `values` with the same `tag`.\n *\n * @param tag - The tag with which all `values` will be annotated.\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagData(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged.\n *\n * @internal\n */\nexport const tagData = <\n\tT extends TelemetryDataTag,\n\tV extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\ttag: T,\n\tvalues: V,\n): {\n\t[P in keyof V]:\n\t\t| (V[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<V[P]>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<V[P], undefined>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t})\n\t\t| (V[P] extends undefined ? undefined : never);\n} =>\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\tObject.entries(values)\n\t\t.filter((e) => e[1] !== undefined)\n\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t.reduce((pv, cv) => {\n\t\t\tconst [key, value] = cv;\n\t\t\t// The ternary form is less legible in this case.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tpv[key] = () => {\n\t\t\t\t\treturn { tag, value: value() };\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tpv[key] = { tag, value };\n\t\t\t}\n\t\t\treturn pv;\n\t\t}, {}) as ReturnType<typeof tagData>;\n\n/**\n * Tags all provided `values` as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagCodeArtifacts(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @see {@link tagData}\n *\n * @internal\n */\nexport const tagCodeArtifacts = <\n\tT extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\tvalues: T,\n): {\n\t[P in keyof T]:\n\t\t| (T[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<T[P]>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<T[P], undefined>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t})\n\t\t| (T[P] extends undefined ? undefined : never);\n} => tagData<TelemetryDataTag.CodeArtifact, T>(TelemetryDataTag.CodeArtifact, values);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EACN,YAAY,EAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EA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,CAAC;IACjD,SAAgB,iCAAiC,EAAE,MAAM,CAAC;IAC1D,SAAgB,wBAAwB,EAAE,MAAM,CAAC;IACjD,SAAgB,OAAO,EAAE,MAAM,CAAC;gBAG/B,OAAO,EAAE,MAAM,EACf,oBAAoB,EAAE;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,wBAAwB,EAAE,MAAM,CAAC;QACjC,iCAAiC,EAAE,MAAM,CAAC;QAC1C,wBAAwB,EAAE,MAAM,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC;KAChB,EACD,cAAc,CAAC,EAAE,wBAAwB;CAgB1C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,gBAC/B,WAAW,KACtB;IACF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAQpC,CAAC"}
package/lib/error.js CHANGED
@@ -187,7 +187,7 @@ export class DataProcessingError extends LoggingError {
187
187
  * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.
188
188
  */
189
189
  static wrapIfUnrecognized(originalError, dataProcessingCodepath, messageLike) {
190
- return wrapDataProcessingErrorIfUnrecognized((errorMessage, props) => new DataProcessingError(errorMessage, props), originalError, dataProcessingCodepath, messageLike);
190
+ return wrapDataProcessingErrorIfUnrecognized((errorMessage) => new DataProcessingError(errorMessage), originalError, dataProcessingCodepath, messageLike);
191
191
  }
192
192
  }
193
193
  /**
package/lib/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],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microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string, props?: ITelemetryBaseProperties) =>\n\t\t\t\tnew DataProcessingError(errorMessage, props),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,eAAe,GAIf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,SAAS,GACT,MAAM,mBAAmB,CAAC;AAoB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAAkB,EAClB,OAAe,EACf,KAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,wBAAwB,CAChC,OAA4D,EAC5D,YAAoB,EACpB,QAAgB,EAChB,WAAyB,EACzB,QAAiC,EAAE,EACnC,eAAwB;IAExB,MAAM,WAAW,GAAG,KAA+C,CAAC;IACpE,MAAM,uBAAuB,GAAG,WAAW,CAAC,eAAe,CAAC;IAC5D,IAAI,CAAC;QACJ,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,WAAW,CAAC,eAAe,GAAG,eAAe,CAAC;QAC/C,CAAC;QAED,MAAM,KAAK,GAAG,qCAAqC,CAClD,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,WAAW,CACX,CAAC;QACF,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACV,oDAAoD;QACpD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,WAAW,CAAC,eAAe,GAAG,uBAAuB,CAAC;QACvD,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,qCAAqC,CAC7C,OAA4D,EAC5D,aAAsB,EACtB,QAAgB,EACh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B,EAAE,WAAW,CAAC,SAAS;CACvC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidErrorTypes,\n\ttype IGenericError,\n\ttype ILayerIncompatibilityError,\n\ttype IUsageError,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport {\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tisExternalError,\n\tnormalizeError,\n\twrapError,\n} from \"./errorLogging.js\";\nimport type { IFluidErrorBase } from \"./fluidErrorBase.js\";\nimport type { ITelemetryPropertiesExt } from \"./telemetryTypes.js\";\n\n/**\n * A subset of `ISequencedDocumentMessage` properties that are safe to log for telemetry.\n * @internal\n */\nexport type MessageLike = Partial<\n\tPick<\n\t\tISequencedDocumentMessage,\n\t\t| \"clientId\"\n\t\t| \"sequenceNumber\"\n\t\t| \"clientSequenceNumber\"\n\t\t| \"referenceSequenceNumber\"\n\t\t| \"minimumSequenceNumber\"\n\t\t| \"timestamp\"\n\t>\n>;\n\n/**\n * Throws a UsageError with the given message if the condition is not met.\n * Use this API when `false` indicates a precondition is not met on a public API (for any FF layer).\n *\n * @param condition - The condition that should be true, if the condition is false a UsageError will be thrown.\n * @param message - The message to include in the error when the condition does not hold.\n * @param props - Telemetry props to include on the error when the condition does not hold.\n * @internal\n */\nexport function validatePrecondition(\n\tcondition: boolean,\n\tmessage: string,\n\tprops?: ITelemetryBaseProperties,\n): asserts condition {\n\tif (!condition) {\n\t\tthrow new UsageError(message, props);\n\t}\n}\n\n/**\n * Creates an error during data processing (DataProcessingError or DataCorruptionError) with telemetry properties.\n *\n * @remarks\n * This helper allows customizing the stack trace limit during error creation, which is useful\n * for capturing more context in error scenarios. It delegates to {@link wrapOrAnnotateError}\n * for the actual error wrapping/annotation logic.\n *\n * @param factory - Factory function that creates the specific error type.\n * @param errorMessage - The error message to use.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @param props - Additional telemetry properties to attach to the error.\n * @param stackTraceLimit - Optional limit for the stack trace depth.\n * @returns The created error with telemetry properties attached.\n */\nfunction buildDataProcessingError(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\terrorMessage: string,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n\tprops: ITelemetryPropertiesExt = {},\n\tstackTraceLimit?: number,\n): IFluidErrorBase {\n\tconst ErrorConfig = Error as unknown as { stackTraceLimit: number };\n\tconst originalStackTraceLimit = ErrorConfig.stackTraceLimit;\n\ttry {\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = stackTraceLimit;\n\t\t}\n\n\t\tconst error = wrapDataProcessingErrorIfUnrecognized(\n\t\t\tfactory,\n\t\t\terrorMessage,\n\t\t\tcodepath,\n\t\t\tmessageLike,\n\t\t);\n\t\terror.addTelemetryProperties(props);\n\n\t\treturn error;\n\t} finally {\n\t\t// Reset the stack trace limit to the original value\n\t\tif (stackTraceLimit !== undefined) {\n\t\t\tErrorConfig.stackTraceLimit = originalStackTraceLimit;\n\t\t}\n\t}\n}\n\n/**\n * Wraps an unrecognized error into a data processing error (DataProcessingError or DataCorruptionError)\n * using the provided factory.\n *\n * @remarks\n * This function handles two cases:\n * - **Unrecognized/external errors**: Wrapped using the provided factory function to create a proper\n * Fluid error type (DataProcessingError or DataCorruptionError).\n * - **Recognized Fluid errors**: Not wrapped, but annotated with data processing telemetry properties.\n *\n * An error is considered \"unrecognized\" if it's external (from outside Fluid) or has the\n * {@link NORMALIZED_ERROR_TYPE} error type (indicating it was normalized but not classified).\n *\n * We wrap conditionally since known error types represent well-understood failure modes, and ideally\n * one day we will move away from throwing these errors but rather we'll return them.\n * But an unrecognized error needs to be classified appropriately (e.g., as DataProcessingError).\n *\n * @param factory - Factory function that creates the specific error type for wrapping unrecognized errors.\n * @param originalError - The error to be wrapped or annotated.\n * @param codepath - Identifier for the code path where the error was detected.\n * @param messageLike - Optional message properties to include in telemetry.\n * @returns The wrapped or annotated error as an {@link IFluidErrorBase}.\n */\nfunction wrapDataProcessingErrorIfUnrecognized(\n\tfactory: (message: string) => LoggingError & IFluidErrorBase,\n\toriginalError: unknown,\n\tcodepath: string,\n\tmessageLike?: MessageLike,\n): IFluidErrorBase {\n\tconst props = {\n\t\tdataProcessingError: 1,\n\t\tdataProcessingCodepath: codepath,\n\t\t...(messageLike === undefined ? undefined : extractSafePropertiesFromMessage(messageLike)),\n\t};\n\n\tconst normalizedError = normalizeError(originalError, { props });\n\t// Note that other errors may have the NORMALIZED_ERROR_TYPE errorType,\n\t// but if so they are still suitable to be wrapped as DataProcessingError.\n\tif (\n\t\tisExternalError(normalizedError) ||\n\t\tnormalizedError.errorType === NORMALIZED_ERROR_TYPE\n\t) {\n\t\t// Create a new DataProcessingError to wrap this external error\n\t\tconst error = wrapError(normalizedError, (message: string) => factory(message));\n\n\t\t// Copy over the props above and any others added to this error since first being normalized\n\t\terror.addTelemetryProperties(normalizedError.getTelemetryProperties());\n\n\t\treturn error;\n\t}\n\treturn normalizedError;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n *\n * @internal\n */\nexport class GenericError extends LoggingError implements IGenericError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.genericError;\n\n\t/**\n\t * Create a new GenericError\n\t * @param message - Error message\n\t * @param error - inner error object\n\t * @param props - Telemetry props to include when the error is logged\n\t */\n\tpublic constructor(\n\t\tmessage: string,\n\t\t// TODO: Use `unknown` instead (API breaking change because error is not just an input parameter, but a public member of the class)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tpublic readonly error?: any,\n\t\tprops?: ITelemetryBaseProperties,\n\t) {\n\t\t// Don't try to log the inner error\n\t\tsuper(message, props, new Set([\"error\"]));\n\t}\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n *\n * @internal\n */\nexport class UsageError extends LoggingError implements IUsageError, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.usageError;\n\n\tpublic constructor(message: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, usageError: true });\n\t}\n}\n\n/**\n * DataCorruptionError indicates that we encountered definitive evidence that the data at rest\n * backing this container is corrupted, and this container would never be expected to load properly again\n *\n * @internal\n */\nexport class DataCorruptionError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\tpublic readonly errorType = FluidErrorTypes.dataCorruptionError;\n\tpublic readonly canRetry = false;\n\n\tpublic constructor(message: string, props: ITelemetryBaseProperties) {\n\t\tsuper(message, { ...props, dataProcessingError: 1 });\n\t}\n\n\t/**\n\t * Create a new `DataCorruptionError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataCorruptionCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataCorruptionError(message, {}),\n\t\t\terrorMessage,\n\t\t\tdataCorruptionCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n}\n\n/**\n * Indicates we hit a fatal error while processing incoming data from the Fluid Service.\n *\n * @remarks\n *\n * The error will often originate in the dataStore or DDS implementation that is responding to incoming changes.\n * This differs from {@link DataCorruptionError} in that this may be a transient error that will not repro in another\n * client or session.\n *\n * @internal\n */\nexport class DataProcessingError extends LoggingError implements IErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc IFluidErrorBase.errorType}\n\t */\n\tpublic readonly errorType = FluidErrorTypes.dataProcessingError;\n\n\tpublic readonly canRetry = false;\n\n\tprivate constructor(errorMessage: string, props?: ITelemetryBaseProperties) {\n\t\tsuper(errorMessage, props);\n\t}\n\n\t/**\n\t * Create a new `DataProcessingError` detected and raised within the Fluid Framework.\n\t */\n\tpublic static create(\n\t\terrorMessage: string,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t\tprops: ITelemetryPropertiesExt = {},\n\t\tstackTraceLimit?: number,\n\t): IFluidErrorBase {\n\t\treturn buildDataProcessingError(\n\t\t\t(message: string) => new DataProcessingError(message),\n\t\t\terrorMessage,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t\tprops,\n\t\t\tstackTraceLimit,\n\t\t);\n\t}\n\n\t/**\n\t * Wrap the given error in a `DataProcessingError`, unless the error is already of a known type\n\t * with the exception of a normalized {@link LoggingError}, which will still be wrapped.\n\t *\n\t * In either case, the error will have some relevant properties added for telemetry.\n\t *\n\t * @remarks See `wrapDataProcessingErrorIfUnrecognized` for details on wrapping behavior.\n\t *\n\t * @param originalError - The error to be converted.\n\t * @param dataProcessingCodepath - Which code-path failed while processing data.\n\t * @param messageLike - Message to include info about via telemetry props.\n\t *\n\t * @returns Either a new `DataProcessingError`, or (if wrapping is deemed unnecessary) the given error.\n\t */\n\tpublic static wrapIfUnrecognized(\n\t\toriginalError: unknown,\n\t\tdataProcessingCodepath: string,\n\t\tmessageLike?: MessageLike,\n\t): IFluidErrorBase {\n\t\treturn wrapDataProcessingErrorIfUnrecognized(\n\t\t\t(errorMessage: string) => new DataProcessingError(errorMessage),\n\t\t\toriginalError,\n\t\t\tdataProcessingCodepath,\n\t\t\tmessageLike,\n\t\t);\n\t}\n}\n\n/**\n * Error indicating that two Fluid layers are incompatible.\n * See {@link @fluidframework/core-interfaces#ILayerIncompatibilityError} for more details.\n *\n * @internal\n */\nexport class LayerIncompatibilityError\n\textends LoggingError\n\timplements ILayerIncompatibilityError\n{\n\tpublic readonly errorType = FluidErrorTypes.layerIncompatibilityError;\n\tpublic readonly layer: string;\n\tpublic readonly layerVersion: string;\n\tpublic readonly incompatibleLayer: string;\n\tpublic readonly incompatibleLayerVersion: string;\n\tpublic readonly compatibilityRequirementsInMonths: number;\n\tpublic readonly actualDifferenceInMonths: number;\n\tpublic readonly details: string;\n\n\tpublic constructor(\n\t\tmessage: string,\n\t\tincompatibilityProps: {\n\t\t\tlayer: string;\n\t\t\tlayerVersion: string;\n\t\t\tincompatibleLayer: string;\n\t\t\tincompatibleLayerVersion: string;\n\t\t\tcompatibilityRequirementsInMonths: number;\n\t\t\tactualDifferenceInMonths: number;\n\t\t\tdetails: string;\n\t\t},\n\t\ttelemetryProps?: ITelemetryBaseProperties,\n\t) {\n\t\tsuper(message, {\n\t\t\t...incompatibilityProps,\n\t\t\t...telemetryProps,\n\t\t\tlayerIncompatibilityError: true,\n\t\t});\n\t\tthis.layer = incompatibilityProps.layer;\n\t\tthis.layerVersion = incompatibilityProps.layerVersion;\n\t\tthis.incompatibleLayer = incompatibilityProps.incompatibleLayer;\n\t\tthis.incompatibleLayerVersion = incompatibilityProps.incompatibleLayerVersion;\n\t\tthis.compatibilityRequirementsInMonths =\n\t\t\tincompatibilityProps.compatibilityRequirementsInMonths;\n\t\tthis.actualDifferenceInMonths = incompatibilityProps.actualDifferenceInMonths;\n\t\tthis.details = incompatibilityProps.details;\n\t}\n}\n\n/**\n * Extracts specific properties from the provided message that we know are safe to log.\n *\n * @param messageLike - Message to include info about via telemetry props.\n *\n * @internal\n */\nexport const extractSafePropertiesFromMessage = (\n\tmessageLike: MessageLike,\n): {\n\tmessageClientId: string | undefined;\n\tmessageSequenceNumber: number | undefined;\n\tmessageClientSequenceNumber: number | undefined;\n\tmessageReferenceSequenceNumber: number | undefined;\n\tmessageMinimumSequenceNumber: number | undefined;\n\tmessageTimestamp: number | undefined;\n} => ({\n\tmessageClientId: messageLike.clientId === null ? \"null\" : messageLike.clientId,\n\tmessageSequenceNumber: messageLike.sequenceNumber,\n\tmessageClientSequenceNumber: messageLike.clientSequenceNumber,\n\tmessageReferenceSequenceNumber: messageLike.referenceSequenceNumber,\n\tmessageMinimumSequenceNumber: messageLike.minimumSequenceNumber,\n\tmessageTimestamp: messageLike.timestamp,\n});\n"]}
package/lib/internal.d.ts CHANGED
@@ -17,15 +17,4 @@ export type { ITelemetryEventExt, TelemetryLoggerExt, } from "./telemetryTypes.j
17
17
  export type { ITelemetryGenericEventExt, ITelemetryErrorEventExt, ITelemetryPerformanceEventExt, TelemetryEventCategory, } from "./telemetryTypesUndeprecated.js";
18
18
  export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
19
19
  export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
20
- import type { TelemetryLoggerExt } from "./telemetryTypes.js";
21
- /**
22
- * Renamed version of TelemetryLoggerExt for convenience of internal use.
23
- * Where "`ITelemetryLoggerExt`" is exposed in customer API surface, true
24
- * `ITelemetryLoggerExt` (that is an erased type) must be used. To access
25
- * use `@fluidframework/telemetry-utils/legacy` import spec. All internal
26
- * usages should be promoted to `TelemetryLoggerExt` naming.
27
- *
28
- * @internal
29
- */
30
- export type ITelemetryLoggerExt = TelemetryLoggerExt;
31
20
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,4BAA4B,EAC5B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,eAAe,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,WAAW,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,KAAK,sBAA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AAE,MAAM,qBAAqB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,4BAA4B,EAC5B,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,eAAe,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,WAAW,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAClB,KAAK,eAAe,EACpB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EACV,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,KAAK,cAAc,EACnB,UAAU,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,sBAAsB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,OAAO,GACP,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8HAA8H;AAC9H,gDAAgD;AAChD,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,4BAA4B,EAE5B,4BAA4B,EAC5B,sBAAsB,EAEtB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,GAE7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,GAEzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAElB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EAGV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EAEnB,UAAU,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,sBAAsB,GAItB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EAGnB,OAAO,GACP,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./main.js\";\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n\ttype MessageLike,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\textractTelemetryLoggerExt,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttoITelemetryLoggerExt,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tITelemetryEventExt,\n\tTelemetryLoggerExt,\n} from \"./telemetryTypes.js\";\nexport type {\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n\nimport type { TelemetryLoggerExt } from \"./telemetryTypes.js\";\n\n/**\n * Renamed version of TelemetryLoggerExt for convenience of internal use.\n * Where \"`ITelemetryLoggerExt`\" is exposed in customer API surface, true\n * `ITelemetryLoggerExt` (that is an erased type) must be used. To access\n * use `@fluidframework/telemetry-utils/legacy` import spec. All internal\n * usages should be promoted to `TelemetryLoggerExt` naming.\n *\n * @internal\n */\nexport type ITelemetryLoggerExt = TelemetryLoggerExt;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8HAA8H;AAC9H,gDAAgD;AAChD,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,4BAA4B,EAE5B,4BAA4B,EAC5B,sBAAsB,EAEtB,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,GAE7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,yBAAyB,GAEzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kBAAkB,EAElB,YAAY,EACZ,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EAGV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,mBAAmB,EAEnB,UAAU,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,sBAAsB,GAItB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,mBAAmB,EAGnB,OAAO,GACP,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The \"internal\" exports are a superset of the standard ones. So, we want to export everything from the standard barrel file.\n// eslint-disable-next-line no-restricted-syntax\nexport * from \"./main.js\";\n\nexport {\n\tcreateChildMonitoringContext,\n\ttype MonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\ttype IConfigProvider,\n\tloggerToMonitoringContext,\n\twrapConfigProviderWithDefaults,\n\tcreateConfigBasedOptionsProxy,\n\ttype OptionConfigReaders,\n} from \"./config.js\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n\tLayerIncompatibilityError,\n\ttype MessageLike,\n} from \"./error.js\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\ttype IFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging.js\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events.js\";\nexport {\n\thasErrorInstanceId,\n\ttype IFluidErrorBase,\n\tisFluidError,\n\tisLayerIncompatibilityError,\n} from \"./fluidErrorBase.js\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\textractTelemetryLoggerExt,\n\tformatTick,\n\ttype IPerformanceEventMarkers,\n\ttype MultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\ttoITelemetryLoggerExt,\n} from \"./logger.js\";\nexport {\n\tcreateMockLoggerExt,\n\ttype IMockLoggerExt,\n\tMockLogger,\n} from \"./mockLogger.js\";\nexport { ThresholdCounter } from \"./thresholdCounter.js\";\nexport {\n\tSampledTelemetryHelper,\n\ttype CustomMetrics,\n\ttype ICustomData,\n\ttype MeasureReturnType,\n} from \"./sampledTelemetryHelper.js\";\nexport {\n\tcreateSampledLogger,\n\ttype IEventSampler,\n\ttype ISampledTelemetryLogger,\n\tmeasure,\n} from \"./utils.js\";\nexport type {\n\tITelemetryEventExt,\n\tTelemetryLoggerExt,\n} from \"./telemetryTypes.js\";\nexport type {\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\nexport { TelemetryEventBatcher } from \"./telemetryEventBatcher.js\";\nexport { allowIncompatibleLayersKey, validateLayerCompatibility } from \"./layerCompatError.js\";\n"]}
package/lib/logger.d.ts CHANGED
@@ -287,6 +287,10 @@ export interface IPerformanceEventMarkers {
287
287
  start?: true;
288
288
  end?: true;
289
289
  cancel?: "generic" | "error";
290
+ /**
291
+ * If specified, _end events whose duration is greater than this threshold are logged as essential.
292
+ */
293
+ endEventEssentialDurationThresholdMs?: number;
290
294
  }
291
295
  /**
292
296
  * Helper class to log performance events.
@@ -362,6 +366,14 @@ export declare class PerformanceEvent {
362
366
  * Report the event, if it hasn't already been reported.
363
367
  */
364
368
  reportEvent(eventNameSuffix: string, props?: ITelemetryPropertiesExt, error?: unknown): void;
369
+ /**
370
+ * Get the LogLevel for performance events.
371
+ * @param eventNameSuffix - The suffix of the event name.
372
+ * @param event - The telemetry performance event.
373
+ * @returns The log level for the event.
374
+ *
375
+ */
376
+ private getLogLevel;
365
377
  private static readonly eventHits;
366
378
  private static shouldReport;
367
379
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,8BAA8B,EACnC,MAAM,iCAAiC,CAAC;AAazC,OAAO,KAAK,EAEX,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,6BAA6B,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,mBAAmB,CAErF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,SAAS;IACf,iBAAiB,CAAC,EAAE,IAAI,CAAC;CACzB,GACD,EAAE,EAEF,KAAK,EACF,mBAAmB,GACnB,kBAAkB,GAClB,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,GAChE,kBAAkB,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,CAEtF;AAED;;;;;;GAMG;AACH,oBAAY,gBAAgB;IAC3B;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,QAAQ,aAA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sBnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAA6B;IAC9D,OAAO,CAAC,MAAM,CAAC,YAAY;CAS3B;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,CAAC,EAAE,6BAA6B,GAAG,MAAM,CAAC,6BAA6B,CAAC,GACtE,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAOzE;AA0BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,gGAIsB,8BAA8B,SAGlE,CAAC,UACE,CAAC,2CAGc,8BAA8B;;SAG3C,CAAC;;;SAID,CAAC;oDAoB0B,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,oEAGa,8BAA8B,YAG/D,CAAC,2CAGc,8BAA8B;;SAG3C,iBAAiB,YAAY;;;SAI7B,iBAAiB,YAAY;oDAG6C,CAAC"}
package/lib/logger.js CHANGED
@@ -601,7 +601,28 @@ export class PerformanceEvent {
601
601
  if (eventNameSuffix !== "start") {
602
602
  event.duration = this.duration;
603
603
  }
604
- this.logger.sendPerformanceEvent(event, error, this.logLevel);
604
+ this.logger.sendPerformanceEvent(event, error, this.getLogLevel(eventNameSuffix, event));
605
+ }
606
+ /**
607
+ * Get the LogLevel for performance events.
608
+ * @param eventNameSuffix - The suffix of the event name.
609
+ * @param event - The telemetry performance event.
610
+ * @returns The log level for the event.
611
+ *
612
+ */
613
+ getLogLevel(eventNameSuffix, event) {
614
+ if (eventNameSuffix === "cancel") {
615
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
616
+ return undefined;
617
+ }
618
+ if (eventNameSuffix === "end" &&
619
+ event.duration !== undefined &&
620
+ this.markers.endEventEssentialDurationThresholdMs !== undefined &&
621
+ event.duration > this.markers.endEventEssentialDurationThresholdMs) {
622
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
623
+ return undefined;
624
+ }
625
+ return this.logLevel;
605
626
  }
606
627
  static shouldReport(event, sampleThreshold) {
607
628
  const eventKey = `.${event.category}.${event.eventName}`;
package/lib/logger.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAGN,QAAQ,GAGR,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,6BAA6B,EAC7B,aAAa,EACb,eAAe,EACf,8BAA8B,GAC9B,MAAM,mBAAmB,CAAC;AAe3B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA0B;IAC/D,OAAO,MAAwC,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,yBAAyB,CAMxC,KAGkE;IAElE,OAAO,KAAsC,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,iDAA6B,CAAA;IAC7B;;OAEG;IACH,yCAAqB,CAAA;AACtB,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AA6BD;;;;;;;;;GASG;AACH,kDAAkD;AAClD,MAAM,UAAU,gBAAgB,CAAC,GAA8B;IAC9D,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC;AAED,iBAAiB;AACjB,qDAAqD;AACrD;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AAG,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC,EAAE,EAAE,CAA+B,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAM/B,MAAS,EAaR,EAAE,CAAC,OAAO,CAAmC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport {\n\ttype ITelemetryBaseEvent,\n\ttype ITelemetryBaseLogger,\n\tLogLevel,\n\ttype Tagged,\n\ttype TelemetryBaseEventPropertyType,\n} from \"@fluidframework/core-interfaces\";\n\nimport {\n\tCachedConfigProvider,\n\tloggerIsMonitoringContext,\n\tmixinMonitoringContext,\n} from \"./config.js\";\nimport {\n\textractLogSafeErrorProperties,\n\tgenerateStack,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n} from \"./errorLogging.js\";\nimport type {\n\tITelemetryEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryLoggerExt,\n\tTelemetryEventPropertyTypeExt,\n} from \"./telemetryTypes.js\";\nimport type {\n\tITelemetryErrorEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\n\n/**\n * Type erase a {@link TelemetryLoggerExt} to an {@link ITelemetryLoggerExt}.\n * @internal\n */\nexport function toITelemetryLoggerExt(logger: TelemetryLoggerExt): ITelemetryLoggerExt {\n\treturn logger as unknown as ITelemetryLoggerExt;\n}\n\n/**\n * Un-type-erase the {@link ITelemetryLoggerExt}.\n * @remarks\n * This is the extraction helper as documented by {@link @fluidframework/core-interfaces#BrandedType}.\n *\n * @typeParam options - options for the extraction, currently only supports making\n * the output possibly undefined (when `PossiblyUndefined: true`), which is useful\n * for cases where we want to allow passing `undefined` through.\n *\n * @privateRemarks `ITelemetryLoggerExt` is not currently a branded type, but will\n * be when the breaking change is made. At that time, use of this helper will be\n * required.\n *\n * @internal\n */\nexport function extractTelemetryLoggerExt<\n\toptions extends {\n\t\tPossiblyUndefined?: true;\n\t} = // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- empty object without PossiblyUndefined is the correct type\n\t{},\n>(\n\tinput:\n\t\t| ITelemetryLoggerExt\n\t\t| TelemetryLoggerExt\n\t\t| (options[\"PossiblyUndefined\"] extends true ? undefined : never),\n): TelemetryLoggerExt | (options[\"PossiblyUndefined\"] extends true ? undefined : never) {\n\treturn input as unknown as TelemetryLoggerExt;\n}\n\n/**\n * Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry.\n *\n * @privateRemarks Please do not modify existing entries, to maintain backwards compatibility.\n *\n * @internal\n */\nexport enum TelemetryDataTag {\n\t/**\n\t * Data containing terms or IDs from code packages that may have been dynamically loaded\n\t */\n\tCodeArtifact = \"CodeArtifact\",\n\t/**\n\t * Personal data of a variety of classifications that pertains to the user\n\t */\n\tUserData = \"UserData\",\n}\n\n/**\n * @legacy\n * @beta\n */\nexport type TelemetryEventPropertyTypes = ITelemetryPropertiesExt[string];\n\n/**\n * @legacy\n * @beta\n */\nexport type ITelemetryLoggerPropertyBag = Record<\n\tstring,\n\tTelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes)\n>;\n\n/**\n * @legacy\n * @beta\n *\n * @privateRemarks\n * This is exposed to support {@link createChildLogger} properties parameter.\n */\nexport interface ITelemetryLoggerPropertyBags {\n\tall?: ITelemetryLoggerPropertyBag;\n\terror?: ITelemetryLoggerPropertyBag;\n}\n\n/**\n * Attempts to parse number from string.\n * If it fails, it will return the original string.\n *\n * @remarks\n * Used to make telemetry data typed (and support math operations, like comparison),\n * in places where we do expect numbers (like contentsize/duration property in http header).\n *\n * @internal\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function numberFromString(str: string | null | undefined): string | number | undefined {\n\tif (str === undefined || str === null) {\n\t\treturn undefined;\n\t}\n\tconst num = Number(str);\n\treturn Number.isNaN(num) ? str : num;\n}\n\n// TODO: add docs\n// eslint-disable-next-line jsdoc/require-description\n/**\n * @internal\n */\nexport function formatTick(tick: number): number {\n\treturn Math.floor(tick);\n}\n\n/**\n * String used to concatenate the namespace of parent loggers and their child loggers.\n * @internal\n */\nexport const eventNamespaceSeparator = \":\";\n\n/**\n * TelemetryLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n */\nexport abstract class TelemetryLogger implements TelemetryLoggerExt {\n\t/**\n\t * {@inheritDoc eventNamespaceSeparator}\n\t */\n\tpublic static readonly eventNamespaceSeparator = eventNamespaceSeparator;\n\n\tpublic static sanitizePkgName(name: string): string {\n\t\treturn name.replace(\"@\", \"\").replace(\"/\", \"-\");\n\t}\n\n\t/**\n\t * Take an unknown error object and add the appropriate info from it to the event. Message and stack will be copied\n\t * over from the error object, along with other telemetry properties if it's an ILoggingError.\n\t * @param event - Event being logged\n\t * @param error - Error to extract info from\n\t * @param fetchStack - Whether to fetch the current callstack if error.stack is undefined\n\t */\n\tpublic static prepareErrorObject(\n\t\tevent: ITelemetryBaseEvent,\n\t\terror: unknown,\n\t\tfetchStack: boolean,\n\t): void {\n\t\tconst { message, errorType, stack } = extractLogSafeErrorProperties(\n\t\t\terror,\n\t\t\ttrue /* sanitizeStack */,\n\t\t);\n\t\t// First, copy over error message, stack, and errorType directly (overwrite if present on event)\n\t\tevent.stack = stack;\n\t\tevent.error = message; // Note that the error message goes on the 'error' field\n\t\tevent.errorType = errorType;\n\n\t\tif (isILoggingError(error)) {\n\t\t\t// Add any other telemetry properties from the LoggingError\n\t\t\tconst telemetryProp = error.getTelemetryProperties();\n\t\t\tfor (const key of Object.keys(telemetryProp)) {\n\t\t\t\tif (event[key] !== undefined) {\n\t\t\t\t\t// Don't overwrite existing properties on the event\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tevent[key] = telemetryProp[key];\n\t\t\t}\n\t\t}\n\n\t\t// Collect stack if we were not able to extract it from error\n\t\tif (event.stack === undefined && fetchStack) {\n\t\t\tevent.stack = generateStack();\n\t\t}\n\t}\n\n\tpublic constructor(\n\t\tprotected readonly namespace?: string,\n\t\tprotected readonly properties?: ITelemetryLoggerPropertyBags,\n\t) {}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic abstract send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendTelemetryEvent(\n\t\tevent: ITelemetryGenericEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{ ...event, category: event.category ?? \"generic\" },\n\t\t\terror,\n\t\t\tevent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - level of the log.\n\t */\n\tprivate sendTelemetryEventCore(\n\t\tevent: ITelemetryGenericEventExt & { category: TelemetryEventCategory },\n\t\terror: unknown,\n\t\tlogLevel: LogLevel,\n\t): void {\n\t\tconst newEvent = convertToBaseEvent(event);\n\t\tif (error !== undefined) {\n\t\t\tTelemetryLogger.prepareErrorObject(newEvent, error, false);\n\t\t}\n\n\t\t// Will include Nan & Infinity, but probably we do not care\n\t\tif (typeof newEvent.duration === \"number\") {\n\t\t\tnewEvent.duration = formatTick(newEvent.duration);\n\t\t}\n\n\t\tthis.send(newEvent, logLevel);\n\t}\n\n\t/**\n\t * Send an error telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t */\n\tpublic sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{\n\t\t\t\t// ensure the error field has some value,\n\t\t\t\t// this can and will be overridden by event, or error\n\t\t\t\terror: event.eventName,\n\t\t\t\t...event,\n\t\t\t\tcategory: \"error\",\n\t\t\t},\n\t\t\terror,\n\t\t\tLogLevel.essential,\n\t\t);\n\t}\n\n\t/**\n\t * Send a performance telemetry event with the logger\n\t *\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tconst perfEvent = {\n\t\t\t...event,\n\t\t\tcategory: event.category ?? \"performance\",\n\t\t};\n\n\t\tthis.sendTelemetryEventCore(\n\t\t\tperfEvent,\n\t\t\terror,\n\t\t\tperfEvent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\tprotected prepareEvent(event: ITelemetryBaseEvent): ITelemetryBaseEvent {\n\t\tconst includeErrorProps = event.category === \"error\" || event.error !== undefined;\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\t...event,\n\t\t};\n\t\tif (this.namespace !== undefined) {\n\t\t\tnewEvent.eventName = `${this.namespace}${TelemetryLogger.eventNamespaceSeparator}${newEvent.eventName}`;\n\t\t}\n\t\treturn this.extendProperties(newEvent, includeErrorProps);\n\t}\n\n\tprivate extendProperties<\n\t\tT extends ITelemetryLoggerPropertyBag = ITelemetryLoggerPropertyBag,\n\t>(toExtend: T, includeErrorProps: boolean): T {\n\t\tconst eventLike: ITelemetryLoggerPropertyBag = toExtend;\n\t\tif (this.properties) {\n\t\t\tconst properties: (undefined | ITelemetryLoggerPropertyBag)[] = [];\n\t\t\tproperties.push(this.properties.all);\n\t\t\tif (includeErrorProps) {\n\t\t\t\tproperties.push(this.properties.error);\n\t\t\t}\n\t\t\tfor (const props of properties) {\n\t\t\t\tif (props !== undefined) {\n\t\t\t\t\tfor (const [key, getterOrValue] of Object.entries(props)) {\n\t\t\t\t\t\tif (eventLike[key] !== undefined) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this throws, hopefully it is handled elsewhere\n\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\ttypeof getterOrValue === \"function\" ? getterOrValue() : getterOrValue;\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\teventLike[key] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toExtend;\n\t}\n}\n\n/**\n * @deprecated 0.56, remove TaggedLoggerAdapter once its usage is removed from\n * container-runtime. Issue: #8191\n * TaggedLoggerAdapter class can add tag handling to your logger.\n *\n * @internal\n */\nexport class TaggedLoggerAdapter implements ITelemetryBaseLogger {\n\tpublic constructor(private readonly logger: ITelemetryBaseLogger) {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#ITelemetryBaseLogger.send}\n\t */\n\tpublic send(eventWithTagsMaybe: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\tcategory: eventWithTagsMaybe.category,\n\t\t\teventName: eventWithTagsMaybe.eventName,\n\t\t};\n\t\tfor (const [key, taggableProp] of Object.entries(eventWithTagsMaybe)) {\n\t\t\tconst { value, tag } =\n\t\t\t\ttypeof taggableProp === \"object\"\n\t\t\t\t\t? taggableProp\n\t\t\t\t\t: { value: taggableProp, tag: undefined };\n\t\t\tswitch (tag) {\n\t\t\t\tcase undefined: {\n\t\t\t\t\t// No tag means we can log plainly\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"PackageData\": // For back-compat\n\t\t\t\tcase TelemetryDataTag.CodeArtifact: {\n\t\t\t\t\t// For Microsoft applications, CodeArtifact is safe for now\n\t\t\t\t\t// (we don't load 3P code in 1P apps)\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TelemetryDataTag.UserData: {\n\t\t\t\t\t// Strip out anything tagged explicitly as UserData.\n\t\t\t\t\t// Alternate strategy would be to hash these props\n\t\t\t\t\tnewEvent[key] = \"REDACTED (UserData)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t// If we encounter a tag we don't recognize\n\t\t\t\t\t// then we must assume we should scrub.\n\t\t\t\t\tnewEvent[key] = \"REDACTED (unknown tag)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.logger.send(newEvent);\n\t}\n}\n\nfunction toEitherTelemetryLoggerExt(\n\tlogger: TelemetryLoggerExt,\n): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn logger as TelemetryLoggerExt & ITelemetryLoggerExt;\n}\n\n/**\n * Create a child logger based on the provided props object.\n *\n * @remarks\n * Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.\n *\n * @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.\n *\n * @internal\n *\n * @privateRemarks\n * Return type is both TelemetryLoggerExt and ITelemetryLoggerExt to allow for\n * easier internal usage without needing to type erase or un-type-erase the\n * logger.\n *\n * If always creating a child logger for direct external exposure, consider\n * using {@link createChildLogger} from /legacy API instead, which returns\n * exactly an {@link ITelemetryLoggerExt}.\n */\nexport function createChildLogger(props?: {\n\tlogger?: ITelemetryBaseLogger;\n\tnamespace?: string;\n\tproperties?: ITelemetryLoggerPropertyBags;\n}): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn toEitherTelemetryLoggerExt(\n\t\tChildLogger.create(props?.logger, props?.namespace, props?.properties),\n\t);\n}\n\n/**\n * ChildLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events.\n */\nexport class ChildLogger extends TelemetryLogger {\n\t/**\n\t * Create child logger\n\t * @param baseLogger - Base logger to use to output events. If undefined, proper child logger\n\t * is created, but it does not send telemetry events anywhere.\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t */\n\tpublic static create(\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): TelemetryLogger {\n\t\t// if we are creating a child of a child, rather than nest, which will increase\n\t\t// the callstack overhead, just generate a new logger that includes everything from the previous\n\t\tif (baseLogger instanceof ChildLogger) {\n\t\t\tconst combinedProperties: ITelemetryLoggerPropertyBags = {};\n\t\t\tfor (const extendedProps of [baseLogger.properties, properties]) {\n\t\t\t\tif (extendedProps !== undefined) {\n\t\t\t\t\tif (extendedProps.all !== undefined) {\n\t\t\t\t\t\tcombinedProperties.all = {\n\t\t\t\t\t\t\t...combinedProperties.all,\n\t\t\t\t\t\t\t...extendedProps.all,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (extendedProps.error !== undefined) {\n\t\t\t\t\t\tcombinedProperties.error = {\n\t\t\t\t\t\t\t...combinedProperties.error,\n\t\t\t\t\t\t\t...extendedProps.error,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst combinedNamespace =\n\t\t\t\tbaseLogger.namespace === undefined\n\t\t\t\t\t? namespace\n\t\t\t\t\t: namespace === undefined\n\t\t\t\t\t\t? baseLogger.namespace\n\t\t\t\t\t\t: `${baseLogger.namespace}${TelemetryLogger.eventNamespaceSeparator}${namespace}`;\n\n\t\t\tconst child = new ChildLogger(\n\t\t\t\tbaseLogger.baseLogger,\n\t\t\t\tcombinedNamespace,\n\t\t\t\tcombinedProperties,\n\t\t\t);\n\n\t\t\tif (!loggerIsMonitoringContext(child) && loggerIsMonitoringContext(baseLogger)) {\n\t\t\t\tmixinMonitoringContext(child, baseLogger.config);\n\t\t\t}\n\t\t\treturn child;\n\t\t}\n\n\t\treturn new ChildLogger(baseLogger ?? { send(): void {} }, namespace, properties);\n\t}\n\n\tprivate constructor(\n\t\tprotected readonly baseLogger: ITelemetryBaseLogger,\n\t\tnamespace: string | undefined,\n\t\tproperties: ITelemetryLoggerPropertyBags | undefined,\n\t) {\n\t\tsuper(namespace, properties);\n\n\t\t// propagate the monitoring context\n\t\tif (loggerIsMonitoringContext(baseLogger)) {\n\t\t\tmixinMonitoringContext(this, new CachedConfigProvider(this, baseLogger.config));\n\t\t}\n\t}\n\n\tpublic get minLogLevel(): LogLevel | undefined {\n\t\treturn this.baseLogger.minLogLevel;\n\t}\n\n\tprivate shouldFilterOutEvent(event: ITelemetryBaseEvent, logLevel?: LogLevel): boolean {\n\t\tconst eventLogLevel = logLevel ?? LogLevel.essential;\n\t\tconst configLogLevel = this.baseLogger.minLogLevel ?? LogLevel.info;\n\t\t// Filter out in case event log level is below what is wanted in config.\n\t\treturn eventLogLevel < configLogLevel;\n\t}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tif (this.shouldFilterOutEvent(event, logLevel)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseLogger.send(this.prepareEvent(event), logLevel ?? LogLevel.essential);\n\t}\n}\n\n/**\n * Input properties for {@link createMultiSinkLogger}.\n *\n * @internal\n */\nexport interface MultiSinkLoggerProperties {\n\t/**\n\t * Will be prefixed to all event names.\n\t */\n\tnamespace?: string;\n\n\t/**\n\t * Default properties that will be applied to all events flowing through this logger.\n\t */\n\tproperties?: ITelemetryLoggerPropertyBags;\n\n\t/**\n\t * The base loggers that this logger will forward the logs to, after it processes them.\n\t */\n\tloggers?: (ITelemetryBaseLogger | undefined)[];\n\n\t/**\n\t * If true, the logger will attempt to copy the custom properties (if they are of a known type, i.e. one from this package) of all the base loggers passed to it, to apply them itself to logs that flow through.\n\t */\n\ttryInheritProperties?: true;\n}\n\n/**\n * Create a logger which logs to multiple other loggers based on the provided props object.\n *\n * @internal\n */\nexport function createMultiSinkLogger(props: MultiSinkLoggerProperties): TelemetryLoggerExt {\n\treturn new MultiSinkLogger(\n\t\tprops.namespace,\n\t\tprops.properties,\n\t\tprops.loggers?.filter((l): l is ITelemetryBaseLogger => l !== undefined),\n\t\tprops.tryInheritProperties,\n\t);\n}\n\n/**\n * Multi-sink logger\n * Takes multiple ITelemetryBaseLogger objects (sinks) and logs all events into each sink\n */\nexport class MultiSinkLogger extends TelemetryLogger {\n\tprotected loggers: ITelemetryBaseLogger[];\n\t// This is minimum of minLlogLevel of all loggers.\n\tprivate _minLogLevelOfAllLoggers: LogLevel;\n\n\t/**\n\t * Create multiple sink logger (i.e. logger that sends events to multiple sinks)\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param loggers - The list of loggers to use as sinks\n\t * @param tryInheritProperties - Will attempted to copy those loggers properties to this loggers if they are of a known type e.g. one from this package\n\t */\n\tpublic constructor(\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t\tloggers: ITelemetryBaseLogger[] = [],\n\t\ttryInheritProperties?: true,\n\t) {\n\t\tlet realProperties = properties === undefined ? undefined : { ...properties };\n\t\tif (tryInheritProperties === true) {\n\t\t\tconst merge = (realProperties ??= {});\n\t\t\tloggers\n\t\t\t\t.filter((l): l is this => l instanceof TelemetryLogger)\n\t\t\t\t.map((l) => l.properties ?? {})\n\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t.forEach((cv) => {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t\tObject.keys(cv).forEach((k) => {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\tmerge[k] = { ...cv[k], ...merge?.[k] };\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\tsuper(namespace, realProperties);\n\t\tthis.loggers = loggers;\n\t\tthis._minLogLevelOfAllLoggers = LogLevel.info;\n\t\tthis.calculateMinLogLevel();\n\t}\n\n\tpublic get minLogLevel(): LogLevel {\n\t\treturn this._minLogLevelOfAllLoggers;\n\t}\n\n\tprivate calculateMinLogLevel(): void {\n\t\tif (this.loggers.length > 0) {\n\t\t\tconst logLevels: LogLevel[] = [];\n\t\t\tfor (const logger of this.loggers) {\n\t\t\t\tlogLevels.push(logger.minLogLevel ?? LogLevel.info);\n\t\t\t}\n\t\t\tthis._minLogLevelOfAllLoggers = Math.min(...logLevels) as LogLevel;\n\t\t}\n\t}\n\n\t/**\n\t * Add logger to send all events to\n\t * @param logger - Logger to add\n\t */\n\tpublic addLogger(logger?: ITelemetryBaseLogger): void {\n\t\tif (logger !== undefined && logger !== null) {\n\t\t\tthis.loggers.push(logger);\n\t\t\t// Update in case the logLevel of added logger is less than the current.\n\t\t\tthis.calculateMinLogLevel();\n\t\t}\n\t}\n\n\t/**\n\t * Send an event to the loggers\n\t *\n\t * @param event - the event to send to all the registered logger\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tconst newEvent = this.prepareEvent(event);\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.send(newEvent, logLevel ?? LogLevel.essential);\n\t\t}\n\t}\n}\n\n/**\n * Describes what events {@link PerformanceEvent} should log.\n *\n * @remarks\n * By default, all events are logged, but the client can override this behavior.\n *\n * For example, there is rarely a need to record a start event, as we're really after\n * success / failure tracking, including duration (on success).\n *\n * @internal\n */\nexport interface IPerformanceEventMarkers {\n\tstart?: true;\n\tend?: true;\n\tcancel?: \"generic\" | \"error\"; // tells wether to issue \"generic\" or \"error\" category cancel event\n}\n\n/**\n * Helper class to log performance events.\n *\n * @internal\n */\nexport class PerformanceEvent {\n\t/**\n\t * Creates an instance of {@link PerformanceEvent} and starts measurements\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param emitLogs - should this instance emit logs. If set to false, logs will not be emitted to the logger,\n\t * but measurements will still be performed and any specified markers will be generated.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns An instance of {@link PerformanceEvent}\n\t */\n\tpublic static start(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\temitLogs: boolean = true,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): PerformanceEvent {\n\t\treturn new PerformanceEvent(\n\t\t\textractTelemetryLoggerExt(logger),\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\temitLogs,\n\t\t\tlogLevel,\n\t\t);\n\t}\n\n\t/**\n\t * Measure a synchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static timedExec<T>(\n\t\tlogger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => T,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): T {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Measure an asynchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static async timedExecAsync<T>(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => Promise<T>,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): Promise<T> {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = await callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic get duration(): number {\n\t\treturn performanceNow() - this.startTime;\n\t}\n\n\tprivate event?: ITelemetryGenericEventExt;\n\tprivate readonly startTime = performanceNow();\n\tprivate startMark?: string;\n\n\tprivate constructor(\n\t\tprivate readonly logger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tprivate readonly markers: IPerformanceEventMarkers = { end: true, cancel: \"generic\" },\n\t\tprivate readonly emitLogs: boolean = true,\n\t\tprivate readonly logLevel: typeof LogLevel.verbose | typeof LogLevel.info | undefined,\n\t) {\n\t\tthis.event = { ...event };\n\t\tif (this.markers.start) {\n\t\t\tthis.reportEvent(\"start\");\n\t\t}\n\n\t\tif (\n\t\t\ttypeof window === \"object\" &&\n\t\t\twindow?.performance?.mark !== undefined &&\n\t\t\twindow?.performance?.mark !== null\n\t\t) {\n\t\t\tthis.startMark = `${event.eventName}-start`;\n\t\t\twindow.performance.mark(this.startMark);\n\t\t}\n\t}\n\n\tpublic reportProgress(\n\t\tprops?: ITelemetryPropertiesExt,\n\t\teventNameSuffix: string = \"update\",\n\t): void {\n\t\tthis.reportEvent(eventNameSuffix, props);\n\t}\n\n\tprivate autoEnd(): void {\n\t\t// Event might have been cancelled or ended in the callback\n\t\tif (this.event && this.markers.end) {\n\t\t\tthis.reportEvent(\"end\");\n\t\t}\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tpublic end(props?: ITelemetryPropertiesExt): void {\n\t\tthis.reportEvent(\"end\", props);\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tprivate performanceEndMark(): void {\n\t\tif (this.startMark !== undefined && this.event) {\n\t\t\tconst endMark = `${this.event.eventName}-end`;\n\t\t\twindow.performance.mark(endMark);\n\t\t\twindow.performance.measure(`${this.event.eventName}`, this.startMark, endMark);\n\t\t\tthis.startMark = undefined;\n\t\t}\n\t}\n\n\tpublic cancel(props?: ITelemetryPropertiesExt, error?: unknown): void {\n\t\tif (this.markers.cancel !== undefined) {\n\t\t\tthis.reportEvent(\"cancel\", { category: this.markers.cancel, ...props }, error);\n\t\t}\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\t/**\n\t * Report the event, if it hasn't already been reported.\n\t */\n\tpublic reportEvent(\n\t\teventNameSuffix: string,\n\t\tprops?: ITelemetryPropertiesExt,\n\t\terror?: unknown,\n\t): void {\n\t\t// If the caller invokes cancel or end directly inside the callback for timedExec[Async],\n\t\t// then it's possible to come back through reportEvent twice. Only the first time counts.\n\t\tif (!this.event) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.emitLogs) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event: ITelemetryPerformanceEventExt = { ...this.event, ...props };\n\t\tevent.eventName = `${event.eventName}_${eventNameSuffix}`;\n\t\tif (eventNameSuffix !== \"start\") {\n\t\t\tevent.duration = this.duration;\n\t\t}\n\n\t\tthis.logger.sendPerformanceEvent(event, error, this.logLevel);\n\t}\n\n\tprivate static readonly eventHits = new Map<string, number>();\n\tprivate static shouldReport(\n\t\tevent: ITelemetryGenericEventExt,\n\t\tsampleThreshold: number,\n\t): boolean {\n\t\tconst eventKey = `.${event.category}.${event.eventName}`;\n\t\tconst hitCount = PerformanceEvent.eventHits.get(eventKey) ?? 0;\n\t\tPerformanceEvent.eventHits.set(eventKey, hitCount >= sampleThreshold ? 1 : hitCount + 1);\n\t\treturn hitCount % sampleThreshold === 0;\n\t}\n}\n\n/**\n * Takes in an event object, and converts all of its values to a basePropertyType.\n * In the case of an invalid property type, the value will be converted to an error string.\n * @param event - Event with fields you want to stringify.\n */\nfunction convertToBaseEvent({\n\tcategory,\n\teventName,\n\t...props\n}: ITelemetryEventExt): ITelemetryBaseEvent {\n\tconst newEvent: ITelemetryBaseEvent = { category, eventName };\n\tfor (const key of Object.keys(props)) {\n\t\tnewEvent[key] = convertToBasePropertyType(props[key]);\n\t}\n\treturn newEvent;\n}\n\n/**\n * Takes in value, and does one of 4 things.\n * if value is of primitive type - returns the original value.\n * If the value is a flat array or object - returns a stringified version of the array/object.\n * If the value is an object of type Tagged<TelemetryBaseEventPropertyType> - returns the object\n * with its values recursively converted to base property Type.\n * If none of these cases are reached - returns an error string\n * @param x - value passed in to convert to a base property type\n */\nexport function convertToBasePropertyType(\n\tx: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>,\n): TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType> {\n\treturn isTaggedTelemetryPropertyValue(x)\n\t\t? {\n\t\t\t\tvalue: convertToBasePropertyTypeUntagged(x.value),\n\t\t\t\ttag: x.tag,\n\t\t\t}\n\t\t: convertToBasePropertyTypeUntagged(x);\n}\n\nfunction convertToBasePropertyTypeUntagged(\n\tx: TelemetryEventPropertyTypeExt,\n): TelemetryBaseEventPropertyType {\n\tswitch (typeof x) {\n\t\tcase \"string\":\n\t\tcase \"number\":\n\t\tcase \"boolean\":\n\t\tcase \"undefined\": {\n\t\t\treturn x;\n\t\t}\n\t\tcase \"object\": {\n\t\t\t// We assume this is an array or flat object based on the input types\n\t\t\treturn JSON.stringify(x);\n\t\t}\n\t\tdefault: {\n\t\t\t// should never reach this case based on the input types\n\t\t\tconsole.error(\n\t\t\t\t`convertToBasePropertyTypeUntagged: INVALID PROPERTY (typed as ${typeof x})`,\n\t\t\t);\n\t\t\treturn `INVALID PROPERTY (typed as ${typeof x})`;\n\t\t}\n\t}\n}\n\n/**\n * Tags all given `values` with the same `tag`.\n *\n * @param tag - The tag with which all `values` will be annotated.\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagData(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged.\n *\n * @internal\n */\nexport const tagData = <\n\tT extends TelemetryDataTag,\n\tV extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\ttag: T,\n\tvalues: V,\n): {\n\t[P in keyof V]:\n\t\t| (V[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<V[P]>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<V[P], undefined>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t})\n\t\t| (V[P] extends undefined ? undefined : never);\n} =>\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\tObject.entries(values)\n\t\t.filter((e) => e[1] !== undefined)\n\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t.reduce((pv, cv) => {\n\t\t\tconst [key, value] = cv;\n\t\t\t// The ternary form is less legible in this case.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tpv[key] = () => {\n\t\t\t\t\treturn { tag, value: value() };\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tpv[key] = { tag, value };\n\t\t\t}\n\t\t\treturn pv;\n\t\t}, {}) as ReturnType<typeof tagData>;\n\n/**\n * Tags all provided `values` as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagCodeArtifacts(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @see {@link tagData}\n *\n * @internal\n */\nexport const tagCodeArtifacts = <\n\tT extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\tvalues: T,\n): {\n\t[P in keyof T]:\n\t\t| (T[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<T[P]>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<T[P], undefined>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t})\n\t\t| (T[P] extends undefined ? undefined : never);\n} => tagData<TelemetryDataTag.CodeArtifact, T>(TelemetryDataTag.CodeArtifact, values);\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAGN,QAAQ,GAGR,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,6BAA6B,EAC7B,aAAa,EACb,eAAe,EACf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CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC,EAAE,EAAE,CAA+B,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAM/B,MAAS,EAaR,EAAE,CAAC,OAAO,CAAmC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport {\n\ttype ITelemetryBaseEvent,\n\ttype ITelemetryBaseLogger,\n\tLogLevel,\n\ttype Tagged,\n\ttype TelemetryBaseEventPropertyType,\n} from \"@fluidframework/core-interfaces\";\n\nimport {\n\tCachedConfigProvider,\n\tloggerIsMonitoringContext,\n\tmixinMonitoringContext,\n} from \"./config.js\";\nimport {\n\textractLogSafeErrorProperties,\n\tgenerateStack,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n} from \"./errorLogging.js\";\nimport type {\n\tITelemetryEventExt,\n\tITelemetryLoggerExt,\n\tITelemetryPropertiesExt,\n\tTelemetryLoggerExt,\n\tTelemetryEventPropertyTypeExt,\n} from \"./telemetryTypes.js\";\nimport type {\n\tITelemetryErrorEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryPerformanceEventExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypesUndeprecated.js\";\n\n/**\n * Type erase a {@link TelemetryLoggerExt} to an {@link ITelemetryLoggerExt}.\n * @internal\n */\nexport function toITelemetryLoggerExt(logger: TelemetryLoggerExt): ITelemetryLoggerExt {\n\treturn logger as unknown as ITelemetryLoggerExt;\n}\n\n/**\n * Un-type-erase the {@link ITelemetryLoggerExt}.\n * @remarks\n * This is the extraction helper as documented by {@link @fluidframework/core-interfaces#BrandedType}.\n *\n * @typeParam options - options for the extraction, currently only supports making\n * the output possibly undefined (when `PossiblyUndefined: true`), which is useful\n * for cases where we want to allow passing `undefined` through.\n *\n * @privateRemarks `ITelemetryLoggerExt` is not currently a branded type, but will\n * be when the breaking change is made. At that time, use of this helper will be\n * required.\n *\n * @internal\n */\nexport function extractTelemetryLoggerExt<\n\toptions extends {\n\t\tPossiblyUndefined?: true;\n\t} = // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- empty object without PossiblyUndefined is the correct type\n\t{},\n>(\n\tinput:\n\t\t| ITelemetryLoggerExt\n\t\t| TelemetryLoggerExt\n\t\t| (options[\"PossiblyUndefined\"] extends true ? undefined : never),\n): TelemetryLoggerExt | (options[\"PossiblyUndefined\"] extends true ? undefined : never) {\n\treturn input as unknown as TelemetryLoggerExt;\n}\n\n/**\n * Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry.\n *\n * @privateRemarks Please do not modify existing entries, to maintain backwards compatibility.\n *\n * @internal\n */\nexport enum TelemetryDataTag {\n\t/**\n\t * Data containing terms or IDs from code packages that may have been dynamically loaded\n\t */\n\tCodeArtifact = \"CodeArtifact\",\n\t/**\n\t * Personal data of a variety of classifications that pertains to the user\n\t */\n\tUserData = \"UserData\",\n}\n\n/**\n * @legacy\n * @beta\n */\nexport type TelemetryEventPropertyTypes = ITelemetryPropertiesExt[string];\n\n/**\n * @legacy\n * @beta\n */\nexport type ITelemetryLoggerPropertyBag = Record<\n\tstring,\n\tTelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes)\n>;\n\n/**\n * @legacy\n * @beta\n *\n * @privateRemarks\n * This is exposed to support {@link createChildLogger} properties parameter.\n */\nexport interface ITelemetryLoggerPropertyBags {\n\tall?: ITelemetryLoggerPropertyBag;\n\terror?: ITelemetryLoggerPropertyBag;\n}\n\n/**\n * Attempts to parse number from string.\n * If it fails, it will return the original string.\n *\n * @remarks\n * Used to make telemetry data typed (and support math operations, like comparison),\n * in places where we do expect numbers (like contentsize/duration property in http header).\n *\n * @internal\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function numberFromString(str: string | null | undefined): string | number | undefined {\n\tif (str === undefined || str === null) {\n\t\treturn undefined;\n\t}\n\tconst num = Number(str);\n\treturn Number.isNaN(num) ? str : num;\n}\n\n// TODO: add docs\n// eslint-disable-next-line jsdoc/require-description\n/**\n * @internal\n */\nexport function formatTick(tick: number): number {\n\treturn Math.floor(tick);\n}\n\n/**\n * String used to concatenate the namespace of parent loggers and their child loggers.\n * @internal\n */\nexport const eventNamespaceSeparator = \":\";\n\n/**\n * TelemetryLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n */\nexport abstract class TelemetryLogger implements TelemetryLoggerExt {\n\t/**\n\t * {@inheritDoc eventNamespaceSeparator}\n\t */\n\tpublic static readonly eventNamespaceSeparator = eventNamespaceSeparator;\n\n\tpublic static sanitizePkgName(name: string): string {\n\t\treturn name.replace(\"@\", \"\").replace(\"/\", \"-\");\n\t}\n\n\t/**\n\t * Take an unknown error object and add the appropriate info from it to the event. Message and stack will be copied\n\t * over from the error object, along with other telemetry properties if it's an ILoggingError.\n\t * @param event - Event being logged\n\t * @param error - Error to extract info from\n\t * @param fetchStack - Whether to fetch the current callstack if error.stack is undefined\n\t */\n\tpublic static prepareErrorObject(\n\t\tevent: ITelemetryBaseEvent,\n\t\terror: unknown,\n\t\tfetchStack: boolean,\n\t): void {\n\t\tconst { message, errorType, stack } = extractLogSafeErrorProperties(\n\t\t\terror,\n\t\t\ttrue /* sanitizeStack */,\n\t\t);\n\t\t// First, copy over error message, stack, and errorType directly (overwrite if present on event)\n\t\tevent.stack = stack;\n\t\tevent.error = message; // Note that the error message goes on the 'error' field\n\t\tevent.errorType = errorType;\n\n\t\tif (isILoggingError(error)) {\n\t\t\t// Add any other telemetry properties from the LoggingError\n\t\t\tconst telemetryProp = error.getTelemetryProperties();\n\t\t\tfor (const key of Object.keys(telemetryProp)) {\n\t\t\t\tif (event[key] !== undefined) {\n\t\t\t\t\t// Don't overwrite existing properties on the event\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tevent[key] = telemetryProp[key];\n\t\t\t}\n\t\t}\n\n\t\t// Collect stack if we were not able to extract it from error\n\t\tif (event.stack === undefined && fetchStack) {\n\t\t\tevent.stack = generateStack();\n\t\t}\n\t}\n\n\tpublic constructor(\n\t\tprotected readonly namespace?: string,\n\t\tprotected readonly properties?: ITelemetryLoggerPropertyBags,\n\t) {}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic abstract send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendTelemetryEvent(\n\t\tevent: ITelemetryGenericEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{ ...event, category: event.category ?? \"generic\" },\n\t\t\terror,\n\t\t\tevent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\t/**\n\t * Send a telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - level of the log.\n\t */\n\tprivate sendTelemetryEventCore(\n\t\tevent: ITelemetryGenericEventExt & { category: TelemetryEventCategory },\n\t\terror: unknown,\n\t\tlogLevel: LogLevel,\n\t): void {\n\t\tconst newEvent = convertToBaseEvent(event);\n\t\tif (error !== undefined) {\n\t\t\tTelemetryLogger.prepareErrorObject(newEvent, error, false);\n\t\t}\n\n\t\t// Will include Nan & Infinity, but probably we do not care\n\t\tif (typeof newEvent.duration === \"number\") {\n\t\t\tnewEvent.duration = formatTick(newEvent.duration);\n\t\t}\n\n\t\tthis.send(newEvent, logLevel);\n\t}\n\n\t/**\n\t * Send an error telemetry event with the logger\n\t *\n\t * @param event - the event to send\n\t * @param error - optional error object to log\n\t */\n\tpublic sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void {\n\t\tthis.sendTelemetryEventCore(\n\t\t\t{\n\t\t\t\t// ensure the error field has some value,\n\t\t\t\t// this can and will be overridden by event, or error\n\t\t\t\terror: event.eventName,\n\t\t\t\t...event,\n\t\t\t\tcategory: \"error\",\n\t\t\t},\n\t\t\terror,\n\t\t\tLogLevel.essential,\n\t\t);\n\t}\n\n\t/**\n\t * Send a performance telemetry event with the logger\n\t *\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log. If the event's category is `error`,\n\t * the logLevel will be upgraded to {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tpublic sendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEventExt,\n\t\terror?: unknown,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): void {\n\t\tconst perfEvent = {\n\t\t\t...event,\n\t\t\tcategory: event.category ?? \"performance\",\n\t\t};\n\n\t\tthis.sendTelemetryEventCore(\n\t\t\tperfEvent,\n\t\t\terror,\n\t\t\tperfEvent.category === \"error\" ? LogLevel.essential : (logLevel ?? LogLevel.essential),\n\t\t);\n\t}\n\n\tprotected prepareEvent(event: ITelemetryBaseEvent): ITelemetryBaseEvent {\n\t\tconst includeErrorProps = event.category === \"error\" || event.error !== undefined;\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\t...event,\n\t\t};\n\t\tif (this.namespace !== undefined) {\n\t\t\tnewEvent.eventName = `${this.namespace}${TelemetryLogger.eventNamespaceSeparator}${newEvent.eventName}`;\n\t\t}\n\t\treturn this.extendProperties(newEvent, includeErrorProps);\n\t}\n\n\tprivate extendProperties<\n\t\tT extends ITelemetryLoggerPropertyBag = ITelemetryLoggerPropertyBag,\n\t>(toExtend: T, includeErrorProps: boolean): T {\n\t\tconst eventLike: ITelemetryLoggerPropertyBag = toExtend;\n\t\tif (this.properties) {\n\t\t\tconst properties: (undefined | ITelemetryLoggerPropertyBag)[] = [];\n\t\t\tproperties.push(this.properties.all);\n\t\t\tif (includeErrorProps) {\n\t\t\t\tproperties.push(this.properties.error);\n\t\t\t}\n\t\t\tfor (const props of properties) {\n\t\t\t\tif (props !== undefined) {\n\t\t\t\t\tfor (const [key, getterOrValue] of Object.entries(props)) {\n\t\t\t\t\t\tif (eventLike[key] !== undefined) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this throws, hopefully it is handled elsewhere\n\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\ttypeof getterOrValue === \"function\" ? getterOrValue() : getterOrValue;\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\teventLike[key] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toExtend;\n\t}\n}\n\n/**\n * @deprecated 0.56, remove TaggedLoggerAdapter once its usage is removed from\n * container-runtime. Issue: #8191\n * TaggedLoggerAdapter class can add tag handling to your logger.\n *\n * @internal\n */\nexport class TaggedLoggerAdapter implements ITelemetryBaseLogger {\n\tpublic constructor(private readonly logger: ITelemetryBaseLogger) {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#ITelemetryBaseLogger.send}\n\t */\n\tpublic send(eventWithTagsMaybe: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseEvent = {\n\t\t\tcategory: eventWithTagsMaybe.category,\n\t\t\teventName: eventWithTagsMaybe.eventName,\n\t\t};\n\t\tfor (const [key, taggableProp] of Object.entries(eventWithTagsMaybe)) {\n\t\t\tconst { value, tag } =\n\t\t\t\ttypeof taggableProp === \"object\"\n\t\t\t\t\t? taggableProp\n\t\t\t\t\t: { value: taggableProp, tag: undefined };\n\t\t\tswitch (tag) {\n\t\t\t\tcase undefined: {\n\t\t\t\t\t// No tag means we can log plainly\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"PackageData\": // For back-compat\n\t\t\t\tcase TelemetryDataTag.CodeArtifact: {\n\t\t\t\t\t// For Microsoft applications, CodeArtifact is safe for now\n\t\t\t\t\t// (we don't load 3P code in 1P apps)\n\t\t\t\t\tnewEvent[key] = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TelemetryDataTag.UserData: {\n\t\t\t\t\t// Strip out anything tagged explicitly as UserData.\n\t\t\t\t\t// Alternate strategy would be to hash these props\n\t\t\t\t\tnewEvent[key] = \"REDACTED (UserData)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t// If we encounter a tag we don't recognize\n\t\t\t\t\t// then we must assume we should scrub.\n\t\t\t\t\tnewEvent[key] = \"REDACTED (unknown tag)\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.logger.send(newEvent);\n\t}\n}\n\nfunction toEitherTelemetryLoggerExt(\n\tlogger: TelemetryLoggerExt,\n): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn logger as TelemetryLoggerExt & ITelemetryLoggerExt;\n}\n\n/**\n * Create a child logger based on the provided props object.\n *\n * @remarks\n * Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.\n *\n * @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.\n *\n * @internal\n *\n * @privateRemarks\n * Return type is both TelemetryLoggerExt and ITelemetryLoggerExt to allow for\n * easier internal usage without needing to type erase or un-type-erase the\n * logger.\n *\n * If always creating a child logger for direct external exposure, consider\n * using {@link createChildLogger} from /legacy API instead, which returns\n * exactly an {@link ITelemetryLoggerExt}.\n */\nexport function createChildLogger(props?: {\n\tlogger?: ITelemetryBaseLogger;\n\tnamespace?: string;\n\tproperties?: ITelemetryLoggerPropertyBags;\n}): TelemetryLoggerExt & ITelemetryLoggerExt {\n\treturn toEitherTelemetryLoggerExt(\n\t\tChildLogger.create(props?.logger, props?.namespace, props?.properties),\n\t);\n}\n\n/**\n * ChildLogger class contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events.\n */\nexport class ChildLogger extends TelemetryLogger {\n\t/**\n\t * Create child logger\n\t * @param baseLogger - Base logger to use to output events. If undefined, proper child logger\n\t * is created, but it does not send telemetry events anywhere.\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t */\n\tpublic static create(\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): TelemetryLogger {\n\t\t// if we are creating a child of a child, rather than nest, which will increase\n\t\t// the callstack overhead, just generate a new logger that includes everything from the previous\n\t\tif (baseLogger instanceof ChildLogger) {\n\t\t\tconst combinedProperties: ITelemetryLoggerPropertyBags = {};\n\t\t\tfor (const extendedProps of [baseLogger.properties, properties]) {\n\t\t\t\tif (extendedProps !== undefined) {\n\t\t\t\t\tif (extendedProps.all !== undefined) {\n\t\t\t\t\t\tcombinedProperties.all = {\n\t\t\t\t\t\t\t...combinedProperties.all,\n\t\t\t\t\t\t\t...extendedProps.all,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (extendedProps.error !== undefined) {\n\t\t\t\t\t\tcombinedProperties.error = {\n\t\t\t\t\t\t\t...combinedProperties.error,\n\t\t\t\t\t\t\t...extendedProps.error,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst combinedNamespace =\n\t\t\t\tbaseLogger.namespace === undefined\n\t\t\t\t\t? namespace\n\t\t\t\t\t: namespace === undefined\n\t\t\t\t\t\t? baseLogger.namespace\n\t\t\t\t\t\t: `${baseLogger.namespace}${TelemetryLogger.eventNamespaceSeparator}${namespace}`;\n\n\t\t\tconst child = new ChildLogger(\n\t\t\t\tbaseLogger.baseLogger,\n\t\t\t\tcombinedNamespace,\n\t\t\t\tcombinedProperties,\n\t\t\t);\n\n\t\t\tif (!loggerIsMonitoringContext(child) && loggerIsMonitoringContext(baseLogger)) {\n\t\t\t\tmixinMonitoringContext(child, baseLogger.config);\n\t\t\t}\n\t\t\treturn child;\n\t\t}\n\n\t\treturn new ChildLogger(baseLogger ?? { send(): void {} }, namespace, properties);\n\t}\n\n\tprivate constructor(\n\t\tprotected readonly baseLogger: ITelemetryBaseLogger,\n\t\tnamespace: string | undefined,\n\t\tproperties: ITelemetryLoggerPropertyBags | undefined,\n\t) {\n\t\tsuper(namespace, properties);\n\n\t\t// propagate the monitoring context\n\t\tif (loggerIsMonitoringContext(baseLogger)) {\n\t\t\tmixinMonitoringContext(this, new CachedConfigProvider(this, baseLogger.config));\n\t\t}\n\t}\n\n\tpublic get minLogLevel(): LogLevel | undefined {\n\t\treturn this.baseLogger.minLogLevel;\n\t}\n\n\tprivate shouldFilterOutEvent(event: ITelemetryBaseEvent, logLevel?: LogLevel): boolean {\n\t\tconst eventLogLevel = logLevel ?? LogLevel.essential;\n\t\tconst configLogLevel = this.baseLogger.minLogLevel ?? LogLevel.info;\n\t\t// Filter out in case event log level is below what is wanted in config.\n\t\treturn eventLogLevel < configLogLevel;\n\t}\n\n\t/**\n\t * Send an event with the logger\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tif (this.shouldFilterOutEvent(event, logLevel)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseLogger.send(this.prepareEvent(event), logLevel ?? LogLevel.essential);\n\t}\n}\n\n/**\n * Input properties for {@link createMultiSinkLogger}.\n *\n * @internal\n */\nexport interface MultiSinkLoggerProperties {\n\t/**\n\t * Will be prefixed to all event names.\n\t */\n\tnamespace?: string;\n\n\t/**\n\t * Default properties that will be applied to all events flowing through this logger.\n\t */\n\tproperties?: ITelemetryLoggerPropertyBags;\n\n\t/**\n\t * The base loggers that this logger will forward the logs to, after it processes them.\n\t */\n\tloggers?: (ITelemetryBaseLogger | undefined)[];\n\n\t/**\n\t * If true, the logger will attempt to copy the custom properties (if they are of a known type, i.e. one from this package) of all the base loggers passed to it, to apply them itself to logs that flow through.\n\t */\n\ttryInheritProperties?: true;\n}\n\n/**\n * Create a logger which logs to multiple other loggers based on the provided props object.\n *\n * @internal\n */\nexport function createMultiSinkLogger(props: MultiSinkLoggerProperties): TelemetryLoggerExt {\n\treturn new MultiSinkLogger(\n\t\tprops.namespace,\n\t\tprops.properties,\n\t\tprops.loggers?.filter((l): l is ITelemetryBaseLogger => l !== undefined),\n\t\tprops.tryInheritProperties,\n\t);\n}\n\n/**\n * Multi-sink logger\n * Takes multiple ITelemetryBaseLogger objects (sinks) and logs all events into each sink\n */\nexport class MultiSinkLogger extends TelemetryLogger {\n\tprotected loggers: ITelemetryBaseLogger[];\n\t// This is minimum of minLlogLevel of all loggers.\n\tprivate _minLogLevelOfAllLoggers: LogLevel;\n\n\t/**\n\t * Create multiple sink logger (i.e. logger that sends events to multiple sinks)\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param loggers - The list of loggers to use as sinks\n\t * @param tryInheritProperties - Will attempted to copy those loggers properties to this loggers if they are of a known type e.g. one from this package\n\t */\n\tpublic constructor(\n\t\tnamespace?: string,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t\tloggers: ITelemetryBaseLogger[] = [],\n\t\ttryInheritProperties?: true,\n\t) {\n\t\tlet realProperties = properties === undefined ? undefined : { ...properties };\n\t\tif (tryInheritProperties === true) {\n\t\t\tconst merge = (realProperties ??= {});\n\t\t\tloggers\n\t\t\t\t.filter((l): l is this => l instanceof TelemetryLogger)\n\t\t\t\t.map((l) => l.properties ?? {})\n\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t.forEach((cv) => {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-array-for-each\n\t\t\t\t\tObject.keys(cv).forEach((k) => {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\tmerge[k] = { ...cv[k], ...merge?.[k] };\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\tsuper(namespace, realProperties);\n\t\tthis.loggers = loggers;\n\t\tthis._minLogLevelOfAllLoggers = LogLevel.info;\n\t\tthis.calculateMinLogLevel();\n\t}\n\n\tpublic get minLogLevel(): LogLevel {\n\t\treturn this._minLogLevelOfAllLoggers;\n\t}\n\n\tprivate calculateMinLogLevel(): void {\n\t\tif (this.loggers.length > 0) {\n\t\t\tconst logLevels: LogLevel[] = [];\n\t\t\tfor (const logger of this.loggers) {\n\t\t\t\tlogLevels.push(logger.minLogLevel ?? LogLevel.info);\n\t\t\t}\n\t\t\tthis._minLogLevelOfAllLoggers = Math.min(...logLevels) as LogLevel;\n\t\t}\n\t}\n\n\t/**\n\t * Add logger to send all events to\n\t * @param logger - Logger to add\n\t */\n\tpublic addLogger(logger?: ITelemetryBaseLogger): void {\n\t\tif (logger !== undefined && logger !== null) {\n\t\t\tthis.loggers.push(logger);\n\t\t\t// Update in case the logLevel of added logger is less than the current.\n\t\t\tthis.calculateMinLogLevel();\n\t\t}\n\t}\n\n\t/**\n\t * Send an event to the loggers\n\t *\n\t * @param event - the event to send to all the registered logger\n\t */\n\tpublic send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void {\n\t\tconst newEvent = this.prepareEvent(event);\n\t\tfor (const logger of this.loggers) {\n\t\t\tlogger.send(newEvent, logLevel ?? LogLevel.essential);\n\t\t}\n\t}\n}\n\n/**\n * Describes what events {@link PerformanceEvent} should log.\n *\n * @remarks\n * By default, all events are logged, but the client can override this behavior.\n *\n * For example, there is rarely a need to record a start event, as we're really after\n * success / failure tracking, including duration (on success).\n *\n * @internal\n */\nexport interface IPerformanceEventMarkers {\n\tstart?: true;\n\tend?: true;\n\tcancel?: \"generic\" | \"error\"; // tells whether to issue \"generic\" or \"error\" category cancel event\n\t/**\n\t * If specified, _end events whose duration is greater than this threshold are logged as essential.\n\t */\n\tendEventEssentialDurationThresholdMs?: number;\n}\n\n/**\n * Helper class to log performance events.\n *\n * @internal\n */\nexport class PerformanceEvent {\n\t/**\n\t * Creates an instance of {@link PerformanceEvent} and starts measurements\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param emitLogs - should this instance emit logs. If set to false, logs will not be emitted to the logger,\n\t * but measurements will still be performed and any specified markers will be generated.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns An instance of {@link PerformanceEvent}\n\t */\n\tpublic static start(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\temitLogs: boolean = true,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): PerformanceEvent {\n\t\treturn new PerformanceEvent(\n\t\t\textractTelemetryLoggerExt(logger),\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\temitLogs,\n\t\t\tlogLevel,\n\t\t);\n\t}\n\n\t/**\n\t * Measure a synchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static timedExec<T>(\n\t\tlogger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => T,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): T {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Measure an asynchronous task\n\t * @param logger - the logger to be used for publishing events\n\t * @param event - the logging event details which will be published with the performance measurements\n\t * @param callback - the task to be executed and measured\n\t * @param markers - See {@link IPerformanceEventMarkers}\n\t * @param recordHeapSize - whether or not to also record memory performance\n\t * @param sampleThreshold - events with the same name and category will be sent to the logger\n\t * only when we hit this many executions of the task. If unspecified, all events will be sent.\n\t * @param logLevel - optional {@link LogLevel} for events emitted by this performance event.\n\t * If unspecified, {@link @fluidframework/core-interfaces#LogLevelConst.essential | LogLevel.essential} will be used.\n\t * @returns The results of the executed task\n\t *\n\t * @remarks Note that if the \"same\" event (category + eventName) would be emitted by different\n\t * tasks (`callback`), `sampleThreshold` is still applied only based on the event's category + eventName,\n\t * so executing either of the tasks will increase the internal counter and they\n\t * effectively \"share\" the sampling rate for the event.\n\t */\n\tpublic static async timedExecAsync<T>(\n\t\tlogger: TelemetryLoggerExt | ITelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tcallback: (event: PerformanceEvent) => Promise<T>,\n\t\tmarkers?: IPerformanceEventMarkers,\n\t\tsampleThreshold: number = 1,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.info,\n\t): Promise<T> {\n\t\tconst perfEvent = PerformanceEvent.start(\n\t\t\tlogger,\n\t\t\tevent,\n\t\t\tmarkers,\n\t\t\tPerformanceEvent.shouldReport(event, sampleThreshold),\n\t\t\tlogLevel,\n\t\t);\n\t\ttry {\n\t\t\tconst ret = await callback(perfEvent);\n\t\t\tperfEvent.autoEnd();\n\t\t\treturn ret;\n\t\t} catch (error) {\n\t\t\tperfEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic get duration(): number {\n\t\treturn performanceNow() - this.startTime;\n\t}\n\n\tprivate event?: ITelemetryGenericEventExt;\n\tprivate readonly startTime = performanceNow();\n\tprivate startMark?: string;\n\n\tprivate constructor(\n\t\tprivate readonly logger: TelemetryLoggerExt,\n\t\tevent: ITelemetryGenericEventExt,\n\t\tprivate readonly markers: IPerformanceEventMarkers = { end: true, cancel: \"generic\" },\n\t\tprivate readonly emitLogs: boolean = true,\n\t\tprivate readonly logLevel: typeof LogLevel.verbose | typeof LogLevel.info | undefined,\n\t) {\n\t\tthis.event = { ...event };\n\t\tif (this.markers.start) {\n\t\t\tthis.reportEvent(\"start\");\n\t\t}\n\n\t\tif (\n\t\t\ttypeof window === \"object\" &&\n\t\t\twindow?.performance?.mark !== undefined &&\n\t\t\twindow?.performance?.mark !== null\n\t\t) {\n\t\t\tthis.startMark = `${event.eventName}-start`;\n\t\t\twindow.performance.mark(this.startMark);\n\t\t}\n\t}\n\n\tpublic reportProgress(\n\t\tprops?: ITelemetryPropertiesExt,\n\t\teventNameSuffix: string = \"update\",\n\t): void {\n\t\tthis.reportEvent(eventNameSuffix, props);\n\t}\n\n\tprivate autoEnd(): void {\n\t\t// Event might have been cancelled or ended in the callback\n\t\tif (this.event && this.markers.end) {\n\t\t\tthis.reportEvent(\"end\");\n\t\t}\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tpublic end(props?: ITelemetryPropertiesExt): void {\n\t\tthis.reportEvent(\"end\", props);\n\t\tthis.performanceEndMark();\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\tprivate performanceEndMark(): void {\n\t\tif (this.startMark !== undefined && this.event) {\n\t\t\tconst endMark = `${this.event.eventName}-end`;\n\t\t\twindow.performance.mark(endMark);\n\t\t\twindow.performance.measure(`${this.event.eventName}`, this.startMark, endMark);\n\t\t\tthis.startMark = undefined;\n\t\t}\n\t}\n\n\tpublic cancel(props?: ITelemetryPropertiesExt, error?: unknown): void {\n\t\tif (this.markers.cancel !== undefined) {\n\t\t\tthis.reportEvent(\"cancel\", { category: this.markers.cancel, ...props }, error);\n\t\t}\n\n\t\t// To prevent the event from being reported again later\n\t\tthis.event = undefined;\n\t}\n\n\t/**\n\t * Report the event, if it hasn't already been reported.\n\t */\n\tpublic reportEvent(\n\t\teventNameSuffix: string,\n\t\tprops?: ITelemetryPropertiesExt,\n\t\terror?: unknown,\n\t): void {\n\t\t// If the caller invokes cancel or end directly inside the callback for timedExec[Async],\n\t\t// then it's possible to come back through reportEvent twice. Only the first time counts.\n\t\tif (!this.event) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.emitLogs) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event: ITelemetryPerformanceEventExt = { ...this.event, ...props };\n\t\tevent.eventName = `${event.eventName}_${eventNameSuffix}`;\n\t\tif (eventNameSuffix !== \"start\") {\n\t\t\tevent.duration = this.duration;\n\t\t}\n\n\t\tthis.logger.sendPerformanceEvent(event, error, this.getLogLevel(eventNameSuffix, event));\n\t}\n\n\t/**\n\t * Get the LogLevel for performance events.\n\t * @param eventNameSuffix - The suffix of the event name.\n\t * @param event - The telemetry performance event.\n\t * @returns The log level for the event.\n\t *\n\t */\n\tprivate getLogLevel(\n\t\teventNameSuffix: string,\n\t\tevent: ITelemetryPerformanceEventExt,\n\t): typeof LogLevel.verbose | typeof LogLevel.info | undefined {\n\t\tif (eventNameSuffix === \"cancel\") {\n\t\t\t// \tWhen undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (\n\t\t\teventNameSuffix === \"end\" &&\n\t\t\tevent.duration !== undefined &&\n\t\t\tthis.markers.endEventEssentialDurationThresholdMs !== undefined &&\n\t\t\tevent.duration > this.markers.endEventEssentialDurationThresholdMs\n\t\t) {\n\t\t\t// When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.logLevel;\n\t}\n\n\tprivate static readonly eventHits = new Map<string, number>();\n\tprivate static shouldReport(\n\t\tevent: ITelemetryGenericEventExt,\n\t\tsampleThreshold: number,\n\t): boolean {\n\t\tconst eventKey = `.${event.category}.${event.eventName}`;\n\t\tconst hitCount = PerformanceEvent.eventHits.get(eventKey) ?? 0;\n\t\tPerformanceEvent.eventHits.set(eventKey, hitCount >= sampleThreshold ? 1 : hitCount + 1);\n\t\treturn hitCount % sampleThreshold === 0;\n\t}\n}\n\n/**\n * Takes in an event object, and converts all of its values to a basePropertyType.\n * In the case of an invalid property type, the value will be converted to an error string.\n * @param event - Event with fields you want to stringify.\n */\nfunction convertToBaseEvent({\n\tcategory,\n\teventName,\n\t...props\n}: ITelemetryEventExt): ITelemetryBaseEvent {\n\tconst newEvent: ITelemetryBaseEvent = { category, eventName };\n\tfor (const key of Object.keys(props)) {\n\t\tnewEvent[key] = convertToBasePropertyType(props[key]);\n\t}\n\treturn newEvent;\n}\n\n/**\n * Takes in value, and does one of 4 things.\n * if value is of primitive type - returns the original value.\n * If the value is a flat array or object - returns a stringified version of the array/object.\n * If the value is an object of type Tagged<TelemetryBaseEventPropertyType> - returns the object\n * with its values recursively converted to base property Type.\n * If none of these cases are reached - returns an error string\n * @param x - value passed in to convert to a base property type\n */\nexport function convertToBasePropertyType(\n\tx: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>,\n): TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType> {\n\treturn isTaggedTelemetryPropertyValue(x)\n\t\t? {\n\t\t\t\tvalue: convertToBasePropertyTypeUntagged(x.value),\n\t\t\t\ttag: x.tag,\n\t\t\t}\n\t\t: convertToBasePropertyTypeUntagged(x);\n}\n\nfunction convertToBasePropertyTypeUntagged(\n\tx: TelemetryEventPropertyTypeExt,\n): TelemetryBaseEventPropertyType {\n\tswitch (typeof x) {\n\t\tcase \"string\":\n\t\tcase \"number\":\n\t\tcase \"boolean\":\n\t\tcase \"undefined\": {\n\t\t\treturn x;\n\t\t}\n\t\tcase \"object\": {\n\t\t\t// We assume this is an array or flat object based on the input types\n\t\t\treturn JSON.stringify(x);\n\t\t}\n\t\tdefault: {\n\t\t\t// should never reach this case based on the input types\n\t\t\tconsole.error(\n\t\t\t\t`convertToBasePropertyTypeUntagged: INVALID PROPERTY (typed as ${typeof x})`,\n\t\t\t);\n\t\t\treturn `INVALID PROPERTY (typed as ${typeof x})`;\n\t\t}\n\t}\n}\n\n/**\n * Tags all given `values` with the same `tag`.\n *\n * @param tag - The tag with which all `values` will be annotated.\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagData(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged.\n *\n * @internal\n */\nexport const tagData = <\n\tT extends TelemetryDataTag,\n\tV extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\ttag: T,\n\tvalues: V,\n): {\n\t[P in keyof V]:\n\t\t| (V[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<V[P]>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<V[P], undefined>;\n\t\t\t\t\t\ttag: T;\n\t\t\t\t\t})\n\t\t| (V[P] extends undefined ? undefined : never);\n} =>\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\tObject.entries(values)\n\t\t.filter((e) => e[1] !== undefined)\n\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t.reduce((pv, cv) => {\n\t\t\tconst [key, value] = cv;\n\t\t\t// The ternary form is less legible in this case.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tpv[key] = () => {\n\t\t\t\t\treturn { tag, value: value() };\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tpv[key] = { tag, value };\n\t\t\t}\n\t\t\treturn pv;\n\t\t}, {}) as ReturnType<typeof tagData>;\n\n/**\n * Tags all provided `values` as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @param values - The values to be tagged.\n *\n * @remarks\n * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},\n * as well as callbacks that return that type.\n *\n * @example Sample usage\n * ```typescript\n * {\n * \t// ...Other properties being added to a telemetry event\n * \t...tagCodeArtifacts(\"someTag\", {foo: 1, bar: 2}),\n * \t// ...\n * }\n * ```\n * This will result in `foo` and `bar` added to the event with their values tagged as {@link TelemetryDataTag.CodeArtifact}.\n *\n * @see {@link tagData}\n *\n * @internal\n */\nexport const tagCodeArtifacts = <\n\tT extends Record<\n\t\tstring,\n\t\tTelemetryBaseEventPropertyType | (() => TelemetryBaseEventPropertyType)\n\t>,\n>(\n\tvalues: T,\n): {\n\t[P in keyof T]:\n\t\t| (T[P] extends () => TelemetryBaseEventPropertyType\n\t\t\t\t? () => {\n\t\t\t\t\t\tvalue: ReturnType<T[P]>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tvalue: Exclude<T[P], undefined>;\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\t\t})\n\t\t| (T[P] extends undefined ? undefined : never);\n} => tagData<TelemetryDataTag.CodeArtifact, T>(TelemetryDataTag.CodeArtifact, values);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/telemetry-utils",
3
- "version": "2.101.1",
3
+ "version": "2.103.0",
4
4
  "description": "Collection of telemetry relates utilities for Fluid",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,22 +69,22 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "~2.101.1",
73
- "@fluidframework/core-interfaces": "~2.101.1",
74
- "@fluidframework/core-utils": "~2.101.1",
75
- "@fluidframework/driver-definitions": "~2.101.1",
72
+ "@fluid-internal/client-utils": "~2.103.0",
73
+ "@fluidframework/core-interfaces": "~2.103.0",
74
+ "@fluidframework/core-utils": "~2.103.0",
75
+ "@fluidframework/driver-definitions": "~2.103.0",
76
76
  "debug": "^4.3.4",
77
77
  "uuid": "^11.1.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@arethetypeswrong/cli": "^0.18.2",
81
81
  "@biomejs/biome": "~2.4.5",
82
- "@fluid-internal/mocha-test-setup": "~2.101.1",
82
+ "@fluid-internal/mocha-test-setup": "~2.103.0",
83
83
  "@fluid-tools/build-cli": "^0.65.0",
84
84
  "@fluidframework/build-common": "^2.0.3",
85
85
  "@fluidframework/build-tools": "^0.65.0",
86
86
  "@fluidframework/eslint-config-fluid": "^9.0.0",
87
- "@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.92.0",
87
+ "@fluidframework/telemetry-utils-previous": "npm:@fluidframework/telemetry-utils@2.101.0",
88
88
  "@microsoft/api-extractor": "7.58.1",
89
89
  "@types/debug": "^4.1.5",
90
90
  "@types/mocha": "^10.0.10",
package/src/error.ts CHANGED
@@ -295,8 +295,7 @@ export class DataProcessingError extends LoggingError implements IErrorBase, IFl
295
295
  messageLike?: MessageLike,
296
296
  ): IFluidErrorBase {
297
297
  return wrapDataProcessingErrorIfUnrecognized(
298
- (errorMessage: string, props?: ITelemetryBaseProperties) =>
299
- new DataProcessingError(errorMessage, props),
298
+ (errorMessage: string) => new DataProcessingError(errorMessage),
300
299
  originalError,
301
300
  dataProcessingCodepath,
302
301
  messageLike,
package/src/internal.ts CHANGED
@@ -102,16 +102,3 @@ export type {
102
102
  } from "./telemetryTypesUndeprecated.js";
103
103
  export { TelemetryEventBatcher } from "./telemetryEventBatcher.js";
104
104
  export { allowIncompatibleLayersKey, validateLayerCompatibility } from "./layerCompatError.js";
105
-
106
- import type { TelemetryLoggerExt } from "./telemetryTypes.js";
107
-
108
- /**
109
- * Renamed version of TelemetryLoggerExt for convenience of internal use.
110
- * Where "`ITelemetryLoggerExt`" is exposed in customer API surface, true
111
- * `ITelemetryLoggerExt` (that is an erased type) must be used. To access
112
- * use `@fluidframework/telemetry-utils/legacy` import spec. All internal
113
- * usages should be promoted to `TelemetryLoggerExt` naming.
114
- *
115
- * @internal
116
- */
117
- export type ITelemetryLoggerExt = TelemetryLoggerExt;
package/src/logger.ts CHANGED
@@ -675,7 +675,11 @@ export class MultiSinkLogger extends TelemetryLogger {
675
675
  export interface IPerformanceEventMarkers {
676
676
  start?: true;
677
677
  end?: true;
678
- cancel?: "generic" | "error"; // tells wether to issue "generic" or "error" category cancel event
678
+ cancel?: "generic" | "error"; // tells whether to issue "generic" or "error" category cancel event
679
+ /**
680
+ * If specified, _end events whose duration is greater than this threshold are logged as essential.
681
+ */
682
+ endEventEssentialDurationThresholdMs?: number;
679
683
  }
680
684
 
681
685
  /**
@@ -895,7 +899,36 @@ export class PerformanceEvent {
895
899
  event.duration = this.duration;
896
900
  }
897
901
 
898
- this.logger.sendPerformanceEvent(event, error, this.logLevel);
902
+ this.logger.sendPerformanceEvent(event, error, this.getLogLevel(eventNameSuffix, event));
903
+ }
904
+
905
+ /**
906
+ * Get the LogLevel for performance events.
907
+ * @param eventNameSuffix - The suffix of the event name.
908
+ * @param event - The telemetry performance event.
909
+ * @returns The log level for the event.
910
+ *
911
+ */
912
+ private getLogLevel(
913
+ eventNameSuffix: string,
914
+ event: ITelemetryPerformanceEventExt,
915
+ ): typeof LogLevel.verbose | typeof LogLevel.info | undefined {
916
+ if (eventNameSuffix === "cancel") {
917
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
918
+ return undefined;
919
+ }
920
+
921
+ if (
922
+ eventNameSuffix === "end" &&
923
+ event.duration !== undefined &&
924
+ this.markers.endEventEssentialDurationThresholdMs !== undefined &&
925
+ event.duration > this.markers.endEventEssentialDurationThresholdMs
926
+ ) {
927
+ // When undefined is returned, the LogLevel will be set to LogLevel.essential. See ChildLogger.send
928
+ return undefined;
929
+ }
930
+
931
+ return this.logLevel;
899
932
  }
900
933
 
901
934
  private static readonly eventHits = new Map<string, number>();