Skip to content

Commit

Permalink
Merge branch 'main' into get-visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-achard-MS committed Sep 5, 2023
2 parents 338bfcf + 0bde699 commit 66128ad
Show file tree
Hide file tree
Showing 734 changed files with 3,215 additions and 9,421 deletions.
28 changes: 28 additions & 0 deletions .changeset/shiny-ties-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"@fluidframework/core-interfaces": minor
"@fluidframework/telemetry-utils": minor
---

Cleaning up duplicate or misnamed telemetry types

We have two sets of telemetry-related interfaces:

- The "Base" ones
- These have a very bare API surface
- They are used on public API surfaces to transmit logs across layers
- The internal ones
- These have a richer API surface (multiple log functions with different categories,
support for logging flat arrays and objects)
- They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface

There are two problems with the given state of the world:

1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.

This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.

Additionally, the following types were adjusted:

- `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
- Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
26 changes: 13 additions & 13 deletions PACKAGES.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api-report/agent-scheduler.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
import { IFluidLoadable } from '@fluidframework/core-interfaces';
import { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public (undocumented)
export class AgentSchedulerFactory implements IFluidDataStoreFactory {
Expand Down
2 changes: 1 addition & 1 deletion api-report/aqueduct.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { AsyncFluidObjectProvider } from '@fluidframework/synthesize';
import { ContainerRuntime } from '@fluidframework/container-runtime';
import type { EventEmitter } from 'events';
import { EventForwarder } from '@fluidframework/common-utils';
import { EventForwarder } from '@fluid-internal/client-utils';
import { FluidDataStoreRuntime } from '@fluidframework/datastore';
import { FluidObject } from '@fluidframework/core-interfaces';
import { FluidObjectSymbolProvider } from '@fluidframework/synthesize';
Expand Down
2 changes: 1 addition & 1 deletion api-report/container-runtime.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
import { MessageType } from '@fluidframework/protocol-definitions';
import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
import { StableId } from '@fluidframework/runtime-definitions';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public
export const agentSchedulerId = "_scheduler";
Expand Down
2 changes: 1 addition & 1 deletion api-report/container-utils.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { DataCorruptionError } from '@fluidframework/telemetry-utils';
import { DataProcessingError } from '@fluidframework/telemetry-utils';
import { EventForwarder } from '@fluidframework/common-utils';
import { EventForwarder } from '@fluid-internal/client-utils';
import { extractSafePropertiesFromMessage } from '@fluidframework/telemetry-utils';
import { GenericError } from '@fluidframework/telemetry-utils';
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
Expand Down
54 changes: 34 additions & 20 deletions api-report/core-interfaces.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface IDisposable {
// @public
export interface IErrorBase extends Partial<Error> {
readonly errorType: string;
getTelemetryProperties?(): ITelemetryProperties;
getTelemetryProperties?(): ITelemetryBaseProperties;
readonly message: string;
readonly name?: string;
readonly stack?: string;
Expand Down Expand Up @@ -326,7 +326,7 @@ export interface IGenericError extends IErrorBase {

// @public
export interface ILoggingError extends Error {
getTelemetryProperties(): ITelemetryProperties;
getTelemetryProperties(): ITelemetryBaseProperties;
}

// @public @deprecated (undocumented)
Expand Down Expand Up @@ -401,7 +401,7 @@ export const isFluidCodeDetails: (details: unknown) => details is Readonly<IFlui
// @public @deprecated
export const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;

// @public
// @public @deprecated (undocumented)
export interface ITaggedTelemetryPropertyType {
// (undocumented)
tag: string;
Expand All @@ -410,7 +410,7 @@ export interface ITaggedTelemetryPropertyType {
}

// @public
export interface ITelemetryBaseEvent extends ITelemetryProperties {
export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
// (undocumented)
category: string;
// (undocumented)
Expand All @@ -426,37 +426,40 @@ export interface ITelemetryBaseLogger {
}

// @public
export type ITelemetryBaseProperties = ITelemetryProperties;

// @public @deprecated
export interface ITelemetryErrorEvent extends ITelemetryProperties {
// (undocumented)
eventName: string;
}

// @public
// @public @deprecated
export interface ITelemetryGenericEvent extends ITelemetryProperties {
// (undocumented)
category?: TelemetryEventCategory;
// (undocumented)
eventName: string;
}

// @public
// @public @deprecated
export interface ITelemetryLogger extends ITelemetryBaseLogger {
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
sendErrorEvent(event: ITelemetryErrorEvent, error?: any): void;
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
}

// @public
// @public @deprecated
export interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
// (undocumented)
duration?: number;
}

// @public
// @public @deprecated
export interface ITelemetryProperties {
// (undocumented)
[index: string]: TelemetryEventPropertyType | ITaggedTelemetryPropertyType;
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
}

// @public
Expand All @@ -472,24 +475,35 @@ export interface IUsageError extends IErrorBase {
}

// @public
export const enum LogLevel {
// (undocumented)
default = 10,
// (undocumented)
error = 20,
// (undocumented)
verbose = 0
}
export const LogLevel: {
readonly verbose: 10;
readonly default: 20;
readonly error: 30;
};

// @public
export type LogLevel = typeof LogLevel[keyof typeof LogLevel];

// @public
export type ReplaceIEventThisPlaceHolder<L extends any[], TThis> = L extends any[] ? {
[K in keyof L]: L[K] extends IEventThisPlaceHolder ? TThis : L[K];
} : L;

// @public
export type TelemetryEventCategory = "generic" | "error" | "performance";
export interface Tagged<V, T extends string = string> {
// (undocumented)
tag: T;
// (undocumented)
value: V;
}

// @public
export type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;

// @public @deprecated
export type TelemetryEventCategory = "generic" | "error" | "performance";

// @public @deprecated
export type TelemetryEventPropertyType = string | number | boolean | undefined;

// @public
Expand Down
2 changes: 1 addition & 1 deletion api-report/data-object-base.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```ts

import { ContainerRuntime } from '@fluidframework/container-runtime';
import { EventForwarder } from '@fluidframework/common-utils';
import { EventForwarder } from '@fluid-internal/client-utils';
import { FluidDataStoreRuntime } from '@fluidframework/datastore';
import { FluidObject } from '@fluidframework/core-interfaces';
import { IChannelFactory } from '@fluidframework/datastore-definitions';
Expand Down
2 changes: 1 addition & 1 deletion api-report/datastore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions'
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';
import { VisibilityState as VisibilityState_2 } from '@fluidframework/runtime-definitions';

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion api-report/debugger.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
```ts

import { Deferred } from '@fluidframework/common-utils';
import { Deferred } from '@fluidframework/core-utils';
import { IDocumentService } from '@fluidframework/driver-definitions';
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
Expand Down
2 changes: 1 addition & 1 deletion api-report/experimental-tree.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
import { ITelemetryProperties } from '@fluidframework/core-interfaces';
import type { Serializable } from '@fluidframework/datastore-definitions';
import { SharedObject } from '@fluidframework/shared-object-base';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public
export function areRevisionViewsSemanticallyEqual(treeViewA: TreeView, idConverterA: NodeIdConverter, treeViewB: TreeView, idConverterB: NodeIdConverter): boolean;
Expand Down
2 changes: 1 addition & 1 deletion api-report/file-driver.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ISummaryTree } from '@fluidframework/protocol-definitions';
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
import { ITokenClaims } from '@fluidframework/protocol-definitions';
import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public
export class FileDeltaStorageService implements IDocumentDeltaStorageService {
Expand Down
2 changes: 1 addition & 1 deletion api-report/fluid-static.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IEvent } from '@fluidframework/core-interfaces';
import { IEventProvider } from '@fluidframework/core-interfaces';
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
import { IFluidLoadable } from '@fluidframework/core-interfaces';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public
export interface ContainerSchema {
Expand Down
2 changes: 1 addition & 1 deletion api-report/merge-tree.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IFluidSerializer } from '@fluidframework/shared-object-base';
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public (undocumented)
export function addProperties(oldProps: PropertySet | undefined, newProps: PropertySet, op?: ICombiningOp, seq?: number): PropertySet;
Expand Down
2 changes: 1 addition & 1 deletion api-report/oldest-client-observer.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AttachState } from '@fluidframework/container-definitions';
import { IEvent } from '@fluidframework/core-interfaces';
import { IEventProvider } from '@fluidframework/core-interfaces';
import { IQuorumClients } from '@fluidframework/protocol-definitions';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @public
export interface IOldestClientObservable extends IEventProvider<IOldestClientObservableEvents> {
Expand Down
4 changes: 2 additions & 2 deletions api-report/sequence.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { BaseSegment } from '@fluidframework/merge-tree';
import { Client } from '@fluidframework/merge-tree';
import { Deferred } from '@fluidframework/common-utils';
import { Deferred } from '@fluidframework/core-utils';
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
import { IChannelFactory } from '@fluidframework/datastore-definitions';
import { IChannelServices } from '@fluidframework/datastore-definitions';
Expand Down Expand Up @@ -48,7 +48,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
import { SlidingPreference } from '@fluidframework/merge-tree';
import { SummarySerializer } from '@fluidframework/shared-object-base';
import { TextSegment } from '@fluidframework/merge-tree';
import { TypedEventEmitter } from '@fluidframework/common-utils';
import { TypedEventEmitter } from '@fluid-internal/client-utils';

// @alpha
export function appendAddIntervalToRevertibles(interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
Expand Down
2 changes: 1 addition & 1 deletion api-report/shared-object-base.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```ts

import { EventEmitterEventType } from '@fluidframework/common-utils';
import { EventEmitterEventType } from '@fluid-internal/client-utils';
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
import { IChannel } from '@fluidframework/datastore-definitions';
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
Expand Down
Loading

0 comments on commit 66128ad

Please sign in to comment.