SpanOptionsNoTraceSpan creation options that do not control stack trace capture, including attributes, links, parent or root selection, annotations, span kind, sampling, and the trace level used for filtering.
options
Source effect/Tracer.ts:24110 lines
export interface SpanOptionsNoTrace {
readonly SpanOptionsNoTrace.attributes?: Record<string, unknown> | undefinedattributes?: type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, unknown> | undefined
readonly SpanOptionsNoTrace.links?: ReadonlyArray<SpanLink> | undefinedlinks?: interface ReadonlyArray<T>ReadonlyArray<SpanLink> | undefined
readonly SpanOptionsNoTrace.parent?: AnySpan | undefinedparent?: type AnySpan = Span | ExternalSpanA span value that can participate in tracing, either an Effect-managed
Span or an ExternalSpan propagated from another tracing system.
Example (Accepting any span)
import { Effect, Tracer } from "effect"
// Function that accepts any span type
const logSpan = (span: Tracer.AnySpan) => {
console.log(`Span ID: ${span.spanId}, Trace ID: ${span.traceId}`)
return Effect.succeed(span)
}
// Works with both Span and ExternalSpan
const externalSpan = Tracer.externalSpan({
spanId: "span-123",
traceId: "trace-456"
})
AnySpan | undefined
readonly SpanOptionsNoTrace.root?: boolean | undefinedroot?: boolean | undefined
readonly SpanOptionsNoTrace.annotations?: Context.Context<never> | undefinedannotations?: import ContextContext.type Context.Context = /*unresolved*/ anyContext<never> | undefined
readonly SpanOptionsNoTrace.kind?: SpanKind | undefinedkind?: type SpanKind =
| "internal"
| "server"
| "client"
| "producer"
| "consumer"
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
})
SpanKind | undefined
readonly SpanOptionsNoTrace.sampled?: boolean | undefinedsampled?: boolean | undefined
readonly SpanOptionsNoTrace.level?: LogLevel | undefinedlevel?: import LogLevelLogLevel | undefined
}Referenced by 8 symbols