What you're looking for is Tracing. There is an industry standard called OpenTelemetry, which has a rich ecosystem of tools to generate and analyze. For your software to emit traces in OpenTelemetry format, you can set up an Instrumentation for JavaScript