Langfuse JS/TS SDKs
    Preparing search index...

    Type Alias ShouldExportSpan

    ShouldExportSpan: (params: { otelSpan: ReadableSpan }) => boolean

    Function type for determining whether a span should be exported to Langfuse.

    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

    const shouldExportSpan: ShouldExportSpan = ({ otelSpan }) => {
    // Only export spans that took longer than 100ms
    return otelSpan.duration[0] * 1000 + otelSpan.duration[1] / 1000000 > 100;
    };