Skip to content

Commit

Permalink
Also add protocol to disambiguate SPDY
Browse files Browse the repository at this point in the history
  • Loading branch information
k-fish authored Jul 11, 2023
1 parent 9339e1b commit 5823ee7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/tracing-internal/src/browser/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ function addHTTPTimings(span: Span): void {
}

function resourceTimingEntryToSpanData(resourceTiming: PerformanceResourceTiming): [string, string | number][] {
const name = resourceTiming.nextHopProtocol.split('/')[0].toLowerCase() || (resourceTiming.nextHopProtocol.startsWith('h') && 'http') || 'unknown';
const version = resourceTiming.nextHopProtocol.split('/')[1] || resourceTiming.nextHopProtocol.split('h')[1] || 'unknown';

const timingSpanData: [string, string | number][] = [];
if (version) {
timingSpanData.push(['network.protocol.version', version]);
}

timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);

if (!browserPerformanceTimeOrigin) {
return timingSpanData;
Expand Down

0 comments on commit 5823ee7

Please sign in to comment.