Documentation
¶
Overview ¶
Package processor contains the Langfuse OpenTelemetry span processor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldExport ¶
func ShouldExport(span sdktrace.ReadOnlySpan) bool
ShouldExport applies the Langfuse v4 smart default filter.
Types ¶
type AdmitFunc ¶ added in v0.4.0
AdmitFunc accepts the pending admission token in ctx, confirming to the starting SDK observation that this processor observed its start before any teardown. It runs synchronously inside Tracer.Start and must not block.
type Config ¶
type Config struct {
Next sdktrace.SpanProcessor
PublicKey string
Environment string
Release string
ContextAttributes ContextAttributesFunc
HasTraceClaim TraceClaimFunc
Admit AdmitFunc
}
Config configures a Processor.
type ContextAttributesFunc ¶
ContextAttributesFunc returns already-normalized attributes belonging to this processor's client. The root package owns the context representation so multiple isolated clients can safely use the same context.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor adds Langfuse propagation and application-root attributes, then forwards only LLM-relevant sampled spans to the wrapped processor.
func (*Processor) ForceFlush ¶
ForceFlush forwards a flush only while the processor is active.
func (*Processor) OnEnd ¶
func (p *Processor) OnEnd(span sdktrace.ReadOnlySpan)
OnEnd removes start-time state and applies the final smart filter. The end decision sees attributes added late by streaming/provider instrumentation.
func (*Processor) OnStart ¶
func (p *Processor) OnStart(parent context.Context, span sdktrace.ReadWriteSpan)
OnStart fills missing Langfuse attributes and performs the start-time half of application-root detection. It intentionally tracks only direct parents, matching the current official Python processor.