Skip to content

Commit 7e11664

Browse files
committed
Try linking graph compute parent span
1 parent a25f6ae commit 7e11664

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

feat/dependencies-of/compute.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModuleGraphJson, SubProcess, trace } from "../../deps.ts";
1+
import { context, ModuleGraphJson, SubProcess, trace } from "../../deps.ts";
22
import { computeDependencies } from "../../lib/module-map.ts";
33

44
const tracer = trace.getTracer('dependencies-of-compute');
@@ -32,8 +32,15 @@ export async function computeGraph(
3232
}
3333

3434
export async function renderGraph(modUrl: string, dotArgs: string[], args: URLSearchParams) {
35-
return tracer.startActiveSpan('Compute + Render Graph', span =>
36-
renderGraphInner(modUrl, dotArgs, args).finally(() => span.end()));
35+
return tracer.startActiveSpan('Compute + Render Graph', {
36+
attributes: {
37+
'render.mod_url': modUrl,
38+
'render.dot_args': dotArgs,
39+
'render.params': args.toString(),
40+
},
41+
}, context.active(), span =>
42+
renderGraphInner(modUrl, dotArgs, args).finally(() =>
43+
span.end()));
3744
}
3845
async function renderGraphInner(modUrl: string, dotArgs: string[], args: URLSearchParams) {
3946
const dotText = await computeGraph(modUrl, args, 'dot');

0 commit comments

Comments
 (0)