Octri

captureSpan

Reports one span of a trace, with times you measured yourself. Spans with the same traceId form a request's trace waterfall. Most code uses startSpan or the framework integrations instead, which fill these in for you.

Parameters

traceIdstringrequired

The trace it belongs to.

spanIdstringrequired

This span's id, 16 hex characters.

parentSpanIdstring

The span that started this one.

namestringrequired

What it was, such as orders.insert.

servicestring

A category that colours it in the waterfall, such as db.

operationIdstring

The operation it belongs to.

startTimeISO timestamprequired

When it started.

endTimeISO timestamp

When it ended.

statuschoice

ok or error.

Example

Node
import { captureSpan, newSpanId } from "@octri/node";

captureSpan({
  traceId: trace.traceId,
  spanId: newSpanId(),
  parentSpanId: trace.parentSpanId,
  name: "invoice.render",
  service: "pdf",
  startTime: started.toISOString(),
  endTime: new Date().toISOString(),
  status: "ok",
});

In each language

LanguageCall
NodecaptureSpan()
Pythonoctri.capture_span()
Gooctri.CaptureSpan()
RubyOctri.capture_span
JavaOctri.captureSpan()
KotlinOctri.captureSpan()
PHPOctri::captureSpan()
Rustoctri_monitoring::capture_span()
SwiftOctri.captureSpan()
DartOctri.captureSpan()