Skip to content

Commit 67cc6cb

Browse files
jsonbaileyclaude
andcommitted
chore: correct trackDuration event key to $ld:ai:graph:duration:total
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34938a2 commit 67cc6cb

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/sdk/server-ai/__tests__/LDGraphTrackerImpl.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ it('trackDuration sets durationMs and emits event', () => {
173173
tracker.trackDuration(1234);
174174
expect(tracker.getSummary().durationMs).toBe(1234);
175175
expect(mockTrack).toHaveBeenCalledWith(
176-
'$ld:ai:duration:total',
176+
'$ld:ai:graph:duration:total',
177177
testContext,
178178
tracker.getTrackData(),
179179
1234,

packages/sdk/server-ai/src/LDGraphTrackerImpl.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ export class LDGraphTrackerImpl implements LDGraphTracker {
112112
return;
113113
}
114114
this._summary.durationMs = durationMs;
115-
this._ldClient.track('$ld:ai:duration:total', this._context, this.getTrackData(), durationMs);
115+
this._ldClient.track(
116+
'$ld:ai:graph:duration:total',
117+
this._context,
118+
this.getTrackData(),
119+
durationMs,
120+
);
116121
}
117122

118123
trackTotalTokens(tokens: LDTokenUsage): void {

packages/sdk/server-ai/src/api/graph/LDGraphTracker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface LDGraphTracker {
6363

6464
/**
6565
* Tracks the total duration of the graph execution in milliseconds.
66-
* Emits event `$ld:ai:duration:total` with the duration as the metric value.
66+
* Emits event `$ld:ai:graph:duration:total` with the duration as the metric value.
6767
* At-most-once: subsequent calls are dropped with a warning.
6868
*
6969
* @param durationMs Duration in milliseconds.

0 commit comments

Comments
 (0)