Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
472 changes: 242 additions & 230 deletions packages/drivers/odsp-driver/src/fetchSnapshot.ts

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions packages/drivers/odsp-driver/src/odspDelayLoadedDeltaStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { performanceNow } from "@fluid-internal/client-utils";
import type { ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import { assert } from "@fluidframework/core-utils/internal";
import type { IClient } from "@fluidframework/driver-definitions";
import type {
Expand Down Expand Up @@ -158,12 +159,16 @@ export class OdspDelayLoadedDeltaStream {

// Log telemetry for join session attempt
if (this.firstConnectionAttempt) {
this.mc.logger.sendTelemetryEvent({
eventName: "FirstJoinSessionAttemptDetails",
details: {
requestWebsocketToken: requestWebsocketTokenFromJoinSession,
this.mc.logger.sendTelemetryEvent(
{
eventName: "FirstJoinSessionAttemptDetails",
details: {
requestWebsocketToken: requestWebsocketTokenFromJoinSession,
},
},
});
undefined, // error
LogLevel.info,
);
}

const joinSessionPromise = this.joinSession(
Expand Down
3 changes: 3 additions & 0 deletions packages/drivers/odsp-driver/src/odspDeltaStorageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export class OdspDeltaStorageService {
// This may change in the future, if so, we need to adjust and receive "end" value from server in such case.
return { messages, partialResult: false };
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
});
}
Expand Down
13 changes: 9 additions & 4 deletions packages/drivers/odsp-driver/src/odspDocumentDeltaConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { TypedEventEmitter, performanceNow } from "@fluid-internal/client-utils";
import type { IEvent } from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces";
import { assert, Deferred } from "@fluidframework/core-utils/internal";
import { DocumentDeltaConnection } from "@fluidframework/driver-base/internal";
import type { IClient } from "@fluidframework/driver-definitions";
Expand Down Expand Up @@ -651,10 +652,14 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
.catch((error) => this.connectionInitializeDeferredP?.reject(error));

await this.connectionInitializeDeferredP.promise.finally(() => {
this.logger.sendTelemetryEvent({
eventName: "ConnectionAttemptInfo",
...this.getConnectionDetailsProps(),
});
this.logger.sendTelemetryEvent(
{
eventName: "ConnectionAttemptInfo",
...this.getConnectionDetailsProps(),
},
undefined, // error
LogLevel.info,
);
});
}

Expand Down
7 changes: 6 additions & 1 deletion packages/drivers/odsp-driver/src/odspDocumentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { TypedEventEmitter } from "@fluid-internal/client-utils";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import { assert } from "@fluidframework/core-utils/internal";
import type { IClient } from "@fluidframework/driver-definitions";
import type {
Expand Down Expand Up @@ -277,7 +278,11 @@ export class OdspDocumentService
/* webpackChunkName: "socketModule" */ "./odspDelayLoadedDeltaStream.js"
)
.then((m) => {
this.mc.logger.sendTelemetryEvent({ eventName: "SocketModuleLoaded" });
this.mc.logger.sendTelemetryEvent(
{ eventName: "SocketModuleLoaded" },
undefined, // error
LogLevel.info,
);
return m;
})
.catch((error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
}
return res.content;
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
});
this.blobCache.setBlob(blobId, blob);
Expand Down Expand Up @@ -442,6 +445,9 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
});
return retrievedSnapshot;
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);

const stTime = performanceNow();
Expand Down
3 changes: 3 additions & 0 deletions packages/drivers/odsp-driver/src/odspUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
ITelemetryBaseLogger,
ITelemetryBaseProperties,
} from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import { assert } from "@fluidframework/core-utils/internal";
import type {
IResolvedUrl,
Expand Down Expand Up @@ -457,6 +458,8 @@ export function toInstrumentedOdspTokenFetcher(
},
),
{ cancel: "generic" },
undefined, // sampleThreshold
LogLevel.info,
);
};
}
Expand Down
4 changes: 4 additions & 0 deletions packages/drivers/odsp-driver/src/vroom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import type { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import type {
IOdspUrlParts,
ISocketStorageDiscovery,
Expand Down Expand Up @@ -141,6 +142,9 @@ export const fetchJoinSession = mockify(

return response.content;
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
},
);
6 changes: 6 additions & 0 deletions packages/loader/container-loader/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,11 +1717,17 @@ export class Container
this.mc.logger,
{ eventName: "WaitOps" },
async () => opsBeforeReturnP,
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
await PerformanceEvent.timedExecAsync(
this.mc.logger,
{ eventName: "WaitOpProcessing" },
async () => this._deltaManager.inbound.waitTillProcessingDone(),
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);

// eslint-disable-next-line @typescript-eslint/no-floating-promises
Expand Down
20 changes: 14 additions & 6 deletions packages/loader/container-loader/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
IRequest,
ITelemetryBaseLogger,
} from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import type { IClientDetails } from "@fluidframework/driver-definitions";
import type {
IDocumentServiceFactory,
Expand Down Expand Up @@ -312,12 +313,19 @@ export class Loader implements IHostLoader {

public async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {
const eventName = pendingLocalState === undefined ? "Resolve" : "ResolveWithPendingState";
return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName }, async () => {
return this.resolveCore(
request,
getAttachedContainerStateFromSerializedContainer(pendingLocalState),
);
});
return PerformanceEvent.timedExecAsync(
this.mc.logger,
{ eventName },
async () => {
return this.resolveCore(
request,
getAttachedContainerStateFromSerializedContainer(pendingLocalState),
);
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
}

private async resolveCore(
Expand Down
23 changes: 14 additions & 9 deletions packages/runtime/container-runtime/src/channelCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
IFluidHandleInternal,
ISignalEnvelope,
} from "@fluidframework/core-interfaces/internal";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils/internal";
import { FluidObjectHandle } from "@fluidframework/datastore/internal";
import type {
Expand Down Expand Up @@ -469,16 +470,20 @@ export class ChannelCollection
// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
if (this.shouldSendAttachLog) {
this.shouldSendAttachLog = false;
this.mc.logger.sendTelemetryEvent({
eventName: "dataStoreAttachMessage_sampled",
...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),
details: {
local,
snapshot: !!attachMessage.snapshot,
foundGCData,
this.mc.logger.sendTelemetryEvent(
{
eventName: "dataStoreAttachMessage_sampled",
...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),
details: {
local,
snapshot: !!attachMessage.snapshot,
foundGCData,
},
...extractSafePropertiesFromMessage(envelope),
},
...extractSafePropertiesFromMessage(envelope),
});
undefined, // error
LogLevel.info,
);
}

// The local object has already been attached
Expand Down
27 changes: 16 additions & 11 deletions packages/runtime/container-runtime/src/deltaScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { performanceNow, type TypedEventEmitter } from "@fluid-internal/client-utils";
import type { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
import type { IContainerRuntimeBaseEvents } from "@fluidframework/runtime-definitions/internal";
import {
Expand Down Expand Up @@ -149,17 +150,21 @@ export class DeltaScheduler {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;

this.logger.sendTelemetryEvent({
eventName: "InboundOpsProcessingTime",
opsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,
numberOfTurns: this.schedulingLog.numberOfTurns,
processingTime: formatTick(this.schedulingLog.totalProcessingTime),
opsProcessed:
this.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,
batchesProcessed: this.schedulingLog.numberOfBatchesProcessed,
duration: formatTick(currentTime - this.schedulingLog.startTime),
schedulingCount: this.schedulingCount,
});
this.logger.sendTelemetryEvent(
{
eventName: "InboundOpsProcessingTime",
opsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,
numberOfTurns: this.schedulingLog.numberOfTurns,
processingTime: formatTick(this.schedulingLog.totalProcessingTime),
opsProcessed:
this.schedulingLog.lastSequenceNumber - this.schedulingLog.firstSequenceNumber + 1,
batchesProcessed: this.schedulingLog.numberOfBatchesProcessed,
duration: formatTick(currentTime - this.schedulingLog.startTime),
schedulingCount: this.schedulingCount,
},
undefined, // error
LogLevel.info,
);

this.schedulingLog = undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import type { ICriticalContainerError } from "@fluidframework/container-definitions";
import type { IRequest } from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces/internal";
import { assert, LazyPromise, Timer } from "@fluidframework/core-utils/internal";
import type { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
import {
Expand Down Expand Up @@ -448,6 +449,9 @@ export class GarbageCollector implements IGarbageCollector {
details: { initialized, unrefNodeCount: this.unreferencedNodesState.size },
});
},
undefined, // markers
undefined, // sampleThreshold
LogLevel.info,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
import { LogLevel } from "@fluidframework/core-interfaces";
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
import { SummaryType } from "@fluidframework/driver-definitions";
import type {
Expand Down Expand Up @@ -441,6 +442,8 @@ export class SummarizerNode implements IRootSummarizerNode {
return { isSummaryTracked, isSummaryNewer };
},
{ start: true, end: true, cancel: "error" },
undefined, // sampleThreshold
LogLevel.info,
);
}
/**
Expand Down
Loading