Skip to content

Commit

Permalink
Try linking graph compute parent span
Browse files Browse the repository at this point in the history
  • Loading branch information
danopia committed Mar 12, 2023
1 parent a25f6ae commit 7e11664
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions feat/dependencies-of/compute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ModuleGraphJson, SubProcess, trace } from "../../deps.ts";
import { context, ModuleGraphJson, SubProcess, trace } from "../../deps.ts";
import { computeDependencies } from "../../lib/module-map.ts";

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

export async function renderGraph(modUrl: string, dotArgs: string[], args: URLSearchParams) {
return tracer.startActiveSpan('Compute + Render Graph', span =>
renderGraphInner(modUrl, dotArgs, args).finally(() => span.end()));
return tracer.startActiveSpan('Compute + Render Graph', {
attributes: {
'render.mod_url': modUrl,
'render.dot_args': dotArgs,
'render.params': args.toString(),
},
}, context.active(), span =>
renderGraphInner(modUrl, dotArgs, args).finally(() =>
span.end()));
}
async function renderGraphInner(modUrl: string, dotArgs: string[], args: URLSearchParams) {
const dotText = await computeGraph(modUrl, args, 'dot');
Expand Down

0 comments on commit 7e11664

Please sign in to comment.