moleculer-metrics icon indicating copy to clipboard operation
moleculer-metrics copied to clipboard

Return action response

Open alexeymarunin opened this issue 6 years ago • 1 comments

Hi all)

I think it would be useful to store action response (not only error) in payload on metrics.trace.span.finish event. And because of response can huge/confident this feature will turn off by default, but it could be activated by setting response option to true/object/function like params option

// Action definition
{
    metrics: { 
        params: true,
        meta: true,
        response: true // default false
    }
}

// or


{
    metrics: { 
        params: true,
        meta: true,
        response: ['id', 'name']
    }
}

alexeymarunin avatar May 14 '19 21:05 alexeymarunin

Good idea.

icebob avatar May 15 '19 08:05 icebob