Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _collectPerformance() {
const metaElement = [...document.getElementsByTagName('meta')].find(
e => e.getAttribute('name') === TRACE_PARENT_HEADER
);
const entries = this._getEntries();
const rootSpan = this._startSpan(
AttributeNames.DOCUMENT_LOAD,
PTN.FETCH_START,
entries,
{ parent: parseTraceParent((metaElement && metaElement.content) || '') }
);
if (!rootSpan) {
return;
}
const fetchSpan = this._startSpan(
AttributeNames.DOCUMENT_FETCH,
PTN.FETCH_START,
entries,
{
parent: rootSpan,
}
);
if (fetchSpan) {
this._addSpanNetworkEvents(fetchSpan, entries);
this._endSpan(fetchSpan, PTN.RESPONSE_END, entries);
}