Nestjs-OpenTelemetry icon indicating copy to clipboard operation
Nestjs-OpenTelemetry copied to clipboard

Bug: Parent span duration is not correctly calculated

Open ikovac opened this issue 1 year ago • 1 comments

As you can see on the screenshot below, the parent span duration is not calculated correctly. Parent span (provider->identityservice.get) should also include the duration of child spans in its own duration. The same goes for controller->identitycontroller.profile. I am using nestjs version 9 and zipkin in order to visualize traces.

Screenshot 2023-06-30 at 13 41 09

I think the issue is in this line: https://github.com/MetinSeylan/Nestjs-OpenTelemetry/blob/main/src/Trace/Injectors/BaseTraceInjector.ts#L68C13-L68C13 because this issue occurs with async functions. There should be other check to determine if the function is async.

ikovac avatar Jun 30 '23 11:06 ikovac

You can use my version https://github.com/Yuuki-Sakura/nestjs-open-telemetry I fixed a lot of bugs.

Yuuki-Sakura avatar Jul 11 '23 09:07 Yuuki-Sakura