Vereda
    Preparing search index...

    Function instrumentTracing

    • Traces every request the client makes: one INTERNAL span per ticket, covering queueing, every attempt and backoff, with one CLIENT child span per attempt (http.request.resend_count is the retry number). Attributes follow the OpenTelemetry HTTP semantic conventions.

      Call it after your own client.use() middleware: the attempt span is registered as middleware, and the last one registered runs closest to fetch, so it times the request itself and injects headers last.

      Returns a function that stops recording. The middleware stays registered (middleware can't be removed) but becomes a pass-through.

      Parameters

      Returns () => void

      import { trace } from "@opentelemetry/api";
      const stop = instrumentTracing(client, { tracer: trace.getTracer("checkout") });