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 };
};
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.