Skip to content

GetTraceGraph

Source: src/AWS/XRay/GetTraceGraph.ts

Retrieve a service graph scoped to specific trace IDs — the services and edges the given traces traversed.

Bind the operation in the function’s init phase to get a runtime callable; provide the implementation with Effect.provide(XRay.GetTraceGraphHttp). The action is account-scoped: X-Ray does not support resource-level permissions for xray:GetTraceGraph, so the binding grants it on *.

import * as XRay from "alchemy/AWS/XRay";
// init — grants xray:GetTraceGraph
const getTraceGraph = yield* XRay.GetTraceGraph();
// runtime
const graph = yield* getTraceGraph({
TraceIds: ["1-63a2090f-3f4da4bcd9b1a3e07531423b"],
});
const services = graph.Services ?? [];