Skip to content
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

Merged
merged 2 commits into from
May 31, 2022

Conversation

MSNev
Copy link
Collaborator

@MSNev MSNev commented May 27, 2022

@MSNev MSNev added this to the 2.8.4 milestone May 31, 2022
import { ITraceParent } from "./Interfaces/ITraceParent";
import { ITraceParent } from "../JavaScriptSDK.Interfaces/ITraceParent";
import { generateW3CId } from "./CoreUtils";
import { findMetaTag, findNamedServerTiming, getDocument, getPerformance } from "./EnvUtils";
Copy link
Member

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!

Copy link
Collaborator Author

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))
Copy link
Member

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?

Copy link
Collaborator Author

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);
Copy link
Collaborator Author

@MSNev MSNev May 31, 2022

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.

…or the core #1846

- Single Page Application Page View Tracking #176
- Run-time Telemetry initializers for Ajax requests #198
- How to modify traceflag in traceparent header? #1776
@MSNev MSNev merged commit ba059e1 into master May 31, 2022
@MSNev MSNev deleted the MSNev/DistributedTrace branch May 31, 2022 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants