Skip to content

Fix issue with Live Metrics enablement #1238

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

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions applicationinsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,15 @@ export function start() {
_clientRequests.enable(defaultClient.config.enableAutoCollectDependencies);
_webSnippet.enable(defaultClient.config.enableWebInstrumentation, defaultClient.config.webInstrumentationConnectionString);
if (defaultClient.config.enableSendLiveMetrics) {
// Initialize Live metrics in case config was provided in telemetryClient config, double initialization check is part of liveMetrics client
if (!liveMetricsClient) {
// No qps client exists. Create one and prepare it to be enabled at .start()
liveMetricsClient = new QuickPulseClient(defaultClient.config, defaultClient.context, defaultClient.getAuthorizationHandler);
_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
}
liveMetricsClient.enable(defaultClient.config.enableSendLiveMetrics)
}
_azureFunctions.enable(defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);

Expand Down