From 7e11664ea53a7a49e2b01299e7adb4b7c9d1f1a7 Mon Sep 17 00:00:00 2001 From: Daniel Lamando Date: Sun, 12 Mar 2023 14:24:00 +0100 Subject: [PATCH] Try linking graph compute parent span --- feat/dependencies-of/compute.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/feat/dependencies-of/compute.ts b/feat/dependencies-of/compute.ts index 4da0ea5..63d73b1 100644 --- a/feat/dependencies-of/compute.ts +++ b/feat/dependencies-of/compute.ts @@ -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'); @@ -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');