Function type for determining whether a span should be exported to Langfuse.
Object containing the span to evaluate
The OpenTelemetry span to evaluate
true if the span should be exported, false otherwise
true
false
const shouldExportSpan: ShouldExportSpan = ({ otelSpan }) => { // Only export spans that took longer than 100ms return otelSpan.duration[0] * 1000 + otelSpan.duration[1] / 1000000 > 100;}; Copy
const shouldExportSpan: ShouldExportSpan = ({ otelSpan }) => { // Only export spans that took longer than 100ms return otelSpan.duration[0] * 1000 + otelSpan.duration[1] / 1000000 > 100;};
Function type for determining whether a span should be exported to Langfuse.