Octri

captureSpan

Signale un span d’une trace, avec les heures que vous avez mesurées vous-même. Les spans ayant le même traceId forment la cascade de trace d’une requête. La plupart du code utilise plutôt startSpan ou les intégrations de frameworks, qui renseignent ces valeurs pour vous.

Paramètres

traceIdstringobligatoire

La trace à laquelle il appartient.

spanIdstringobligatoire

L’identifiant de ce span, composé de 16 caractères hexadécimaux.

parentSpanIdstring

Le span à l’origine de celui-ci.

namestringobligatoire

Sa fonction, par exemple orders.insert.

servicestring

Une catégorie qui lui attribue une couleur dans la cascade, par exemple db.

operationIdstring

L’opération à laquelle il appartient.

startTimeISO timestampobligatoire

Son heure de début.

endTimeISO timestamp

Son heure de fin.

statuschoice

ok ou error.

Exemple

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",
});

Dans chaque langage

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