Skip to content

Commit a55b672

Browse files
authored
Merge branch 'main' into feat/shim_configuration_edit_azmonitoroptions
2 parents 40bf008 + cc9655d commit a55b672

20 files changed

+1965
-1069
lines changed

.github/workflows/stale.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Stale issue handler'
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 7 * * *'
6+
7+
permissions:
8+
actions: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v9
17+
id: stale
18+
with:
19+
stale-issue-message: 'This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.'
20+
stale-pr-message: 'This PR will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.'
21+
operations-per-run: 200
22+
days-before-stale: 300
23+
days-before-close: 30
24+
stale-issue-label: 'stale'
25+
stale-pr-label: 'stale'
26+
close-issue-label: 'closed'
27+
close-pr-label: 'closed'
28+
exempt-issue-labels: 'bug,enhancement,documentation,waiting,keep'
29+
exempt-pr-labels: 'waiting,keep'
30+
exempt-all-milestones: true
31+
exempt-all-assignees: true

package-lock.json

Lines changed: 357 additions & 342 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Microsoft Application Insights Team",
44
"license": "MIT",
55
"bugs": "https://github.com/microsoft/ApplicationInsights-node.js/issues",
6-
"version": "3.5.0",
6+
"version": "3.7.0",
77
"description": "Microsoft Application Insights module for Node.js",
88
"repository": {
99
"type": "git",
@@ -68,23 +68,23 @@
6868
"@azure/core-rest-pipeline": "^1.9.2",
6969
"@azure/functions": "^4.6.0",
7070
"@azure/functions-old": "npm:@azure/[email protected]",
71-
"@azure/identity": "^4.2.1",
72-
"@azure/monitor-opentelemetry": "^1.8.1",
73-
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.28",
74-
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.5",
71+
"@azure/identity": "^4.6.0",
72+
"@azure/monitor-opentelemetry": "^1.11.0",
73+
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.31",
74+
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.7",
7575
"@opentelemetry/api": "^1.9.0",
76-
"@opentelemetry/api-logs": "^0.57.1",
77-
"@opentelemetry/core": "^1.26.0",
78-
"@opentelemetry/exporter-logs-otlp-http": "^0.57.1",
79-
"@opentelemetry/exporter-metrics-otlp-http": "^0.57.1",
80-
"@opentelemetry/exporter-trace-otlp-http": "^0.57.1",
81-
"@opentelemetry/otlp-exporter-base": "^0.57.1",
76+
"@opentelemetry/api-logs": "^0.57.2",
77+
"@opentelemetry/core": "^1.30.1",
78+
"@opentelemetry/exporter-logs-otlp-http": "^0.57.2",
79+
"@opentelemetry/exporter-metrics-otlp-http": "^0.57.2",
80+
"@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
81+
"@opentelemetry/otlp-exporter-base": "^0.57.2",
8282
"@opentelemetry/resources": "^1.30.1",
83-
"@opentelemetry/sdk-logs": "^0.57.1",
83+
"@opentelemetry/sdk-logs": "^0.57.2",
8484
"@opentelemetry/sdk-metrics": "^1.30.1",
8585
"@opentelemetry/sdk-trace-base": "^1.30.1",
8686
"@opentelemetry/sdk-trace-node": "^1.30.1",
87-
"@opentelemetry/semantic-conventions": "^1.28.0",
87+
"@opentelemetry/semantic-conventions": "^1.30.0",
8888
"diagnostic-channel": "1.1.1",
8989
"diagnostic-channel-publishers": "1.0.8"
9090
}

src/agent/diagnostics/etwDiagnosticLogger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
import { IDiagnosticLog } from "../types";
55
import { BaseDiagnosticLogger } from "./baseDiagnosticLogger";
6-
import { EtwWritter } from "./writers/etwWritter";
6+
import { EtwWriter } from "./writers/etwWriter";
77

88

99
export class EtwDiagnosticLogger extends BaseDiagnosticLogger {
1010

1111
constructor(instrumentationKey: string) {
1212
super(instrumentationKey);
13-
this._agentLogger = new EtwWritter();
13+
this._agentLogger = new EtwWriter();
1414
}
1515

1616
public logMessage(diagnosticLog: IDiagnosticLog) {

src/agent/diagnostics/writers/etwWritter.ts renamed to src/agent/diagnostics/writers/etwWriter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as path from 'path';
66
import { Util } from "../../../shared/util";
77
import { IAgentLogger } from "../../types";
88

9-
export class EtwWritter implements IAgentLogger {
9+
export class EtwWriter implements IAgentLogger {
1010
private _etwModule: any;
1111

1212
constructor() {

src/main.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ import { AutoCollectExceptions } from "./logs/exceptions";
1616
import { AZURE_MONITOR_STATSBEAT_FEATURES, AzureMonitorOpenTelemetryOptions } from "./types";
1717
import { ApplicationInsightsConfig } from "./shared/configuration/config";
1818
import { LogApi } from "./shim/logsApi";
19-
import { PerformanceCounterMetrics } from "./metrics/performanceCounters";
20-
import { AzureMonitorSpanProcessor } from "./traces/spanProcessor";
2119
import { StatsbeatFeature, StatsbeatInstrumentation } from "./shim/types";
20+
import { RequestSpanProcessor } from "./traces/requestProcessor";
2221

2322
let autoCollectLogs: AutoCollectLogs;
2423
let exceptions: AutoCollectExceptions;
25-
let perfCounters: PerformanceCounterMetrics;
2624

2725
/**
2826
* Initialize Azure Monitor
@@ -34,24 +32,15 @@ export function useAzureMonitor(options?: AzureMonitorOpenTelemetryOptions) {
3432
instrumentation: StatsbeatInstrumentation.NONE,
3533
feature: StatsbeatFeature.SHIM
3634
});
35+
// Allows for full filtering of dependency/request spans
36+
options.spanProcessors = [new RequestSpanProcessor(options.enableAutoCollectDependencies, options.enableAutoCollectRequests)];
3737
distroUseAzureMonitor(options);
3838
const internalConfig = new ApplicationInsightsConfig(options);
3939
const logApi = new LogApi(logs.getLogger("ApplicationInsightsLogger"));
4040
autoCollectLogs = new AutoCollectLogs();
4141
if (internalConfig.enableAutoCollectExceptions) {
4242
exceptions = new AutoCollectExceptions(logApi);
4343
}
44-
if (internalConfig.enableAutoCollectPerformance) {
45-
try {
46-
perfCounters = new PerformanceCounterMetrics(internalConfig);
47-
// Add SpanProcessor to calculate Request Metrics
48-
if (typeof (trace.getTracerProvider() as BasicTracerProvider).addSpanProcessor === "function") {
49-
(trace.getTracerProvider() as BasicTracerProvider).addSpanProcessor(new AzureMonitorSpanProcessor(perfCounters));
50-
}
51-
} catch (err) {
52-
diag.error("Failed to initialize PerformanceCounterMetrics: ", err);
53-
}
54-
}
5544
autoCollectLogs.enable(internalConfig.instrumentationOptions);
5645
_addOtlpExporters(internalConfig);
5746
}
@@ -63,7 +52,6 @@ export async function shutdownAzureMonitor() {
6352
await distroShutdownAzureMonitor();
6453
autoCollectLogs.shutdown();
6554
exceptions?.shutdown();
66-
perfCounters?.shutdown();
6755
}
6856

6957
/**

0 commit comments

Comments
 (0)