Creates a new trace. If there is an existing trace, use {@link #newChild(TraceContext)}
instead.


For example, to sample all requests for a specific url:
<pre>{@code
function newTrace(Request $request) {
$uri = $request->getUri();
$flags = SamplingFlags::createAsEmpty();
if (strpos('/experimental', $uri) !== false) {
$flags = SamplingFlags::createAsSampled();
} else if (strpos('/static', $uri) !== false) {
$flags = SamplingFlags::createAsNotSampled();
}
return $this->tracer->newTrace($flags);
}
}</pre>

@param SamplingFlags $samplingFlags
@return Span