Arize Phoenix TS
    Preparing search index...

    Type Alias OutputToAttributesFn<Fn>

    OutputToAttributesFn: (result: Awaited<ReturnType<Fn>>) => Attributes

    Function type for processing function results into OpenTelemetry attributes.

    This function type defines the signature for custom output processors that convert function return values into OpenTelemetry attributes for span enrichment. The function receives the original function's return value and should return an attributes object that will be added to the span.

    Type Parameters

    Type Declaration

      • (result: Awaited<ReturnType<Fn>>): Attributes
      • Parameters

        • result: Awaited<ReturnType<Fn>>

          The function's return value to process into attributes

        Returns Attributes

        OpenTelemetry attributes object containing the processed output data

    const customOutputProcessor: OutputToAttributesFn = (result) => {
    if (result && typeof result === 'object') {
    return {
    'output.value': JSON.stringify(result)
    };
    }
    return {
    'output.value': String(result)
    };
    };