Skip to content
Merged
Show file tree
Hide file tree
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
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Microsoft Application Insights Team",
"license": "MIT",
"bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues",
"version": "3.6.0",
"version": "3.7.0",
"description": "Microsoft Application Insights module for Node.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -69,8 +69,8 @@
"@azure/functions": "^4.6.0",
"@azure/functions-old": "npm:@azure/functions@3.5.1",
"@azure/identity": "^4.6.0",
"@azure/monitor-opentelemetry": "^1.9.0",
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.29",
"@azure/monitor-opentelemetry": "^1.11.0",
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.31",
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.7",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.57.2",
Expand Down
15 changes: 0 additions & 15 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ import { AutoCollectExceptions } from "./logs/exceptions";
import { AZURE_MONITOR_STATSBEAT_FEATURES, AzureMonitorOpenTelemetryOptions } from "./types";
import { ApplicationInsightsConfig } from "./shared/configuration/config";
import { LogApi } from "./shim/logsApi";
import { PerformanceCounterMetrics } from "./metrics/performanceCounters";
import { AzureMonitorSpanProcessor } from "./traces/spanProcessor";
import { StatsbeatFeature, StatsbeatInstrumentation } from "./shim/types";

let autoCollectLogs: AutoCollectLogs;
let exceptions: AutoCollectExceptions;
let perfCounters: PerformanceCounterMetrics;

/**
* Initialize Azure Monitor
Expand All @@ -41,17 +38,6 @@ export function useAzureMonitor(options?: AzureMonitorOpenTelemetryOptions) {
if (internalConfig.enableAutoCollectExceptions) {
exceptions = new AutoCollectExceptions(logApi);
}
if (internalConfig.enableAutoCollectPerformance) {
try {
perfCounters = new PerformanceCounterMetrics(internalConfig);
// Add SpanProcessor to calculate Request Metrics
if (typeof (trace.getTracerProvider() as BasicTracerProvider).addSpanProcessor === "function") {
(trace.getTracerProvider() as BasicTracerProvider).addSpanProcessor(new AzureMonitorSpanProcessor(perfCounters));
}
} catch (err) {
diag.error("Failed to initialize PerformanceCounterMetrics: ", err);
}
}
autoCollectLogs.enable(internalConfig.instrumentationOptions);
_addOtlpExporters(internalConfig);
}
Expand All @@ -63,7 +49,6 @@ export async function shutdownAzureMonitor() {
await distroShutdownAzureMonitor();
autoCollectLogs.shutdown();
exceptions?.shutdown();
perfCounters?.shutdown();
}

/**
Expand Down
Loading
Loading