Context.Reference<LogLevel>Context reference for setting the minimum trace level threshold. Spans and their descendants below this level will have their sampling decision forced to false, preventing them from being exported.
When to use
Use to set the trace-level threshold that controls whether spans are sampled by default.
Details
The default value is "All". Span creation compares the span level from
options.level ?? CurrentTraceLevel against this threshold.
Gotchas
Explicit options.sampled bypasses threshold computation.
export const const MinimumTraceLevel: Context.Reference<LogLevel>const MinimumTraceLevel: {
defaultValue: () => Shape;
of: (this: void, self: LogLevel) => LogLevel;
context: (self: LogLevel) => Context.Context<never>;
use: (f: (service: LogLevel) => Effect<A, E, R>) => Effect<A, E, R>;
useSync: (f: (service: LogLevel) => A) => Effect<A, never, never>;
Identifier: Identifier;
Service: Shape;
key: string;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Context reference for setting the minimum trace level threshold. Spans and their
descendants below this level will have their sampling decision forced to
false, preventing them from being exported.
When to use
Use to set the trace-level threshold that controls whether spans are sampled
by default.
Details
The default value is "All". Span creation compares the span level from
options.level ?? CurrentTraceLevel against this threshold.
Gotchas
Explicit options.sampled bypasses threshold computation.
MinimumTraceLevel = import ContextContext.Reference<
import LogLevelLogLevel
>("effect/Tracer/MinimumTraceLevel", { defaultValue: () => stringdefaultValue: () => "All" })