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

applicationinsights.ts #838

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

PhakornKiong
Copy link
Contributor

Fix #837

  • pass defaultClient.context to QuickPulseClient

While tinkering with the debugger, I noticed that the constructor for QuickPulseStateManager will use default context if one is not provided.

constructor(config: Config, context?: Context) {
this.config = config;
this.context = context || new Context();
this._sender = new QuickPulseSender(this.config);
this._isEnabled = false;
}

and

null was always passed to QuickPulseStateManager, hence the default context will always be used

if (!liveMetricsClient && enable) {
// No qps client exists. Create one and prepare it to be enabled at .start()
liveMetricsClient = new QuickPulseClient(defaultClient.config, null);
_performanceLiveMetrics = new AutoCollectPerformance(liveMetricsClient as any, 1000, true);
liveMetricsClient.addCollector(_performanceLiveMetrics);
defaultClient.quickPulseClient = liveMetricsClient; // Need this so we can forward all manual tracks to live metrics via PerformanceMetricsTelemetryProcessor
} else if (liveMetricsClient) {

This explains #837 inability to get "Role Name" updated in the portal.

- pass defaultClient.context to QuickPulseClient
Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution

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.

"Role Name" does not show up in Live Metric in Azure Portal
2 participants