Function type for determining whether a span should be exported to Langfuse.
If provided, this is treated as a full override of the default filtering behavior.
Type declaration
(params:{otelSpan:ReadableSpan}):boolean
Parameters
params: {otelSpan:ReadableSpan}
Object containing the span to evaluate
otelSpan: ReadableSpan
The OpenTelemetry span to evaluate
Returns boolean
true if the span should be exported, false otherwise
Example
constshouldExportSpan: ShouldExportSpan = ({ otelSpan }) => { // Only export spans that took longer than 100ms returnotelSpan.duration[0] * 1000 + otelSpan.duration[1] / 1000000 > 100; };
Function type for determining whether a span should be exported to Langfuse. If provided, this is treated as a full override of the default filtering behavior.