Readonly resumptionA URL-safe Base64-encoded (RFC 4648, no padding) token encoding the tracker's identity. Pass this token to LDGraphTrackerImpl.fromResumptionToken to reconstruct the tracker across process boundaries, preserving the original runId.
Security note: The token contains the flag variation key and version. If passed to an untrusted client (e.g., a browser) this could expose feature-flag targeting details. Keep the token server-side and use an opaque reference in client-facing APIs.
Returns a snapshot of all graph-level metrics tracked so far. Fields
populate incrementally as track* methods are called, so the result is
a Partial<LDAIGraphMetricSummary>. Once the graph invocation has
completed via ManagedAgentGraph.run(), prefer ManagedGraphResult.metrics
which is fully populated.
Returns tracking metadata to be included in every LDClient.track call.
Optional variationTracks the total duration of the graph execution in milliseconds.
Emits event $ld:ai:graph:duration:total with the duration as the metric value.
At-most-once: subsequent calls are dropped with a warning.
Duration in milliseconds.
Tracks the execution path through the graph.
Emits event $ld:ai:graph:path with metric value 1.
The data payload includes the path array in addition to standard track data.
At-most-once: subsequent calls are dropped with a warning.
An ordered array of agent config keys representing the execution path.
Tracks when a node redirects to a different target than originally specified.
Emits event $ld:ai:graph:redirect with metric value 1.
Config key of the source node.
Config key of the actual target node.
Tracks aggregate token usage across the entire graph invocation.
Emits event $ld:ai:graph:total_tokens with the total token count as the metric value.
At-most-once: subsequent calls are dropped with a warning.
Token usage information.
Generated using TypeDoc
Tracks graph-level and edge-level metrics for an agent graph invocation.
Graph-level methods enforce at-most-once semantics: calling the same method twice on a tracker instance drops the second call and emits a warning. Edge-level methods (trackRedirect, trackHandoffSuccess, trackHandoffFailure) are multi-fire and are not subject to this constraint.
Example