-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task 7496325: Add Distributed tracing population for the properties for the core #1846 #1847
Conversation
MSNev
commented
May 27, 2022
- Single Page Application Page View Tracking Single Page Application Page View Tracking #176
- Run-time Telemetry initializers for Ajax requests Run-time Telemetry initializers for Ajax requests #198
- How to modify traceflag in traceparent header? How to modify traceflag in traceparent header? #1776
import { ITraceParent } from "./Interfaces/ITraceParent"; | ||
import { ITraceParent } from "../JavaScriptSDK.Interfaces/ITraceParent"; | ||
import { generateW3CId } from "./CoreUtils"; | ||
import { findMetaTag, findNamedServerTiming, getDocument, getPerformance } from "./EnvUtils"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is code scanning alert for unused import!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check and fix those
let navPerf = perf.getEntriesByType("navigation") || []; | ||
traceParent = parseTraceParent(_getTraceParentValue((navPerf.length > 0 ? navPerf[0] : {} as any).serverTiming).description); | ||
} | ||
traceParent = parseTraceParent(findNamedServerTiming(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know this. What is the use case when the traceparent would be sent in service timing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an "optional" way to pass values as the server-timing are the only request headers that JS has access to -- we would use this if the auto injection can't add any "meta" tag for some reason.
}); | ||
|
||
_self.context = new TelemetryContext(core, _extensionConfig); | ||
_breezeChannel = getExtensionByName(extensions, BreezeChannelIdentifier); | ||
_self.context.appId = () => _breezeChannel ? _breezeChannel["_appId"] : null; | ||
_previousTraceCtx = core.getTraceCtx(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edge case initialization change: Should populate any previously set values (on the previous trace) against the "new" telemetryTrace instance (if not supplied) -- probably won't be here.
2fdbf45
to
6ea3d15
Compare
Also address CodeQL issues
6ea3d15
to
74e9bcd
Compare