@azure/monitor-opentelemetry-exporter 1.0.0-beta.24 → 1.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +148 -53
- package/dist-esm/src/Declarations/Constants.js +6 -1
- package/dist-esm/src/Declarations/Constants.js.map +1 -1
- package/dist-esm/src/Declarations/Contracts/Constants.js +1 -1
- package/dist-esm/src/Declarations/Contracts/Constants.js.map +1 -1
- package/dist-esm/src/Declarations/Contracts/index.js +1 -1
- package/dist-esm/src/Declarations/Contracts/index.js.map +1 -1
- package/dist-esm/src/config.js.map +1 -1
- package/dist-esm/src/export/base.js +1 -1
- package/dist-esm/src/export/base.js.map +1 -1
- package/dist-esm/src/export/log.js +2 -1
- package/dist-esm/src/export/log.js.map +1 -1
- package/dist-esm/src/export/metric.js +2 -1
- package/dist-esm/src/export/metric.js.map +1 -1
- package/dist-esm/src/export/statsbeat/longIntervalStatsbeatMetrics.js +2 -2
- package/dist-esm/src/export/statsbeat/longIntervalStatsbeatMetrics.js.map +1 -1
- package/dist-esm/src/export/statsbeat/networkStatsbeatMetrics.js +2 -2
- package/dist-esm/src/export/statsbeat/networkStatsbeatMetrics.js.map +1 -1
- package/dist-esm/src/export/statsbeat/statsbeatExporter.js +2 -1
- package/dist-esm/src/export/statsbeat/statsbeatExporter.js.map +1 -1
- package/dist-esm/src/export/statsbeat/statsbeatMetrics.js +2 -1
- package/dist-esm/src/export/statsbeat/statsbeatMetrics.js.map +1 -1
- package/dist-esm/src/export/statsbeat/types.js +1 -1
- package/dist-esm/src/export/statsbeat/types.js.map +1 -1
- package/dist-esm/src/export/trace.js +5 -3
- package/dist-esm/src/export/trace.js.map +1 -1
- package/dist-esm/src/generated/applicationInsightsClient.js +1 -1
- package/dist-esm/src/generated/applicationInsightsClient.js.map +1 -1
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/platform/index.js +1 -1
- package/dist-esm/src/platform/index.js.map +1 -1
- package/dist-esm/src/platform/nodejs/baseSender.js +1 -1
- package/dist-esm/src/platform/nodejs/baseSender.js.map +1 -1
- package/dist-esm/src/platform/nodejs/constants.js +1 -1
- package/dist-esm/src/platform/nodejs/constants.js.map +1 -1
- package/dist-esm/src/platform/nodejs/context/context.js +1 -1
- package/dist-esm/src/platform/nodejs/context/context.js.map +1 -1
- package/dist-esm/src/platform/nodejs/context/index.js +1 -1
- package/dist-esm/src/platform/nodejs/context/index.js.map +1 -1
- package/dist-esm/src/platform/nodejs/httpSender.js +2 -1
- package/dist-esm/src/platform/nodejs/httpSender.js.map +1 -1
- package/dist-esm/src/platform/nodejs/index.js +1 -1
- package/dist-esm/src/platform/nodejs/index.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileAccessControl.js +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileAccessControl.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemHelpers.js +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemHelpers.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemPersist.js +2 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemPersist.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/index.js +1 -1
- package/dist-esm/src/platform/nodejs/persist/index.js.map +1 -1
- package/dist-esm/src/sampling.js +9 -6
- package/dist-esm/src/sampling.js.map +1 -1
- package/dist-esm/src/types.js +12 -1
- package/dist-esm/src/types.js.map +1 -1
- package/dist-esm/src/utils/breezeUtils.js +6 -6
- package/dist-esm/src/utils/breezeUtils.js.map +1 -1
- package/dist-esm/src/utils/common.js +24 -1
- package/dist-esm/src/utils/common.js.map +1 -1
- package/dist-esm/src/utils/connectionStringParser.js +1 -1
- package/dist-esm/src/utils/connectionStringParser.js.map +1 -1
- package/dist-esm/src/utils/constants/applicationinsights.js +3 -3
- package/dist-esm/src/utils/constants/applicationinsights.js.map +1 -1
- package/dist-esm/src/utils/constants/span/azAttributes.js +1 -1
- package/dist-esm/src/utils/constants/span/azAttributes.js.map +1 -1
- package/dist-esm/src/utils/eventhub.js +1 -1
- package/dist-esm/src/utils/eventhub.js.map +1 -1
- package/dist-esm/src/utils/logUtils.js +14 -3
- package/dist-esm/src/utils/logUtils.js.map +1 -1
- package/dist-esm/src/utils/metricUtils.js +1 -1
- package/dist-esm/src/utils/metricUtils.js.map +1 -1
- package/dist-esm/src/utils/spanUtils.js +48 -8
- package/dist-esm/src/utils/spanUtils.js.map +1 -1
- package/package.json +16 -17
- package/types/monitor-opentelemetry-exporter.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
6
6
|
var api = require('@opentelemetry/api');
|
|
7
7
|
var core = require('@opentelemetry/core');
|
|
8
|
-
var url = require('url');
|
|
9
8
|
var semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
10
9
|
var os$1 = require('os');
|
|
10
|
+
var url = require('url');
|
|
11
11
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
12
12
|
var sdkMetrics = require('@opentelemetry/sdk-metrics');
|
|
13
13
|
var fs = require('fs');
|
|
@@ -40,7 +40,7 @@ var child_process__namespace = /*#__PURE__*/_interopNamespaceDefault(child_proce
|
|
|
40
40
|
var coreClient__namespace = /*#__PURE__*/_interopNamespaceDefault(coreClient);
|
|
41
41
|
|
|
42
42
|
// Copyright (c) Microsoft Corporation.
|
|
43
|
-
// Licensed under the MIT
|
|
43
|
+
// Licensed under the MIT License.
|
|
44
44
|
/**
|
|
45
45
|
* AI MS Links.
|
|
46
46
|
* @internal
|
|
@@ -60,7 +60,7 @@ const TIME_SINCE_ENQUEUED = "timeSinceEnqueued";
|
|
|
60
60
|
* AzureMonitorTraceExporter version.
|
|
61
61
|
* @internal
|
|
62
62
|
*/
|
|
63
|
-
const packageVersion = "1.0.0-beta.
|
|
63
|
+
const packageVersion = "1.0.0-beta.26";
|
|
64
64
|
var DependencyTypes;
|
|
65
65
|
(function (DependencyTypes) {
|
|
66
66
|
DependencyTypes["InProc"] = "InProc";
|
|
@@ -70,7 +70,7 @@ var DependencyTypes;
|
|
|
70
70
|
DependencyTypes["Grpc"] = "GRPC";
|
|
71
71
|
DependencyTypes["Wcf"] = "WCF Service";
|
|
72
72
|
})(DependencyTypes || (DependencyTypes = {}));
|
|
73
|
-
const AzureMonitorSampleRate = "
|
|
73
|
+
const AzureMonitorSampleRate = "microsoft.sample_rate";
|
|
74
74
|
const ApplicationInsightsBaseType = "_MS.baseType";
|
|
75
75
|
const ApplicationInsightsMessageName = "Microsoft.ApplicationInsights.Message";
|
|
76
76
|
const ApplicationInsightsExceptionName = "Microsoft.ApplicationInsights.Exception";
|
|
@@ -96,7 +96,7 @@ class ApplicationInsightsSampler {
|
|
|
96
96
|
*/
|
|
97
97
|
constructor(samplingRatio = 1) {
|
|
98
98
|
this.samplingRatio = samplingRatio;
|
|
99
|
-
if (this.samplingRatio > 1) {
|
|
99
|
+
if (this.samplingRatio > 1 || this.samplingRatio < 0 || !Number.isFinite(this.samplingRatio)) {
|
|
100
100
|
throw new Error("Wrong sampling rate, data will not be sampled out");
|
|
101
101
|
}
|
|
102
102
|
this._sampleRate = Math.round(this.samplingRatio * 100);
|
|
@@ -116,13 +116,13 @@ class ApplicationInsightsSampler {
|
|
|
116
116
|
* @returns a {@link SamplingResult}.
|
|
117
117
|
*/
|
|
118
118
|
shouldSample(
|
|
119
|
-
// @ts-
|
|
119
|
+
// @ts-expect-error unused argument
|
|
120
120
|
context, traceId,
|
|
121
|
-
// @ts-
|
|
121
|
+
// @ts-expect-error unused argument
|
|
122
122
|
spanName,
|
|
123
|
-
// @ts-
|
|
123
|
+
// @ts-expect-error unused argument
|
|
124
124
|
spanKind, attributes,
|
|
125
|
-
// @ts-
|
|
125
|
+
// @ts-expect-error unused argument
|
|
126
126
|
links) {
|
|
127
127
|
let isSampledIn = false;
|
|
128
128
|
if (this._sampleRate === 100) {
|
|
@@ -136,7 +136,10 @@ class ApplicationInsightsSampler {
|
|
|
136
136
|
}
|
|
137
137
|
// Add sample rate as span attribute
|
|
138
138
|
attributes = attributes || {};
|
|
139
|
-
|
|
139
|
+
// Only send the sample rate if it's not 100
|
|
140
|
+
if (this._sampleRate !== 100) {
|
|
141
|
+
attributes[AzureMonitorSampleRate] = this._sampleRate;
|
|
142
|
+
}
|
|
140
143
|
return isSampledIn
|
|
141
144
|
? { decision: sdkTraceBase.SamplingDecision.RECORD_AND_SAMPLED, attributes: attributes }
|
|
142
145
|
: { decision: sdkTraceBase.SamplingDecision.NOT_RECORD, attributes: attributes };
|
|
@@ -167,7 +170,7 @@ class ApplicationInsightsSampler {
|
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
// Copyright (c) Microsoft Corporation.
|
|
170
|
-
// Licensed under the MIT
|
|
173
|
+
// Licensed under the MIT License.
|
|
171
174
|
/**
|
|
172
175
|
* Azure service API version.
|
|
173
176
|
*/
|
|
@@ -258,7 +261,7 @@ var PerformanceCounter;
|
|
|
258
261
|
});
|
|
259
262
|
|
|
260
263
|
// Copyright (c) Microsoft Corporation.
|
|
261
|
-
// Licensed under the MIT
|
|
264
|
+
// Licensed under the MIT License.
|
|
262
265
|
/**
|
|
263
266
|
* ConnectionString parser.
|
|
264
267
|
* @internal
|
|
@@ -334,7 +337,7 @@ ConnectionStringParser.FIELDS_SEPARATOR = ";";
|
|
|
334
337
|
ConnectionStringParser.FIELD_KEY_VALUE_SEPARATOR = "=";
|
|
335
338
|
|
|
336
339
|
// Copyright (c) Microsoft Corporation.
|
|
337
|
-
// Licensed under the MIT
|
|
340
|
+
// Licensed under the MIT License.
|
|
338
341
|
/**
|
|
339
342
|
* Azure Monitor OpenTelemetry Trace Exporter.
|
|
340
343
|
*/
|
|
@@ -386,7 +389,7 @@ class AzureMonitorBaseExporter {
|
|
|
386
389
|
}
|
|
387
390
|
|
|
388
391
|
// Copyright (c) Microsoft Corporation.
|
|
389
|
-
// Licensed under the MIT
|
|
392
|
+
// Licensed under the MIT License.
|
|
390
393
|
class FileAccessControl {
|
|
391
394
|
// Check if file access control could be enabled
|
|
392
395
|
static checkFileProtection() {
|
|
@@ -553,7 +556,7 @@ FileAccessControl.OS_PROVIDES_FILE_PROTECTION = false;
|
|
|
553
556
|
FileAccessControl.USE_ICACLS = os__namespace.type() === "Windows_NT";
|
|
554
557
|
|
|
555
558
|
// Copyright (c) Microsoft Corporation.
|
|
556
|
-
// Licensed under the MIT
|
|
559
|
+
// Licensed under the MIT License.
|
|
557
560
|
const readdirAsync$1 = util.promisify(fs__namespace.readdir);
|
|
558
561
|
const statAsync$1 = util.promisify(fs__namespace.stat);
|
|
559
562
|
const lstatAsync = util.promisify(fs__namespace.lstat);
|
|
@@ -609,7 +612,7 @@ const confirmDirExists = async (directory) => {
|
|
|
609
612
|
};
|
|
610
613
|
|
|
611
614
|
// Copyright (c) Microsoft Corporation.
|
|
612
|
-
// Licensed under the MIT
|
|
615
|
+
// Licensed under the MIT License.
|
|
613
616
|
const statAsync = util.promisify(fs__namespace.stat);
|
|
614
617
|
const readdirAsync = util.promisify(fs__namespace.readdir);
|
|
615
618
|
const readFileAsync = util.promisify(fs__namespace.readFile);
|
|
@@ -764,6 +767,7 @@ class FileSystemPersist {
|
|
|
764
767
|
return false;
|
|
765
768
|
}
|
|
766
769
|
else {
|
|
770
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
767
771
|
files.forEach(async (file) => {
|
|
768
772
|
// Check expiration
|
|
769
773
|
const fileCreationDate = new Date(parseInt(file.split(FileSystemPersist.FILENAME_SUFFIX)[0]));
|
|
@@ -1821,7 +1825,7 @@ class ApplicationInsightsClient extends coreClient__namespace.ServiceClient {
|
|
|
1821
1825
|
const defaults = {
|
|
1822
1826
|
requestContentType: "application/json; charset=utf-8",
|
|
1823
1827
|
};
|
|
1824
|
-
const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.
|
|
1828
|
+
const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.26`;
|
|
1825
1829
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
1826
1830
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
1827
1831
|
: `${packageDetails}`;
|
|
@@ -1882,7 +1886,7 @@ const trackOperationSpec = {
|
|
|
1882
1886
|
};
|
|
1883
1887
|
|
|
1884
1888
|
// Copyright (c) Microsoft Corporation.
|
|
1885
|
-
// Licensed under the MIT
|
|
1889
|
+
// Licensed under the MIT License.
|
|
1886
1890
|
class NetworkStatsbeat {
|
|
1887
1891
|
constructor(endpoint, host) {
|
|
1888
1892
|
this.endpoint = endpoint;
|
|
@@ -1946,7 +1950,8 @@ var StatsbeatFeatureType;
|
|
|
1946
1950
|
})(StatsbeatFeatureType || (StatsbeatFeatureType = {}));
|
|
1947
1951
|
|
|
1948
1952
|
// Copyright (c) Microsoft Corporation.
|
|
1949
|
-
// Licensed under the MIT
|
|
1953
|
+
// Licensed under the MIT License.
|
|
1954
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1950
1955
|
const os = require("os");
|
|
1951
1956
|
class StatsbeatMetrics {
|
|
1952
1957
|
constructor() {
|
|
@@ -2044,7 +2049,7 @@ class StatsbeatMetrics {
|
|
|
2044
2049
|
}
|
|
2045
2050
|
|
|
2046
2051
|
// Copyright (c) Microsoft Corporation.
|
|
2047
|
-
// Licensed under the MIT
|
|
2052
|
+
// Licensed under the MIT License.
|
|
2048
2053
|
/**
|
|
2049
2054
|
* Performance Counter OpenTelemetry compliant names.
|
|
2050
2055
|
* @internal
|
|
@@ -2071,9 +2076,20 @@ var BreezePerformanceCounterNames;
|
|
|
2071
2076
|
BreezePerformanceCounterNames["REQUEST_RATE"] = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec";
|
|
2072
2077
|
BreezePerformanceCounterNames["REQUEST_DURATION"] = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time";
|
|
2073
2078
|
})(BreezePerformanceCounterNames || (BreezePerformanceCounterNames = {}));
|
|
2079
|
+
/**
|
|
2080
|
+
* Property Max Lengths
|
|
2081
|
+
* @internal
|
|
2082
|
+
*/
|
|
2083
|
+
var MaxPropertyLengths;
|
|
2084
|
+
(function (MaxPropertyLengths) {
|
|
2085
|
+
MaxPropertyLengths[MaxPropertyLengths["NINE_BIT"] = 512] = "NINE_BIT";
|
|
2086
|
+
MaxPropertyLengths[MaxPropertyLengths["TEN_BIT"] = 1024] = "TEN_BIT";
|
|
2087
|
+
MaxPropertyLengths[MaxPropertyLengths["THIRTEEN_BIT"] = 8192] = "THIRTEEN_BIT";
|
|
2088
|
+
MaxPropertyLengths[MaxPropertyLengths["FIFTEEN_BIT"] = 32768] = "FIFTEEN_BIT";
|
|
2089
|
+
})(MaxPropertyLengths || (MaxPropertyLengths = {}));
|
|
2074
2090
|
|
|
2075
2091
|
// Copyright (c) Microsoft Corporation.
|
|
2076
|
-
// Licensed under the MIT
|
|
2092
|
+
// Licensed under the MIT License.
|
|
2077
2093
|
const breezePerformanceCountersMap = new Map([
|
|
2078
2094
|
[OTelPerformanceCounterNames.PRIVATE_BYTES, BreezePerformanceCounterNames.PRIVATE_BYTES],
|
|
2079
2095
|
[OTelPerformanceCounterNames.AVAILABLE_BYTES, BreezePerformanceCounterNames.AVAILABLE_BYTES],
|
|
@@ -2157,7 +2173,7 @@ function resourceMetricsToEnvelope(metrics, ikey, isStatsbeat) {
|
|
|
2157
2173
|
}
|
|
2158
2174
|
|
|
2159
2175
|
// Copyright (c) Microsoft Corporation.
|
|
2160
|
-
// Licensed under the MIT
|
|
2176
|
+
// Licensed under the MIT License.
|
|
2161
2177
|
/**
|
|
2162
2178
|
* Azure Monitor Statsbeat Exporter
|
|
2163
2179
|
*/
|
|
@@ -2183,6 +2199,7 @@ class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExporter {
|
|
|
2183
2199
|
/**
|
|
2184
2200
|
* Export Statsbeat metrics.
|
|
2185
2201
|
*/
|
|
2202
|
+
// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-misused-promises
|
|
2186
2203
|
async export(metrics, resultCallback) {
|
|
2187
2204
|
if (this._isShutdown) {
|
|
2188
2205
|
setTimeout(() => resultCallback({ code: core.ExportResultCode.FAILED }), 0);
|
|
@@ -2210,7 +2227,7 @@ class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExporter {
|
|
|
2210
2227
|
}
|
|
2211
2228
|
|
|
2212
2229
|
// Copyright (c) Microsoft Corporation.
|
|
2213
|
-
// Licensed under the MIT
|
|
2230
|
+
// Licensed under the MIT License.
|
|
2214
2231
|
class NetworkStatsbeatMetrics extends StatsbeatMetrics {
|
|
2215
2232
|
constructor(options) {
|
|
2216
2233
|
super();
|
|
@@ -2435,7 +2452,7 @@ class NetworkStatsbeatMetrics extends StatsbeatMetrics {
|
|
|
2435
2452
|
getShortHost(originalHost) {
|
|
2436
2453
|
let shortHost = originalHost;
|
|
2437
2454
|
try {
|
|
2438
|
-
const hostRegex = new RegExp(/^https?:\/\/(?:www\.)?([
|
|
2455
|
+
const hostRegex = new RegExp(/^https?:\/\/(?:www\.)?([^/.-]+)/);
|
|
2439
2456
|
const res = hostRegex.exec(originalHost);
|
|
2440
2457
|
if (res !== null && res.length > 1) {
|
|
2441
2458
|
shortHost = res[1];
|
|
@@ -2450,7 +2467,7 @@ class NetworkStatsbeatMetrics extends StatsbeatMetrics {
|
|
|
2450
2467
|
}
|
|
2451
2468
|
|
|
2452
2469
|
// Copyright (c) Microsoft Corporation.
|
|
2453
|
-
// Licensed under the MIT
|
|
2470
|
+
// Licensed under the MIT License.
|
|
2454
2471
|
let instance$1 = null;
|
|
2455
2472
|
/**
|
|
2456
2473
|
* Long Interval Statsbeat Metrics
|
|
@@ -2532,7 +2549,7 @@ class LongIntervalStatsbeatMetrics extends StatsbeatMetrics {
|
|
|
2532
2549
|
}
|
|
2533
2550
|
}
|
|
2534
2551
|
setFeatures() {
|
|
2535
|
-
|
|
2552
|
+
const statsbeatFeatures = process.env.AZURE_MONITOR_STATSBEAT_FEATURES;
|
|
2536
2553
|
if (statsbeatFeatures) {
|
|
2537
2554
|
try {
|
|
2538
2555
|
this.feature = JSON.parse(statsbeatFeatures).feature;
|
|
@@ -2563,7 +2580,7 @@ function getInstance$1(options) {
|
|
|
2563
2580
|
}
|
|
2564
2581
|
|
|
2565
2582
|
// Copyright (c) Microsoft Corporation.
|
|
2566
|
-
// Licensed under the MIT
|
|
2583
|
+
// Licensed under the MIT License.
|
|
2567
2584
|
/**
|
|
2568
2585
|
* Breeze retriable status codes.
|
|
2569
2586
|
* @internal
|
|
@@ -2586,19 +2603,19 @@ function msToTimeSpan(totalms) {
|
|
|
2586
2603
|
if (isNaN(totalms) || totalms < 0) {
|
|
2587
2604
|
totalms = 0;
|
|
2588
2605
|
}
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2606
|
+
let sec = ((totalms / 1000) % 60).toFixed(7).replace(/0{0,4}$/, "");
|
|
2607
|
+
let min = "" + (Math.floor(totalms / (1000 * 60)) % 60);
|
|
2608
|
+
let hour = "" + (Math.floor(totalms / (1000 * 60 * 60)) % 24);
|
|
2609
|
+
const days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
2593
2610
|
sec = sec.indexOf(".") < 2 ? "0" + sec : sec;
|
|
2594
2611
|
min = min.length < 2 ? "0" + min : min;
|
|
2595
2612
|
hour = hour.length < 2 ? "0" + hour : hour;
|
|
2596
|
-
|
|
2613
|
+
const daysText = days > 0 ? days + "." : "";
|
|
2597
2614
|
return daysText + hour + ":" + min + ":" + sec;
|
|
2598
2615
|
}
|
|
2599
2616
|
|
|
2600
2617
|
// Copyright (c) Microsoft Corporation.
|
|
2601
|
-
// Licensed under the MIT
|
|
2618
|
+
// Licensed under the MIT License.
|
|
2602
2619
|
const DEFAULT_BATCH_SEND_RETRY_INTERVAL_MS = 60000;
|
|
2603
2620
|
/**
|
|
2604
2621
|
* Base sender class
|
|
@@ -2810,7 +2827,7 @@ class BaseSender {
|
|
|
2810
2827
|
}
|
|
2811
2828
|
|
|
2812
2829
|
// Copyright (c) Microsoft Corporation.
|
|
2813
|
-
// Licensed under the MIT
|
|
2830
|
+
// Licensed under the MIT License.
|
|
2814
2831
|
const applicationInsightsResource = "https://monitor.azure.com//.default";
|
|
2815
2832
|
/**
|
|
2816
2833
|
* Exporter HTTP sender class
|
|
@@ -2856,6 +2873,7 @@ class HttpSender extends BaseSender {
|
|
|
2856
2873
|
* Shutdown sender
|
|
2857
2874
|
* @internal
|
|
2858
2875
|
*/
|
|
2876
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
2859
2877
|
async shutdown() {
|
|
2860
2878
|
api.diag.info("HttpSender shutting down");
|
|
2861
2879
|
}
|
|
@@ -2870,7 +2888,7 @@ class HttpSender extends BaseSender {
|
|
|
2870
2888
|
}
|
|
2871
2889
|
|
|
2872
2890
|
// Copyright (c) Microsoft Corporation.
|
|
2873
|
-
// Licensed under the MIT
|
|
2891
|
+
// Licensed under the MIT License.
|
|
2874
2892
|
let instance = null;
|
|
2875
2893
|
/**
|
|
2876
2894
|
* Azure Telemetry context.
|
|
@@ -2913,7 +2931,7 @@ function getInstance() {
|
|
|
2913
2931
|
}
|
|
2914
2932
|
|
|
2915
2933
|
// Copyright (c) Microsoft Corporation.
|
|
2916
|
-
// Licensed under the MIT
|
|
2934
|
+
// Licensed under the MIT License.
|
|
2917
2935
|
function hrTimeToDate(hrTime) {
|
|
2918
2936
|
return new Date(core.hrTimeToNanoseconds(hrTime) / 1000000);
|
|
2919
2937
|
}
|
|
@@ -3113,9 +3131,32 @@ function createResourceMetricEnvelope(resource, instrumentationKey) {
|
|
|
3113
3131
|
}
|
|
3114
3132
|
return;
|
|
3115
3133
|
}
|
|
3134
|
+
function serializeAttribute(value) {
|
|
3135
|
+
if (typeof value === "object") {
|
|
3136
|
+
if (value instanceof Uint8Array) {
|
|
3137
|
+
return String(value);
|
|
3138
|
+
}
|
|
3139
|
+
else {
|
|
3140
|
+
try {
|
|
3141
|
+
// Should handle Error objects as well
|
|
3142
|
+
return JSON.stringify(value, Object.getOwnPropertyNames(value));
|
|
3143
|
+
}
|
|
3144
|
+
catch (err) {
|
|
3145
|
+
// Failed to serialize, return string cast
|
|
3146
|
+
return String(value);
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
// Return scalar and undefined values
|
|
3151
|
+
return String(value);
|
|
3152
|
+
}
|
|
3153
|
+
function shouldCreateResourceMetric() {
|
|
3154
|
+
var _a;
|
|
3155
|
+
return !(((_a = process.env.ENV_OPENTELEMETRY_RESOURCE_METRIC_DISABLED) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "true");
|
|
3156
|
+
}
|
|
3116
3157
|
|
|
3117
3158
|
// Copyright (c) Microsoft Corporation.
|
|
3118
|
-
// Licensed under the MIT
|
|
3159
|
+
// Licensed under the MIT License.
|
|
3119
3160
|
/**
|
|
3120
3161
|
* Azure SDK namespace.
|
|
3121
3162
|
* @internal
|
|
@@ -3133,7 +3174,7 @@ const MicrosoftEventHub = "Microsoft.EventHub";
|
|
|
3133
3174
|
const MessageBusDestination = "message_bus.destination";
|
|
3134
3175
|
|
|
3135
3176
|
// Copyright (c) Microsoft Corporation.
|
|
3136
|
-
// Licensed under the MIT
|
|
3177
|
+
// Licensed under the MIT License.
|
|
3137
3178
|
/**
|
|
3138
3179
|
* Average span.links[].attributes.enqueuedTime
|
|
3139
3180
|
*/
|
|
@@ -3180,7 +3221,7 @@ const parseEventHubSpan = (span, baseData) => {
|
|
|
3180
3221
|
};
|
|
3181
3222
|
|
|
3182
3223
|
// Copyright (c) Microsoft Corporation.
|
|
3183
|
-
// Licensed under the MIT
|
|
3224
|
+
// Licensed under the MIT License.
|
|
3184
3225
|
function createTagsFromSpan(span) {
|
|
3185
3226
|
const tags = createTagsFromResource(span.resource);
|
|
3186
3227
|
tags[KnownContextTagKeys.AiOperationId] = span.spanContext().traceId;
|
|
@@ -3209,10 +3250,12 @@ function createTagsFromSpan(span) {
|
|
|
3209
3250
|
}
|
|
3210
3251
|
else if (httpUrl) {
|
|
3211
3252
|
try {
|
|
3212
|
-
const url
|
|
3213
|
-
tags[KnownContextTagKeys.AiOperationName] = `${httpMethod} ${url
|
|
3253
|
+
const url = new URL(String(httpUrl));
|
|
3254
|
+
tags[KnownContextTagKeys.AiOperationName] = `${httpMethod} ${url.pathname}`;
|
|
3255
|
+
}
|
|
3256
|
+
catch (_a) {
|
|
3257
|
+
/* no-op */
|
|
3214
3258
|
}
|
|
3215
|
-
catch (ex) { }
|
|
3216
3259
|
}
|
|
3217
3260
|
if (httpClientIp) {
|
|
3218
3261
|
tags[KnownContextTagKeys.AiLocationIp] = String(httpClientIp);
|
|
@@ -3237,6 +3280,7 @@ function createPropertiesFromSpanAttributes(attributes) {
|
|
|
3237
3280
|
for (const key of Object.keys(attributes)) {
|
|
3238
3281
|
// Avoid duplication ignoring fields already mapped.
|
|
3239
3282
|
if (!(key.startsWith("_MS.") ||
|
|
3283
|
+
key.startsWith("microsoft.") ||
|
|
3240
3284
|
key === semanticConventions.SEMATTRS_NET_PEER_IP ||
|
|
3241
3285
|
key === semanticConventions.SEMATTRS_NET_PEER_NAME ||
|
|
3242
3286
|
key === semanticConventions.SEMATTRS_PEER_SERVICE ||
|
|
@@ -3255,7 +3299,7 @@ function createPropertiesFromSpanAttributes(attributes) {
|
|
|
3255
3299
|
key === semanticConventions.SEMATTRS_EXCEPTION_TYPE ||
|
|
3256
3300
|
key === semanticConventions.SEMATTRS_EXCEPTION_MESSAGE ||
|
|
3257
3301
|
key === semanticConventions.SEMATTRS_EXCEPTION_STACKTRACE)) {
|
|
3258
|
-
properties[key] = attributes[key];
|
|
3302
|
+
properties[key] = serializeAttribute(attributes[key]);
|
|
3259
3303
|
}
|
|
3260
3304
|
}
|
|
3261
3305
|
}
|
|
@@ -3298,10 +3342,12 @@ function createDependencyData(span) {
|
|
|
3298
3342
|
const httpUrl = span.attributes[semanticConventions.SEMATTRS_HTTP_URL];
|
|
3299
3343
|
if (httpUrl) {
|
|
3300
3344
|
try {
|
|
3301
|
-
const dependencyUrl = new
|
|
3345
|
+
const dependencyUrl = new URL(String(httpUrl));
|
|
3302
3346
|
remoteDependencyData.name = `${httpMethod} ${dependencyUrl.pathname}`;
|
|
3303
3347
|
}
|
|
3304
|
-
catch (
|
|
3348
|
+
catch (_b) {
|
|
3349
|
+
/* no-op */
|
|
3350
|
+
}
|
|
3305
3351
|
}
|
|
3306
3352
|
remoteDependencyData.type = DependencyTypes.Http;
|
|
3307
3353
|
remoteDependencyData.data = getUrl(span.attributes);
|
|
@@ -3325,7 +3371,9 @@ function createDependencyData(span) {
|
|
|
3325
3371
|
}
|
|
3326
3372
|
}
|
|
3327
3373
|
}
|
|
3328
|
-
catch (
|
|
3374
|
+
catch (_c) {
|
|
3375
|
+
/* no-op */
|
|
3376
|
+
}
|
|
3329
3377
|
remoteDependencyData.target = `${target}`;
|
|
3330
3378
|
}
|
|
3331
3379
|
}
|
|
@@ -3369,7 +3417,7 @@ function createDependencyData(span) {
|
|
|
3369
3417
|
}
|
|
3370
3418
|
// grpc Dependency
|
|
3371
3419
|
else if (rpcSystem) {
|
|
3372
|
-
if (rpcSystem
|
|
3420
|
+
if (rpcSystem === DependencyTypes.Wcf) {
|
|
3373
3421
|
remoteDependencyData.type = DependencyTypes.Wcf;
|
|
3374
3422
|
}
|
|
3375
3423
|
else {
|
|
@@ -3458,6 +3506,30 @@ function readableSpanToEnvelope(span, ikey) {
|
|
|
3458
3506
|
parseEventHubSpan(span, baseData);
|
|
3459
3507
|
}
|
|
3460
3508
|
}
|
|
3509
|
+
// Truncate properties
|
|
3510
|
+
if (baseData.id) {
|
|
3511
|
+
baseData.id = baseData.id.substring(0, MaxPropertyLengths.NINE_BIT);
|
|
3512
|
+
}
|
|
3513
|
+
if (baseData.name) {
|
|
3514
|
+
baseData.name = baseData.name.substring(0, MaxPropertyLengths.TEN_BIT);
|
|
3515
|
+
}
|
|
3516
|
+
if (baseData.resultCode) {
|
|
3517
|
+
baseData.resultCode = String(baseData.resultCode).substring(0, MaxPropertyLengths.TEN_BIT);
|
|
3518
|
+
}
|
|
3519
|
+
if (baseData.data) {
|
|
3520
|
+
baseData.data = String(baseData.data).substring(0, MaxPropertyLengths.THIRTEEN_BIT);
|
|
3521
|
+
}
|
|
3522
|
+
if (baseData.type) {
|
|
3523
|
+
baseData.type = String(baseData.type).substring(0, MaxPropertyLengths.TEN_BIT);
|
|
3524
|
+
}
|
|
3525
|
+
if (baseData.target) {
|
|
3526
|
+
baseData.target = String(baseData.target).substring(0, MaxPropertyLengths.TEN_BIT);
|
|
3527
|
+
}
|
|
3528
|
+
if (baseData.properties) {
|
|
3529
|
+
for (const key of Object.keys(baseData.properties)) {
|
|
3530
|
+
baseData.properties[key] = baseData.properties[key].substring(0, MaxPropertyLengths.THIRTEEN_BIT);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3461
3533
|
return {
|
|
3462
3534
|
name,
|
|
3463
3535
|
sampleRate,
|
|
@@ -3548,6 +3620,15 @@ function spanEventsToEnvelopes(span, ikey) {
|
|
|
3548
3620
|
if (span.attributes[AzureMonitorSampleRate]) {
|
|
3549
3621
|
sampleRate = Number(span.attributes[AzureMonitorSampleRate]);
|
|
3550
3622
|
}
|
|
3623
|
+
// Truncate properties
|
|
3624
|
+
if (baseData.message) {
|
|
3625
|
+
baseData.message = String(baseData.message).substring(0, MaxPropertyLengths.FIFTEEN_BIT);
|
|
3626
|
+
}
|
|
3627
|
+
if (baseData.properties) {
|
|
3628
|
+
for (const key of Object.keys(baseData.properties)) {
|
|
3629
|
+
baseData.properties[key] = baseData.properties[key].substring(0, MaxPropertyLengths.THIRTEEN_BIT);
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3551
3632
|
const env = {
|
|
3552
3633
|
name: name,
|
|
3553
3634
|
time: time,
|
|
@@ -3567,7 +3648,7 @@ function spanEventsToEnvelopes(span, ikey) {
|
|
|
3567
3648
|
}
|
|
3568
3649
|
|
|
3569
3650
|
// Copyright (c) Microsoft Corporation.
|
|
3570
|
-
// Licensed under the MIT
|
|
3651
|
+
// Licensed under the MIT License.
|
|
3571
3652
|
/**
|
|
3572
3653
|
* Azure Monitor OpenTelemetry Trace Exporter.
|
|
3573
3654
|
*/
|
|
@@ -3582,6 +3663,7 @@ class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
|
|
|
3582
3663
|
* Flag to determine if Exporter is shutdown.
|
|
3583
3664
|
*/
|
|
3584
3665
|
this.isShutdown = false;
|
|
3666
|
+
this.shouldCreateResourceMetric = shouldCreateResourceMetric();
|
|
3585
3667
|
this.sender = new HttpSender({
|
|
3586
3668
|
endpointUrl: this.endpointUrl,
|
|
3587
3669
|
instrumentationKey: this.instrumentationKey,
|
|
@@ -3596,6 +3678,7 @@ class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
|
|
|
3596
3678
|
* @param spans - Spans to export.
|
|
3597
3679
|
* @param resultCallback - Result callback.
|
|
3598
3680
|
*/
|
|
3681
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
3599
3682
|
async export(spans, resultCallback) {
|
|
3600
3683
|
if (this.isShutdown) {
|
|
3601
3684
|
api.diag.info("Exporter shut down. Failed to export spans.");
|
|
@@ -3606,7 +3689,7 @@ class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
|
|
|
3606
3689
|
if (spans.length > 0) {
|
|
3607
3690
|
const envelopes = [];
|
|
3608
3691
|
const resourceMetricEnvelope = createResourceMetricEnvelope(spans[0].resource, this.instrumentationKey);
|
|
3609
|
-
if (resourceMetricEnvelope) {
|
|
3692
|
+
if (resourceMetricEnvelope && this.shouldCreateResourceMetric) {
|
|
3610
3693
|
envelopes.push(resourceMetricEnvelope);
|
|
3611
3694
|
}
|
|
3612
3695
|
spans.forEach((span) => {
|
|
@@ -3632,7 +3715,7 @@ class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
|
|
|
3632
3715
|
}
|
|
3633
3716
|
|
|
3634
3717
|
// Copyright (c) Microsoft Corporation.
|
|
3635
|
-
// Licensed under the MIT
|
|
3718
|
+
// Licensed under the MIT License.
|
|
3636
3719
|
/**
|
|
3637
3720
|
* Azure Monitor OpenTelemetry Metric Exporter.
|
|
3638
3721
|
*/
|
|
@@ -3661,6 +3744,7 @@ class AzureMonitorMetricExporter extends AzureMonitorBaseExporter {
|
|
|
3661
3744
|
* @param metrics - Resource metrics to export.
|
|
3662
3745
|
* @param resultCallback - Result callback.
|
|
3663
3746
|
*/
|
|
3747
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
3664
3748
|
async export(metrics, resultCallback) {
|
|
3665
3749
|
if (this._isShutdown) {
|
|
3666
3750
|
api.diag.info("Exporter shut down. Failed to export spans.");
|
|
@@ -3701,7 +3785,7 @@ class AzureMonitorMetricExporter extends AzureMonitorBaseExporter {
|
|
|
3701
3785
|
}
|
|
3702
3786
|
|
|
3703
3787
|
// Copyright (c) Microsoft Corporation.
|
|
3704
|
-
// Licensed under the MIT
|
|
3788
|
+
// Licensed under the MIT License.
|
|
3705
3789
|
/**
|
|
3706
3790
|
* Log to Azure envelope parsing.
|
|
3707
3791
|
* @internal
|
|
@@ -3711,6 +3795,7 @@ function logToEnvelope(log, ikey) {
|
|
|
3711
3795
|
const sampleRate = 100;
|
|
3712
3796
|
const instrumentationKey = ikey;
|
|
3713
3797
|
const tags = createTagsFromLog(log);
|
|
3798
|
+
// eslint-disable-next-line prefer-const
|
|
3714
3799
|
let [properties, measurements] = createPropertiesFromLog(log);
|
|
3715
3800
|
let name;
|
|
3716
3801
|
let baseType;
|
|
@@ -3758,6 +3843,15 @@ function logToEnvelope(log, ikey) {
|
|
|
3758
3843
|
return;
|
|
3759
3844
|
}
|
|
3760
3845
|
}
|
|
3846
|
+
// Truncate properties
|
|
3847
|
+
if (baseData.message) {
|
|
3848
|
+
baseData.message = String(baseData.message).substring(0, MaxPropertyLengths.FIFTEEN_BIT);
|
|
3849
|
+
}
|
|
3850
|
+
if (properties) {
|
|
3851
|
+
for (const key of Object.keys(properties)) {
|
|
3852
|
+
properties[key] = String(properties[key]).substring(0, MaxPropertyLengths.THIRTEEN_BIT);
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3761
3855
|
return {
|
|
3762
3856
|
name,
|
|
3763
3857
|
sampleRate,
|
|
@@ -3793,7 +3887,7 @@ function createPropertiesFromLog(log) {
|
|
|
3793
3887
|
key === semanticConventions.SEMATTRS_EXCEPTION_TYPE ||
|
|
3794
3888
|
key === semanticConventions.SEMATTRS_EXCEPTION_MESSAGE ||
|
|
3795
3889
|
key === semanticConventions.SEMATTRS_EXCEPTION_STACKTRACE)) {
|
|
3796
|
-
properties[key] = log.attributes[key];
|
|
3890
|
+
properties[key] = serializeAttribute(log.attributes[key]);
|
|
3797
3891
|
}
|
|
3798
3892
|
}
|
|
3799
3893
|
}
|
|
@@ -3884,7 +3978,7 @@ function getLegacyApplicationInsightsBaseData(log) {
|
|
|
3884
3978
|
}
|
|
3885
3979
|
|
|
3886
3980
|
// Copyright (c) Microsoft Corporation.
|
|
3887
|
-
// Licensed under the MIT
|
|
3981
|
+
// Licensed under the MIT License.
|
|
3888
3982
|
/**
|
|
3889
3983
|
* Azure Monitor OpenTelemetry Log Exporter.
|
|
3890
3984
|
*/
|
|
@@ -3913,6 +4007,7 @@ class AzureMonitorLogExporter extends AzureMonitorBaseExporter {
|
|
|
3913
4007
|
* @param logs - Logs to export.
|
|
3914
4008
|
* @param resultCallback - Result callback.
|
|
3915
4009
|
*/
|
|
4010
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
3916
4011
|
async export(logs, resultCallback) {
|
|
3917
4012
|
if (this._isShutdown) {
|
|
3918
4013
|
api.diag.info("Exporter shut down. Failed to export spans.");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
/**
|
|
4
4
|
* Azure service API version.
|
|
5
5
|
*/
|
|
@@ -45,6 +45,11 @@ export const ENV_INSTRUMENTATION_KEY = "APPINSIGHTS_INSTRUMENTATIONKEY";
|
|
|
45
45
|
* @internal
|
|
46
46
|
*/
|
|
47
47
|
export const ENV_DISABLE_STATSBEAT = "APPLICATION_INSIGHTS_NO_STATSBEAT";
|
|
48
|
+
/**
|
|
49
|
+
* Disable OpenTelemetry Resource Metric.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export const ENV_OPENTELEMETRY_RESOURCE_METRIC_DISABLED = "APPLICATIONINSIGHTS_OPENTELEMETRY_RESOURCE_METRIC_DISABLED";
|
|
48
53
|
/**
|
|
49
54
|
* QuickPulse metric counter names.
|
|
50
55
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/Declarations/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,8CAAyB,CAAA;AAC3B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,sCAAsC,CAAC;AAC9E;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC/D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sCAAsC,CAAC;AACnF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;AACvE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uCAAuC,CAAC;AAC7E;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACxE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/Declarations/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,8CAAyB,CAAA;AAC3B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,sCAAsC,CAAC;AAC9E;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC/D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sCAAsC,CAAC;AACnF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;AACvE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uCAAuC,CAAC;AAC7E;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACxE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AACzE;;;GAGG;AACH,MAAM,CAAC,MAAM,0CAA0C,GACrD,4DAA4D,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAmBX;AAnBD,WAAY,iBAAiB;IAC3B,SAAS;IACT,kEAA6C,CAAA;IAE7C,MAAM;IACN,6EAAwD,CAAA;IAExD,UAAU;IACV,yEAAoD,CAAA;IACpD,wFAAmE,CAAA;IACnE,iFAA4D,CAAA;IAE5D,aAAa;IACb,oFAA+D,CAAA;IAC/D,mGAA8E,CAAA;IAC9E,4FAAuE,CAAA;IAEvE,YAAY;IACZ,6EAAwD,CAAA;AAC1D,CAAC,EAnBW,iBAAiB,KAAjB,iBAAiB,QAmB5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B,SAAS;IACT,oFAA8D,CAAA;IAC9D,mEAA6C,CAAA;IAE7C,MAAM;IACN,8EAAwD,CAAA;IACxD,sFAAgE,CAAA;IAEhE,WAAW;IACX,+FAAyE,CAAA;IACzE,6GAAuF,CAAA;AACzF,CAAC,EAZW,kBAAkB,KAAlB,kBAAkB,QAY7B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAyC;IAClF,CAAC,kBAAkB,CAAC,cAAc,CAAC,EAAE,iBAAiB,CAAC,cAAc;IACrE,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC,YAAY;IACjE,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,gBAAgB;IAEzE,kCAAkC;IAClC,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,eAAe;IACtE,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB;IAChF,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,eAAe;IACtE,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,EAAE,iBAAiB,CAAC,uBAAuB;IACtF,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,mBAAmB;IAC9E,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,iBAAiB,CAAC,cAAc;CACrE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure service API version.\n */\nexport enum ServiceApiVersion {\n /**\n * V2 Version\n */\n V2 = \"2020-09-15_Preview\",\n}\n\n/**\n * Default Breeze endpoint.\n * @internal\n */\nexport const DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\n/**\n * Default Breeze API version.\n * @internal\n */\nexport const DEFAULT_BREEZE_API_VERSION = ServiceApiVersion.V2;\n/**\n * Default Live Metrics endpoint.\n * @internal\n */\nexport const DEFAULT_LIVEMETRICS_ENDPOINT = \"https://rt.services.visualstudio.com\";\n/**\n * Default Live Metrics host.\n * @internal\n */\nexport const DEFAULT_LIVEMETRICS_HOST = \"rt.services.visualstudio.com\";\n/**\n * Connection string environment variable name.\n * @internal\n */\nexport const ENV_CONNECTION_STRING = \"APPLICATIONINSIGHTS_CONNECTION_STRING\";\n/**\n * Instrumentation key environment variable name.\n * @internal\n */\nexport const ENV_INSTRUMENTATION_KEY = \"APPINSIGHTS_INSTRUMENTATIONKEY\";\n/**\n * Disable Statsbeat environment variable name.\n * @internal\n */\nexport const ENV_DISABLE_STATSBEAT = \"APPLICATION_INSIGHTS_NO_STATSBEAT\";\n/**\n * Disable OpenTelemetry Resource Metric.\n * @internal\n */\nexport const ENV_OPENTELEMETRY_RESOURCE_METRIC_DISABLED =\n \"APPLICATIONINSIGHTS_OPENTELEMETRY_RESOURCE_METRIC_DISABLED\";\n\n/**\n * QuickPulse metric counter names.\n * @internal\n */\nexport enum QuickPulseCounter {\n // Memory\n COMMITTED_BYTES = \"\\\\Memory\\\\Committed Bytes\",\n\n // CPU\n PROCESSOR_TIME = \"\\\\Processor(_Total)\\\\% Processor Time\",\n\n // Request\n REQUEST_RATE = \"\\\\ApplicationInsights\\\\Requests/Sec\",\n REQUEST_FAILURE_RATE = \"\\\\ApplicationInsights\\\\Requests Failed/Sec\",\n REQUEST_DURATION = \"\\\\ApplicationInsights\\\\Request Duration\",\n\n // Dependency\n DEPENDENCY_RATE = \"\\\\ApplicationInsights\\\\Dependency Calls/Sec\",\n DEPENDENCY_FAILURE_RATE = \"\\\\ApplicationInsights\\\\Dependency Calls Failed/Sec\",\n DEPENDENCY_DURATION = \"\\\\ApplicationInsights\\\\Dependency Call Duration\",\n\n // Exception\n EXCEPTION_RATE = \"\\\\ApplicationInsights\\\\Exceptions/Sec\",\n}\n\n/**\n * Performance metric counter names.\n * @internal\n */\nexport enum PerformanceCounter {\n // Memory\n PRIVATE_BYTES = \"\\\\Process(??APP_WIN32_PROC??)\\\\Private Bytes\",\n AVAILABLE_BYTES = \"\\\\Memory\\\\Available Bytes\",\n\n // CPU\n PROCESSOR_TIME = \"\\\\Processor(_Total)\\\\% Processor Time\",\n PROCESS_TIME = \"\\\\Process(??APP_WIN32_PROC??)\\\\% Processor Time\",\n\n // Requests\n REQUEST_RATE = \"\\\\ASP.NET Applications(??APP_W3SVC_PROC??)\\\\Requests/Sec\",\n REQUEST_DURATION = \"\\\\ASP.NET Applications(??APP_W3SVC_PROC??)\\\\Request Execution Time\",\n}\n\n/**\n * Map a PerformanceCounter/QuickPulseCounter to a QuickPulseCounter. If no mapping exists, mapping is *undefined*\n * @internal\n */\nexport const PerformanceToQuickPulseCounter: { [key: string]: QuickPulseCounter } = {\n [PerformanceCounter.PROCESSOR_TIME]: QuickPulseCounter.PROCESSOR_TIME,\n [PerformanceCounter.REQUEST_RATE]: QuickPulseCounter.REQUEST_RATE,\n [PerformanceCounter.REQUEST_DURATION]: QuickPulseCounter.REQUEST_DURATION,\n\n // Remap quick pulse only counters\n [QuickPulseCounter.COMMITTED_BYTES]: QuickPulseCounter.COMMITTED_BYTES,\n [QuickPulseCounter.REQUEST_FAILURE_RATE]: QuickPulseCounter.REQUEST_FAILURE_RATE,\n [QuickPulseCounter.DEPENDENCY_RATE]: QuickPulseCounter.DEPENDENCY_RATE,\n [QuickPulseCounter.DEPENDENCY_FAILURE_RATE]: QuickPulseCounter.DEPENDENCY_FAILURE_RATE,\n [QuickPulseCounter.DEPENDENCY_DURATION]: QuickPulseCounter.DEPENDENCY_DURATION,\n [QuickPulseCounter.EXCEPTION_RATE]: QuickPulseCounter.EXCEPTION_RATE,\n};\n\n/**\n * QuickPulse document types.\n * @internal\n */\nexport type QuickPulseDocumentType =\n | \"Event\"\n | \"Exception\"\n | \"Trace\"\n | \"Metric\"\n | \"Request\"\n | \"RemoteDependency\"\n | \"Availability\";\n/**\n * QuickPulse telemetry types.\n * @internal\n */\nexport type QuickPulseType =\n | \"EventTelemetryDocument\"\n | \"ExceptionTelemetryDocument\"\n | \"TraceTelemetryDocument\"\n | \"MetricTelemetryDocument\"\n | \"RequestTelemetryDocument\"\n | \"DependencyTelemetryDocument\"\n | \"AvailabilityTelemetryDocument\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../src/Declarations/Contracts/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../src/Declarations/Contracts/Constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Subset of Connection String fields which this SDK can parse. Lower-typecased to\n * allow for case-insensitivity across field names.\n * @internal\n */\nexport type ConnectionString = { [key in ConnectionStringKey]?: string };\n\n/**\n * ConnectionString keys.\n * @internal\n */\nexport type ConnectionStringKey =\n | \"authorization\"\n | \"aadaudience\"\n | \"instrumentationkey\"\n | \"ingestionendpoint\"\n | \"liveendpoint\"\n | \"location\"\n | \"endpointsuffix\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Declarations/Contracts/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Declarations/Contracts/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./Constants\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ServiceApiVersion } from \"./Declarations/Constants\";\nimport { ApplicationInsightsClientOptionalParams } from \"./generated\";\n\n/**\n * Provides configuration options for AzureMonitorTraceExporter.\n */\nexport interface AzureMonitorExporterOptions extends ApplicationInsightsClientOptionalParams {\n /**\n * Azure Monitor Connection String, if not provided the exporter will try to use environment variable APPLICATIONINSIGHTS_CONNECTION_STRING\n * Ex: \"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://dc.services.visualstudio.com\"\n */\n connectionString?: string;\n /**\n * Azure service API version.\n */\n apiVersion?: ServiceApiVersion;\n /**\n * Token Credential\n */\n credential?: TokenCredential;\n /**\n * Directory to store retriable telemetry when it fails to export.\n */\n storageDirectory?: string;\n /**\n * Disable offline storage when telemetry cannot be exported.\n */\n disableOfflineStorage?: boolean;\n}\n"]}
|