effect-io-ai

Package: effect
Module: Tracer

Tracer.SpanKind

OpenTelemetry-style role describing the kind of operation represented by a span: internal work, server handling, client calls, producing, or consuming.

Example (Configuring span kinds)

import { Effect } from "effect"
import type { Tracer } from "effect"

// Different span kinds for different operations
const serverSpan = Effect.withSpan("handle-request", {
  kind: "server" as Tracer.SpanKind
})

const clientSpan = Effect.withSpan("api-call", {
  kind: "client" as Tracer.SpanKind
})

const internalSpan = Effect.withSpan("internal-process", {
  kind: "internal" as Tracer.SpanKind
})

Signature

type SpanKind = "internal" | "server" | "client" | "producer" | "consumer"

Source

Since v3.1.0