opencensus-php icon indicating copy to clipboard operation
opencensus-php copied to clipboard

FR: Trace an Inherited Method

Open iamacarpet opened this issue 6 years ago • 0 comments

Hello,

It seems that currently with opencensus_trace_method as part of the PECL extension, if the method is inherited from a parent class, the trace won't fire.

For e.g. we wanted to trace Illuminate\Http\Response::send, but it is actually inherited from Symfony\Component\HttpFoundation\Response::send.

https://github.com/a1comms/GaeSupportLaravel/blob/php72-laravel55/src/A1comms/GaeSupportLaravel/Trace/Integration/LaravelExtended.php#L32

Here, only the callback for:

opencensus_trace_method(BaseResponse::class, 'send', [self::class, 'handleResponseSend']);

and not

opencensus_trace_method(LaravelResponse::class, 'send', [self::class, 'handleResponseSend']);

is ever fired.

Would it be possible to trigger when a trace is requested on the child class?

This would properly allow re-defining the function in the child class without having to re-do the trace definition.

Regards, iamacarpet

iamacarpet avatar Sep 03 '18 15:09 iamacarpet