Insights/Trace does not support running multiple traces at the same time or writing out parts of a trace to a separate file.
If you want to create a separate file you will need to check if there’s a trace already running and stop that before starting a new one.
It’s possible the trace was started by some other system or automatically if the Insights executable was open when the Editor is started.
Overall I’d recommend to always check if a trace is running before starting a new one.
The API in FTraceAuxiliary can be used to start/stop traces or check if a trace is running, instead of executing console commands manually.
Another option would be to only create one trace file for the test run and use Timing Regions (TRACE_BEGIN_REGION/TRACE_END_REGION, see MiscTrace.h) to mark the area of interest inside the trace for later inspection.
The TraceAuxiliary API allows you to start or stop trace sessions.
If you want to overwrite an existing trace file you can use FTraceAuxiliary::Start(EConnectionType::File, TEXT(“MyFile.utrace”), Options) and pass in an FTraceAuxiliary::FOptions struct with bTruncateFile=true to overwrite an existing trace.