@fluidframework/telemetry-utils 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212

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.
Files changed (125) hide show
  1. package/api-extractor-lint.json +13 -0
  2. package/api-extractor.json +0 -4
  3. package/api-report/telemetry-utils.api.md +61 -57
  4. package/dist/config.d.ts +37 -10
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +30 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/error.d.ts +2 -0
  9. package/dist/error.d.ts.map +1 -1
  10. package/dist/error.js +2 -0
  11. package/dist/error.js.map +1 -1
  12. package/dist/errorLogging.d.ts +7 -2
  13. package/dist/errorLogging.d.ts.map +1 -1
  14. package/dist/errorLogging.js +7 -2
  15. package/dist/errorLogging.js.map +1 -1
  16. package/dist/eventEmitterWithErrorHandling.d.ts +8 -0
  17. package/dist/eventEmitterWithErrorHandling.d.ts.map +1 -1
  18. package/dist/eventEmitterWithErrorHandling.js +8 -0
  19. package/dist/eventEmitterWithErrorHandling.js.map +1 -1
  20. package/dist/events.d.ts +15 -0
  21. package/dist/events.d.ts.map +1 -1
  22. package/dist/events.js +16 -0
  23. package/dist/events.js.map +1 -1
  24. package/dist/fluidErrorBase.d.ts +8 -0
  25. package/dist/fluidErrorBase.d.ts.map +1 -1
  26. package/dist/fluidErrorBase.js +6 -0
  27. package/dist/fluidErrorBase.js.map +1 -1
  28. package/dist/index.d.ts +19 -2
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/logger.d.ts +117 -17
  32. package/dist/logger.d.ts.map +1 -1
  33. package/dist/logger.js +82 -12
  34. package/dist/logger.js.map +1 -1
  35. package/dist/mockLogger.d.ts +2 -0
  36. package/dist/mockLogger.d.ts.map +1 -1
  37. package/dist/mockLogger.js +2 -0
  38. package/dist/mockLogger.js.map +1 -1
  39. package/dist/sampledTelemetryHelper.d.ts +7 -3
  40. package/dist/sampledTelemetryHelper.d.ts.map +1 -1
  41. package/dist/sampledTelemetryHelper.js +7 -3
  42. package/dist/sampledTelemetryHelper.js.map +1 -1
  43. package/dist/telemetry-utils-alpha.d.ts +105 -601
  44. package/dist/telemetry-utils-beta.d.ts +123 -610
  45. package/dist/telemetry-utils-public.d.ts +123 -610
  46. package/dist/telemetry-utils-untrimmed.d.ts +249 -41
  47. package/dist/telemetryTypes.d.ts +32 -8
  48. package/dist/telemetryTypes.d.ts.map +1 -1
  49. package/dist/telemetryTypes.js.map +1 -1
  50. package/dist/thresholdCounter.d.ts +3 -2
  51. package/dist/thresholdCounter.d.ts.map +1 -1
  52. package/dist/thresholdCounter.js +3 -2
  53. package/dist/thresholdCounter.js.map +1 -1
  54. package/dist/utils.d.ts +6 -0
  55. package/dist/utils.d.ts.map +1 -1
  56. package/dist/utils.js +6 -0
  57. package/dist/utils.js.map +1 -1
  58. package/lib/config.d.ts +37 -10
  59. package/lib/config.d.ts.map +1 -1
  60. package/lib/config.js +30 -0
  61. package/lib/config.js.map +1 -1
  62. package/lib/error.d.ts +2 -0
  63. package/lib/error.d.ts.map +1 -1
  64. package/lib/error.js +2 -0
  65. package/lib/error.js.map +1 -1
  66. package/lib/errorLogging.d.ts +7 -2
  67. package/lib/errorLogging.d.ts.map +1 -1
  68. package/lib/errorLogging.js +7 -2
  69. package/lib/errorLogging.js.map +1 -1
  70. package/lib/eventEmitterWithErrorHandling.d.ts +8 -0
  71. package/lib/eventEmitterWithErrorHandling.d.ts.map +1 -1
  72. package/lib/eventEmitterWithErrorHandling.js +8 -0
  73. package/lib/eventEmitterWithErrorHandling.js.map +1 -1
  74. package/lib/events.d.ts +15 -0
  75. package/lib/events.d.ts.map +1 -1
  76. package/lib/events.js +16 -0
  77. package/lib/events.js.map +1 -1
  78. package/lib/fluidErrorBase.d.ts +8 -0
  79. package/lib/fluidErrorBase.d.ts.map +1 -1
  80. package/lib/fluidErrorBase.js +6 -0
  81. package/lib/fluidErrorBase.js.map +1 -1
  82. package/lib/index.d.ts +19 -2
  83. package/lib/index.d.ts.map +1 -1
  84. package/lib/index.js.map +1 -1
  85. package/lib/logger.d.ts +117 -17
  86. package/lib/logger.d.ts.map +1 -1
  87. package/lib/logger.js +82 -12
  88. package/lib/logger.js.map +1 -1
  89. package/lib/mockLogger.d.ts +2 -0
  90. package/lib/mockLogger.d.ts.map +1 -1
  91. package/lib/mockLogger.js +2 -0
  92. package/lib/mockLogger.js.map +1 -1
  93. package/lib/sampledTelemetryHelper.d.ts +7 -3
  94. package/lib/sampledTelemetryHelper.d.ts.map +1 -1
  95. package/lib/sampledTelemetryHelper.js +7 -3
  96. package/lib/sampledTelemetryHelper.js.map +1 -1
  97. package/lib/telemetry-utils-alpha.d.ts +105 -601
  98. package/lib/telemetry-utils-beta.d.ts +123 -610
  99. package/lib/telemetry-utils-public.d.ts +123 -610
  100. package/lib/telemetry-utils-untrimmed.d.ts +249 -41
  101. package/lib/telemetryTypes.d.ts +32 -8
  102. package/lib/telemetryTypes.d.ts.map +1 -1
  103. package/lib/telemetryTypes.js.map +1 -1
  104. package/lib/thresholdCounter.d.ts +3 -2
  105. package/lib/thresholdCounter.d.ts.map +1 -1
  106. package/lib/thresholdCounter.js +3 -2
  107. package/lib/thresholdCounter.js.map +1 -1
  108. package/lib/utils.d.ts +6 -0
  109. package/lib/utils.d.ts.map +1 -1
  110. package/lib/utils.js +6 -0
  111. package/lib/utils.js.map +1 -1
  112. package/package.json +7 -6
  113. package/src/config.ts +41 -12
  114. package/src/error.ts +2 -0
  115. package/src/errorLogging.ts +7 -2
  116. package/src/eventEmitterWithErrorHandling.ts +8 -0
  117. package/src/events.ts +18 -0
  118. package/src/fluidErrorBase.ts +8 -0
  119. package/src/index.ts +20 -2
  120. package/src/logger.ts +125 -17
  121. package/src/mockLogger.ts +2 -0
  122. package/src/sampledTelemetryHelper.ts +7 -3
  123. package/src/telemetryTypes.ts +32 -8
  124. package/src/thresholdCounter.ts +3 -2
  125. package/src/utils.ts +6 -0
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { EventEmitter } from 'events';
4
4
  import { EventEmitterEventType } from '@fluid-internal/client-utils';
5
+ import { IConfigProviderBase as IConfigProviderBase_2 } from '@fluidframework/core-interfaces';
5
6
  import { IDisposable } from '@fluidframework/core-interfaces';
6
7
  import { IErrorBase } from '@fluidframework/core-interfaces';
7
8
  import { IEvent } from '@fluidframework/core-interfaces';
@@ -23,16 +24,28 @@ import { TelemetryBaseEventPropertyType } from '@fluidframework/core-interfaces'
23
24
  import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
24
25
  import { TypedEventEmitter } from '@fluid-internal/client-utils';
25
26
 
27
+ /**
28
+ * Types supported by {@link IConfigProviderBase}.
29
+ * @deprecated Use ConfigTypes from fluidFramework/core-interfaces
30
+ *
31
+ * @internal
32
+ */
26
33
  export declare type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
27
34
 
35
+ /**
36
+ * @internal
37
+ */
28
38
  export declare const connectedEventName = "connected";
29
39
 
30
40
  /**
31
- * Create a child logger based on the provided props object
32
- * @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.
41
+ * Create a child logger based on the provided props object.
33
42
  *
34
43
  * @remarks
35
44
  * Passing in no props object (i.e. undefined) will return a logger that is effectively a no-op.
45
+ *
46
+ * @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.
47
+ *
48
+ * @internal
36
49
  */
37
50
  export declare function createChildLogger(props?: {
38
51
  logger?: ITelemetryBaseLogger;
@@ -40,19 +53,20 @@ export declare function createChildLogger(props?: {
40
53
  properties?: ITelemetryLoggerPropertyBags;
41
54
  }): ITelemetryLoggerExt;
42
55
 
56
+ /**
57
+ * Creates a child logger with a {@link MonitoringContext}.
58
+ *
59
+ * @see {@link loggerToMonitoringContext}
60
+ * @internal
61
+ */
43
62
  export declare function createChildMonitoringContext(props: Parameters<typeof createChildLogger>[0]): MonitoringContext;
44
63
 
45
64
  /**
46
- * Create a logger which logs to multiple other loggers based on the provided props object
47
- * @param props - loggers are the base loggers that will logged to after it's processing, namespace will be prefixed to all event names, properties are default properties that will be applied events.
48
- * tryInheritProperties will attempted to copy those loggers properties to this loggers if they are of a known type e.g. one from this package
65
+ * Create a logger which logs to multiple other loggers based on the provided props object.
66
+ *
67
+ * @internal
49
68
  */
50
- export declare function createMultiSinkLogger(props: {
51
- namespace?: string;
52
- properties?: ITelemetryLoggerPropertyBags;
53
- loggers?: (ITelemetryBaseLogger | undefined)[];
54
- tryInheritProperties?: true;
55
- }): ITelemetryLoggerExt;
69
+ export declare function createMultiSinkLogger(props: MultiSinkLoggerProperties): ITelemetryLoggerExt;
56
70
 
57
71
  /**
58
72
  * Wraps around an existing logger matching the {@link ITelemetryLoggerExt} interface and provides the ability to only log a subset of events using a sampling strategy provided by an ${@link IEventSampler}.
@@ -127,12 +141,23 @@ export declare class DataProcessingError extends LoggingError implements IErrorB
127
141
  static wrapIfUnrecognized(originalError: unknown, dataProcessingCodepath: string, messageLike?: Partial<Pick<ISequencedDocumentMessage, "clientId" | "sequenceNumber" | "clientSequenceNumber" | "referenceSequenceNumber" | "minimumSequenceNumber" | "timestamp">>): IFluidErrorBase;
128
142
  }
129
143
 
144
+ /**
145
+ * @internal
146
+ */
130
147
  export declare const disconnectedEventName = "disconnected";
131
148
 
132
149
  /**
133
150
  * Event Emitter helper class
151
+ *
152
+ * @remarks
134
153
  * Any exceptions thrown by listeners will be caught and raised through "error" event.
135
154
  * Any exception thrown by "error" listeners will propagate to the caller.
155
+ *
156
+ * @internal
157
+ *
158
+ * @privateRemarks
159
+ * This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.
160
+ * We should consider moving it to the `core-utils` package.
136
161
  */
137
162
  export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> {
138
163
  private readonly errorHandler;
@@ -140,6 +165,10 @@ export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEven
140
165
  emit(event: EventEmitterEventType, ...args: unknown[]): boolean;
141
166
  }
142
167
 
168
+ /**
169
+ * String used to concatenate the namespace of parent loggers and their child loggers.
170
+ * @internal
171
+ */
143
172
  export declare const eventNamespaceSeparator: ":";
144
173
 
145
174
  /**
@@ -157,6 +186,8 @@ export declare function extractLogSafeErrorProperties(error: unknown, sanitizeSt
157
186
  * Extracts specific properties from the provided message that we know are safe to log.
158
187
  *
159
188
  * @param messageLike - Message to include info about via telemetry props.
189
+ *
190
+ * @internal
160
191
  */
161
192
  export declare const extractSafePropertiesFromMessage: (messageLike: Partial<Pick<ISequencedDocumentMessage, "clientId" | "sequenceNumber" | "clientSequenceNumber" | "referenceSequenceNumber" | "minimumSequenceNumber" | "timestamp">>) => {
162
193
  messageClientId: string | undefined;
@@ -167,6 +198,9 @@ export declare const extractSafePropertiesFromMessage: (messageLike: Partial<Pic
167
198
  messageTimestamp: number | undefined;
168
199
  };
169
200
 
201
+ /**
202
+ * @internal
203
+ */
170
204
  export declare function formatTick(tick: number): number;
171
205
 
172
206
  /**
@@ -220,15 +254,19 @@ export declare const getCircularReplacer: () => (key: string, value: unknown) =>
220
254
 
221
255
  /**
222
256
  * Type guard for error data containing the {@link IFluidErrorBase.errorInstanceId} property.
257
+ *
258
+ * @internal
223
259
  */
224
260
  export declare const hasErrorInstanceId: (x: unknown) => x is {
225
261
  errorInstanceId: string;
226
262
  };
227
263
 
228
264
  /**
229
- * Explicitly typed interface for reading configurations
265
+ * Explicitly typed interface for reading configurations.
266
+ *
267
+ * @internal
230
268
  */
231
- export declare interface IConfigProvider extends IConfigProviderBase {
269
+ export declare interface IConfigProvider extends IConfigProviderBase_2 {
232
270
  getBoolean(name: string): boolean | undefined;
233
271
  getNumber(name: string): number | undefined;
234
272
  getString(name: string): string | undefined;
@@ -238,7 +276,11 @@ export declare interface IConfigProvider extends IConfigProviderBase {
238
276
  }
239
277
 
240
278
  /**
241
- * Base interface for providing configurations to enable/disable/control features
279
+ * Base interface for providing configurations to enable/disable/control features.
280
+ *
281
+ * @deprecated Use IConfigProviderBase from fluidFramework/core-interfaces
282
+ *
283
+ * @internal
242
284
  */
243
285
  export declare interface IConfigProviderBase {
244
286
  getRawConfig(name: string): ConfigTypes;
@@ -278,6 +320,8 @@ export declare interface IFluidErrorAnnotations {
278
320
  * It features the members of {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
279
321
  * made readonly, as well as {@link IFluidErrorBase.errorType} and {@link IFluidErrorBase.errorInstanceId}.
280
322
  * It also features getters and setters for telemetry props to be included when the error is logged.
323
+ *
324
+ * @internal
281
325
  */
282
326
  export declare interface IFluidErrorBase extends Error {
283
327
  /**
@@ -325,10 +369,15 @@ export declare interface IFluidErrorBase extends Error {
325
369
  }
326
370
 
327
371
  /**
328
- * Describes what events PerformanceEvent should log
329
- * By default, all events are logged, but client can override this behavior
330
- * For example, there is rarely a need to record start event, as we really after
372
+ * Describes what events {@link PerformanceEvent} should log.
373
+ *
374
+ * @remarks
375
+ * By default, all events are logged, but the client can override this behavior.
376
+ *
377
+ * For example, there is rarely a need to record a start event, as we're really after
331
378
  * success / failure tracking, including duration (on success).
379
+ *
380
+ * @internal
332
381
  */
333
382
  export declare interface IPerformanceEventMarkers {
334
383
  start?: true;
@@ -364,21 +413,30 @@ export declare function isExternalError(error: unknown): boolean;
364
413
 
365
414
  /**
366
415
  * Type guard for {@link IFluidErrorBase}.
416
+ *
417
+ * @internal
367
418
  */
368
419
  export declare function isFluidError(error: unknown): error is IFluidErrorBase;
369
420
 
370
421
  /**
371
- * type guard for ILoggingError interface
422
+ * Type-guard for {@link @fluidframework/core-interfaces#ILoggingError}.
423
+ *
424
+ * @internal
372
425
  */
373
426
  export declare const isILoggingError: (x: unknown) => x is ILoggingError;
374
427
 
375
428
  /**
376
- * Type guard to identify if a particular telemetry property appears to be a tagged telemetry property
429
+ * Type guard to identify if a particular telemetry property appears to be a
430
+ * {@link @fluidframework/core-interfaces#Tagged} telemetry property.
431
+ *
432
+ * @internal
377
433
  */
378
434
  export declare function isTaggedTelemetryPropertyValue(x: Tagged<TelemetryEventPropertyTypeExt> | TelemetryEventPropertyTypeExt): x is Tagged<TelemetryEventPropertyTypeExt>;
379
435
 
380
436
  /**
381
437
  * Type guard for old standard of valid/known errors.
438
+ *
439
+ * @internal
382
440
  */
383
441
  export declare function isValidLegacyError(error: unknown): error is Omit<IFluidErrorBase, "errorInstanceId">;
384
442
 
@@ -387,7 +445,8 @@ export declare function isValidLegacyError(error: unknown): error is Omit<IFluid
387
445
  * to mark pieces of information that should be organized or handled differently by loggers in various first or third
388
446
  * party scenarios. For example, tags are used to mark personal information that should not be stored in logs.
389
447
  *
390
- * @deprecated Use Tagged<TelemetryEventPropertyTypeExt>
448
+ * @deprecated Use {@link @fluidframework/core-interfaces#Tagged}\<{@link TelemetryEventPropertyTypeExt}\>
449
+ * @internal
391
450
  */
392
451
  export declare interface ITaggedTelemetryPropertyTypeExt {
393
452
  value: TelemetryEventPropertyTypeExt;
@@ -396,7 +455,9 @@ export declare interface ITaggedTelemetryPropertyTypeExt {
396
455
 
397
456
  /**
398
457
  * Error telemetry event.
399
- * Maps to category = "error"
458
+ * @remarks Maps to category = "error"
459
+ *
460
+ * @internal
400
461
  */
401
462
  export declare interface ITelemetryErrorEventExt extends ITelemetryPropertiesExt {
402
463
  eventName: string;
@@ -404,9 +465,11 @@ export declare interface ITelemetryErrorEventExt extends ITelemetryPropertiesExt
404
465
 
405
466
  /**
406
467
  * Interface for logging telemetry statements.
407
- * Can contain any number of properties that get serialized as json payload.
468
+ * @remarks May contain any number of properties that get serialized as json payload.
408
469
  * @param category - category of the event, like "error", "performance", "generic", etc.
409
470
  * @param eventName - name of the event.
471
+ *
472
+ * @internal
410
473
  */
411
474
  export declare interface ITelemetryEventExt extends ITelemetryPropertiesExt {
412
475
  category: string;
@@ -415,7 +478,9 @@ export declare interface ITelemetryEventExt extends ITelemetryPropertiesExt {
415
478
 
416
479
  /**
417
480
  * Informational (non-error) telemetry event
418
- * Maps to category = "generic"
481
+ * @remarks Maps to category = "generic"
482
+ *
483
+ * @internal
419
484
  */
420
485
  export declare interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
421
486
  eventName: string;
@@ -423,9 +488,13 @@ export declare interface ITelemetryGenericEventExt extends ITelemetryPropertiesE
423
488
  }
424
489
 
425
490
  /**
426
- * An extended TelemetryLogger interface which allows for more lenient event types.
491
+ * An extended {@link @fluidframework/core-interfaces#ITelemetryBaseLogger} which allows for more lenient event types.
492
+ *
493
+ * @remarks
427
494
  * This interface is meant to be used internally within the Fluid Framework,
428
- * and ITelemetryBaseLogger should be used when loggers are passed between layers.
495
+ * and `ITelemetryBaseLogger` should be used when loggers are passed between layers.
496
+ *
497
+ * @internal
429
498
  */
430
499
  export declare interface ITelemetryLoggerExt extends ITelemetryBaseLogger {
431
500
  /**
@@ -450,10 +519,16 @@ export declare interface ITelemetryLoggerExt extends ITelemetryBaseLogger {
450
519
  sendPerformanceEvent(event: ITelemetryPerformanceEventExt, error?: unknown, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
451
520
  }
452
521
 
522
+ /**
523
+ * @internal
524
+ */
453
525
  export declare interface ITelemetryLoggerPropertyBag {
454
526
  [index: string]: TelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes);
455
527
  }
456
528
 
529
+ /**
530
+ * @internal
531
+ */
457
532
  export declare interface ITelemetryLoggerPropertyBags {
458
533
  all?: ITelemetryLoggerPropertyBag;
459
534
  error?: ITelemetryLoggerPropertyBag;
@@ -461,7 +536,9 @@ export declare interface ITelemetryLoggerPropertyBags {
461
536
 
462
537
  /**
463
538
  * Performance telemetry event.
464
- * Maps to category = "performance"
539
+ * @remarks Maps to category = "performance"
540
+ *
541
+ * @internal
465
542
  */
466
543
  export declare interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt {
467
544
  duration?: number;
@@ -469,11 +546,18 @@ export declare interface ITelemetryPerformanceEventExt extends ITelemetryGeneric
469
546
 
470
547
  /**
471
548
  * JSON-serializable properties, which will be logged with telemetry.
549
+ *
550
+ * @internal
472
551
  */
473
552
  export declare interface ITelemetryPropertiesExt {
474
553
  [index: string]: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>;
475
554
  }
476
555
 
556
+ /**
557
+ * Creates a {@link MonitoringContext} from the provided logger, if it isn't already one.
558
+ *
559
+ * @internal
560
+ */
477
561
  export declare function loggerToMonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt>(logger: L): MonitoringContext<L>;
478
562
 
479
563
  /**
@@ -523,14 +607,33 @@ export declare class LoggingError extends Error implements ILoggingError, Omit<I
523
607
  * @param logger - The logger to log with
524
608
  * @param event - The string or event to log
525
609
  * @returns The outcome of the condition
610
+ *
611
+ * @internal
612
+ *
613
+ * @deprecated
614
+ * This API will be removed in a future release.
615
+ * No replacement API is intended, but reproducing its behavior should be trivial for anyone who needs it.
526
616
  */
527
617
  export declare function logIfFalse(condition: unknown, logger: ITelemetryBaseLogger, event: string | ITelemetryGenericEvent): condition is true;
528
618
 
529
- export declare function mixinMonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt>(logger: L, ...configs: (IConfigProviderBase | undefined)[]): MonitoringContext<L>;
619
+ /**
620
+ * Creates a {@link MonitoringContext} from the provided logger.
621
+ *
622
+ * @remarks
623
+ * Assumes that the provided logger is not itself already a {@link MonitoringContext}, and will throw an error if it is.
624
+ * If you are unsure, use {@link loggerToMonitoringContext} instead.
625
+ *
626
+ * @throws If the provided logger is already a {@link MonitoringContext}.
627
+ *
628
+ * @internal
629
+ */
630
+ export declare function mixinMonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt>(logger: L, ...configs: (IConfigProviderBase_2 | undefined)[]): MonitoringContext<L>;
530
631
 
531
632
  /**
532
633
  * The MockLogger records events sent to it, and then can walk back over those events
533
634
  * searching for a set of expected events to match against the logged events.
635
+ *
636
+ * @internal
534
637
  */
535
638
  export declare class MockLogger implements ITelemetryBaseLogger {
536
639
  readonly minLogLevel?: LogLevel | undefined;
@@ -591,13 +694,39 @@ export declare class MockLogger implements ITelemetryBaseLogger {
591
694
  }
592
695
 
593
696
  /**
594
- * A type containing both a telemetry logger and a configuration provider
697
+ * A type containing both a telemetry logger and a configuration provider.
698
+ *
699
+ * @internal
595
700
  */
596
701
  export declare interface MonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt> {
597
702
  config: IConfigProvider;
598
703
  logger: L;
599
704
  }
600
705
 
706
+ /**
707
+ * Input properties for {@link createMultiSinkLogger}.
708
+ *
709
+ * @internal
710
+ */
711
+ export declare interface MultiSinkLoggerProperties {
712
+ /**
713
+ * Will be prefixed to all event names.
714
+ */
715
+ namespace?: string;
716
+ /**
717
+ * Default properties that will be applied to all events flowing through this logger.
718
+ */
719
+ properties?: ITelemetryLoggerPropertyBags;
720
+ /**
721
+ * The base loggers that this logger will forward the logs to, after it processes them.
722
+ */
723
+ loggers?: (ITelemetryBaseLogger | undefined)[];
724
+ /**
725
+ * 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.
726
+ */
727
+ tryInheritProperties?: true;
728
+ }
729
+
601
730
  /**
602
731
  * The Error class used when normalizing an external error
603
732
  *
@@ -617,9 +746,13 @@ export declare function normalizeError(error: unknown, annotations?: IFluidError
617
746
 
618
747
  /**
619
748
  * Attempts to parse number from string.
620
- * If fails,returns original string.
749
+ * If it fails, it will return the original string.
750
+ *
751
+ * @remarks
621
752
  * Used to make telemetry data typed (and support math operations, like comparison),
622
- * in places where we do expect numbers (like contentsize/duration property in http header)
753
+ * in places where we do expect numbers (like contentsize/duration property in http header).
754
+ *
755
+ * @internal
623
756
  */
624
757
  export declare function numberFromString(str: string | null | undefined): string | number | undefined;
625
758
 
@@ -634,7 +767,9 @@ export declare function numberFromString(str: string | null | undefined): string
634
767
  export declare function overwriteStack(error: IFluidErrorBase | LoggingError, stack: string): void;
635
768
 
636
769
  /**
637
- * Helper class to log performance events
770
+ * Helper class to log performance events.
771
+ *
772
+ * @internal
638
773
  */
639
774
  export declare class PerformanceEvent {
640
775
  private readonly logger;
@@ -711,17 +846,26 @@ export declare class PerformanceEvent {
711
846
  * @param connected - A boolean tracking whether the connection was in a connected state or not
712
847
  * @param clientId - The connected/disconnected clientId
713
848
  * @param disconnectedReason - The reason for the connection to be disconnected (Used for telemetry purposes only)
849
+ *
850
+ * @internal
714
851
  */
715
852
  export declare function raiseConnectedEvent(logger: ITelemetryLoggerExt, emitter: EventEmitter, connected: boolean, clientId?: string, disconnectedReason?: string): void;
716
853
 
854
+ /**
855
+ * @internal
856
+ */
717
857
  export declare function safeRaiseEvent(emitter: EventEmitter, logger: ITelemetryLoggerExt, event: string, ...args: unknown[]): void;
718
858
 
719
859
  /**
720
860
  * Helper class that executes a specified code block and writes an
721
861
  * {@link @fluidframework/core-interfaces#ITelemetryPerformanceEvent} to a specified logger every time a specified
722
- * number of executions is reached (or when the class is disposed). The `duration` field in the telemetry event is
723
- * the duration of the latest execution (sample) of the specified function. See the documentation of the
724
- * `includeAggregateMetrics` parameter for additional details that can be included.
862
+ * number of executions is reached (or when the class is disposed).
863
+ *
864
+ * The `duration` field in the telemetry event is the duration of the latest execution (sample) of the specified
865
+ * function. See the documentation of the `includeAggregateMetrics` parameter for additional details that can be
866
+ * included.
867
+ *
868
+ * @internal
725
869
  */
726
870
  export declare class SampledTelemetryHelper implements IDisposable {
727
871
  private readonly eventBase;
@@ -769,12 +913,33 @@ export declare class SampledTelemetryHelper implements IDisposable {
769
913
  * Creates a base configuration provider based on `sessionStorage`
770
914
  *
771
915
  * @returns A lazy initialized base configuration provider with `sessionStorage` as the underlying config store
916
+ *
917
+ * @internal
772
918
  */
773
- export declare const sessionStorageConfigProvider: Lazy<IConfigProviderBase>;
919
+ export declare const sessionStorageConfigProvider: Lazy<IConfigProviderBase_2>;
774
920
 
775
921
  /**
776
- * Helper function to tag telemetry properties as CodeArtifacts. It supports properties of type
777
- * TelemetryBaseEventPropertyType as well as getters that return TelemetryBaseEventPropertyType.
922
+ * Tags all provided `values` as {@link TelemetryDataTag.CodeArtifact}.
923
+ *
924
+ * @param values - The values to be tagged.
925
+ *
926
+ * @remarks
927
+ * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},
928
+ * as well as callbacks that return that type.
929
+ *
930
+ * @example Sample usage
931
+ * ```typescript
932
+ * {
933
+ * // ...Other properties being added to a telemetry event
934
+ * ...tagCodeArtifacts("someTag", {foo: 1, bar: 2}),
935
+ * // ...
936
+ * }
937
+ * ```
938
+ * This will result in `foo` and `bar` added to the event with their values tagged as {@link TelemetryDataTag.CodeArtifact}.
939
+ *
940
+ * @see {@link tagData}
941
+ *
942
+ * @internal
778
943
  */
779
944
  export declare const tagCodeArtifacts: <T extends Record<string, TelemetryEventPropertyType | (() => TelemetryBaseEventPropertyType)>>(values: T) => { [P in keyof T]: (T[P] extends () => TelemetryBaseEventPropertyType ? () => {
780
945
  value: ReturnType<T[P]>;
@@ -784,6 +949,28 @@ export declare const tagCodeArtifacts: <T extends Record<string, TelemetryEventP
784
949
  tag: TelemetryDataTag.CodeArtifact;
785
950
  }) | (T[P] extends undefined ? undefined : never); };
786
951
 
952
+ /**
953
+ * Tags all given `values` with the same `tag`.
954
+ *
955
+ * @param tag - The tag with which all `values` will be annotated.
956
+ * @param values - The values to be tagged.
957
+ *
958
+ * @remarks
959
+ * It supports properties of type {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType},
960
+ * as well as callbacks that return that type.
961
+ *
962
+ * @example Sample usage
963
+ * ```typescript
964
+ * {
965
+ * // ...Other properties being added to a telemetry event
966
+ * ...tagData("someTag", {foo: 1, bar: 2}),
967
+ * // ...
968
+ * }
969
+ * ```
970
+ * This will result in `foo` and `bar` added to the event with their values tagged.
971
+ *
972
+ * @internal
973
+ */
787
974
  export declare const tagData: <T extends TelemetryDataTag, V extends Record<string, TelemetryEventPropertyType | (() => TelemetryBaseEventPropertyType)>>(tag: T, values: V) => { [P in keyof V]: (V[P] extends () => TelemetryBaseEventPropertyType ? () => {
788
975
  value: ReturnType<V[P]>;
789
976
  tag: T;
@@ -796,6 +983,8 @@ export declare const tagData: <T extends TelemetryDataTag, V extends Record<stri
796
983
  * @deprecated 0.56, remove TaggedLoggerAdapter once its usage is removed from
797
984
  * container-runtime. Issue: #8191
798
985
  * TaggedLoggerAdapter class can add tag handling to your logger.
986
+ *
987
+ * @internal
799
988
  */
800
989
  export declare class TaggedLoggerAdapter implements ITelemetryBaseLogger {
801
990
  private readonly logger;
@@ -808,7 +997,10 @@ export declare class TaggedLoggerAdapter implements ITelemetryBaseLogger {
808
997
 
809
998
  /**
810
999
  * Broad classifications to be applied to individual properties as they're prepared to be logged to telemetry.
811
- * Please do not modify existing entries for backwards compatibility.
1000
+ *
1001
+ * @privateRemarks Please do not modify existing entries, to maintain backwards compatibility.
1002
+ *
1003
+ * @internal
812
1004
  */
813
1005
  export declare enum TelemetryDataTag {
814
1006
  /**
@@ -825,28 +1017,43 @@ export declare enum TelemetryDataTag {
825
1017
  * The categories FF uses when instrumenting the code.
826
1018
  *
827
1019
  * generic - Informational log event
1020
+ *
828
1021
  * error - Error log event, ideally 0 of these are logged during a session
1022
+ *
829
1023
  * performance - Includes duration, and often has _start, _end, or _cancel suffixes for activity tracking
1024
+ *
1025
+ * @internal
830
1026
  */
831
1027
  export declare type TelemetryEventCategory = "generic" | "error" | "performance";
832
1028
 
833
1029
  /**
834
1030
  * Property types that can be logged.
835
- * Includes extra types beyond TelemetryBaseEventPropertyType, which must be converted before sending to a base logger
1031
+ *
1032
+ * @remarks
1033
+ * Includes extra types beyond {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType}, which must be
1034
+ * converted before sending to a base logger.
1035
+ *
1036
+ * @internal
836
1037
  */
837
1038
  export declare type TelemetryEventPropertyTypeExt = string | number | boolean | undefined | (string | number | boolean)[] | {
838
1039
  [key: string]: // Flat objects can have the same properties as the event itself
839
1040
  string | number | boolean | undefined | (string | number | boolean)[];
840
1041
  };
841
1042
 
1043
+ /**
1044
+ * @internal
1045
+ */
842
1046
  export declare type TelemetryEventPropertyTypes = ITelemetryBaseProperties[string];
843
1047
 
844
1048
  /**
845
1049
  * Null logger that no-ops for all telemetry events passed to it.
1050
+ *
846
1051
  * @deprecated This will be removed in a future release.
847
1052
  * For internal use within the FluidFramework codebase, use {@link createChildLogger} with no arguments instead.
848
1053
  * For external consumers we recommend writing a trivial implementation of {@link @fluidframework/core-interfaces#ITelemetryBaseLogger}
849
1054
  * where the send() method does nothing and using that.
1055
+ *
1056
+ * @internal
850
1057
  */
851
1058
  export declare class TelemetryNullLogger implements ITelemetryLoggerExt {
852
1059
  send(event: ITelemetryBaseEvent): void;
@@ -856,8 +1063,9 @@ export declare class TelemetryNullLogger implements ITelemetryLoggerExt {
856
1063
  }
857
1064
 
858
1065
  /**
859
- * Utility counter which will send event only if the provided value
860
- * is above a configured threshold
1066
+ * Utility counter which will send event only if the provided value is above a configured threshold.
1067
+ *
1068
+ * @internal
861
1069
  */
862
1070
  export declare class ThresholdCounter {
863
1071
  private readonly threshold;
@@ -7,13 +7,22 @@ import { ITelemetryBaseLogger, LogLevel, Tagged } from "@fluidframework/core-int
7
7
  * The categories FF uses when instrumenting the code.
8
8
  *
9
9
  * generic - Informational log event
10
+ *
10
11
  * error - Error log event, ideally 0 of these are logged during a session
12
+ *
11
13
  * performance - Includes duration, and often has _start, _end, or _cancel suffixes for activity tracking
14
+ *
15
+ * @internal
12
16
  */
13
17
  export type TelemetryEventCategory = "generic" | "error" | "performance";
14
18
  /**
15
19
  * Property types that can be logged.
16
- * Includes extra types beyond TelemetryBaseEventPropertyType, which must be converted before sending to a base logger
20
+ *
21
+ * @remarks
22
+ * Includes extra types beyond {@link @fluidframework/core-interfaces#TelemetryBaseEventPropertyType}, which must be
23
+ * converted before sending to a base logger.
24
+ *
25
+ * @internal
17
26
  */
18
27
  export type TelemetryEventPropertyTypeExt = string | number | boolean | undefined | (string | number | boolean)[] | {
19
28
  [key: string]: // Flat objects can have the same properties as the event itself
@@ -24,7 +33,8 @@ export type TelemetryEventPropertyTypeExt = string | number | boolean | undefine
24
33
  * to mark pieces of information that should be organized or handled differently by loggers in various first or third
25
34
  * party scenarios. For example, tags are used to mark personal information that should not be stored in logs.
26
35
  *
27
- * @deprecated Use Tagged<TelemetryEventPropertyTypeExt>
36
+ * @deprecated Use {@link @fluidframework/core-interfaces#Tagged}\<{@link TelemetryEventPropertyTypeExt}\>
37
+ * @internal
28
38
  */
29
39
  export interface ITaggedTelemetryPropertyTypeExt {
30
40
  value: TelemetryEventPropertyTypeExt;
@@ -32,15 +42,19 @@ export interface ITaggedTelemetryPropertyTypeExt {
32
42
  }
33
43
  /**
34
44
  * JSON-serializable properties, which will be logged with telemetry.
45
+ *
46
+ * @internal
35
47
  */
36
48
  export interface ITelemetryPropertiesExt {
37
49
  [index: string]: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>;
38
50
  }
39
51
  /**
40
52
  * Interface for logging telemetry statements.
41
- * Can contain any number of properties that get serialized as json payload.
53
+ * @remarks May contain any number of properties that get serialized as json payload.
42
54
  * @param category - category of the event, like "error", "performance", "generic", etc.
43
55
  * @param eventName - name of the event.
56
+ *
57
+ * @internal
44
58
  */
45
59
  export interface ITelemetryEventExt extends ITelemetryPropertiesExt {
46
60
  category: string;
@@ -48,7 +62,9 @@ export interface ITelemetryEventExt extends ITelemetryPropertiesExt {
48
62
  }
49
63
  /**
50
64
  * Informational (non-error) telemetry event
51
- * Maps to category = "generic"
65
+ * @remarks Maps to category = "generic"
66
+ *
67
+ * @internal
52
68
  */
53
69
  export interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
54
70
  eventName: string;
@@ -56,22 +72,30 @@ export interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
56
72
  }
57
73
  /**
58
74
  * Error telemetry event.
59
- * Maps to category = "error"
75
+ * @remarks Maps to category = "error"
76
+ *
77
+ * @internal
60
78
  */
61
79
  export interface ITelemetryErrorEventExt extends ITelemetryPropertiesExt {
62
80
  eventName: string;
63
81
  }
64
82
  /**
65
83
  * Performance telemetry event.
66
- * Maps to category = "performance"
84
+ * @remarks Maps to category = "performance"
85
+ *
86
+ * @internal
67
87
  */
68
88
  export interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt {
69
89
  duration?: number;
70
90
  }
71
91
  /**
72
- * An extended TelemetryLogger interface which allows for more lenient event types.
92
+ * An extended {@link @fluidframework/core-interfaces#ITelemetryBaseLogger} which allows for more lenient event types.
93
+ *
94
+ * @remarks
73
95
  * This interface is meant to be used internally within the Fluid Framework,
74
- * and ITelemetryBaseLogger should be used when loggers are passed between layers.
96
+ * and `ITelemetryBaseLogger` should be used when loggers are passed between layers.
97
+ *
98
+ * @internal
75
99
  */
76
100
  export interface ITelemetryLoggerExt extends ITelemetryBaseLogger {
77
101
  /**