Arize Phoenix TS
    Preparing search index...

    Type Alias InputToAttributesFn<Fn>

    InputToAttributesFn: (...args: Parameters<Fn>) => Attributes

    Function type for processing function arguments into OpenTelemetry attributes.

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

    Type Parameters

    Type Declaration

      • (...args: Parameters<Fn>): Attributes
      • Parameters

        • ...args: Parameters<Fn>

          The function arguments to process into attributes

        Returns Attributes

        OpenTelemetry attributes object containing the processed input data

    const customInputProcessor: InputToAttributesFn = (...args) => {
    if (args.length === 1 && typeof args[0] === 'object') {
    const input = args[0] as Record<string, unknown>;
    return {
    'input.type': typeof input,
    'input.value': JSON.stringify(input)
    };
    }
    return { 'input.args_count': args.length };
    };