@azure/monitor-opentelemetry 1.19.0 → 1.20.1
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/README.md +7 -3
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.d.ts.map +1 -1
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.js +1 -2
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.js.map +1 -1
- package/dist/commonjs/index.d.ts +2 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +18 -31
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/logs/handler.d.ts +2 -1
- package/dist/commonjs/logs/handler.d.ts.map +1 -1
- package/dist/commonjs/logs/handler.js +14 -8
- package/dist/commonjs/logs/handler.js.map +1 -1
- package/dist/commonjs/metrics/performanceCounters.d.ts +3 -0
- package/dist/commonjs/metrics/performanceCounters.d.ts.map +1 -1
- package/dist/commonjs/metrics/performanceCounters.js +26 -26
- package/dist/commonjs/metrics/performanceCounters.js.map +1 -1
- package/dist/commonjs/metrics/quickpulse/export/sender.d.ts +1 -1
- package/dist/commonjs/metrics/quickpulse/export/sender.d.ts.map +1 -1
- package/dist/commonjs/metrics/quickpulse/export/sender.js +29 -23
- package/dist/commonjs/metrics/quickpulse/export/sender.js.map +1 -1
- package/dist/commonjs/metrics/quickpulse/liveMetrics.d.ts +5 -1
- package/dist/commonjs/metrics/quickpulse/liveMetrics.d.ts.map +1 -1
- package/dist/commonjs/metrics/quickpulse/liveMetrics.js +86 -75
- package/dist/commonjs/metrics/quickpulse/liveMetrics.js.map +1 -1
- package/dist/commonjs/package.json +6 -1
- package/dist/commonjs/shared/config.d.ts +7 -0
- package/dist/commonjs/shared/config.d.ts.map +1 -1
- package/dist/commonjs/shared/config.js +27 -6
- package/dist/commonjs/shared/config.js.map +1 -1
- package/dist/commonjs/traces/azureSdkInstrumentation.d.ts +12 -0
- package/dist/commonjs/traces/azureSdkInstrumentation.d.ts.map +1 -0
- package/dist/commonjs/traces/azureSdkInstrumentation.js +64 -0
- package/dist/commonjs/traces/azureSdkInstrumentation.js.map +1 -0
- package/dist/commonjs/traces/handler.d.ts +2 -13
- package/dist/commonjs/traces/handler.d.ts.map +1 -1
- package/dist/commonjs/traces/handler.js +14 -43
- package/dist/commonjs/traces/handler.js.map +1 -1
- package/dist/commonjs/traces/sampler.js +1 -1
- package/dist/commonjs/traces/sampler.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/types.d.ts +11 -2
- package/dist/commonjs/types.d.ts.map +1 -1
- package/dist/commonjs/types.js +1 -1
- package/dist/commonjs/types.js.map +1 -1
- package/dist/commonjs/utils/azureSdkTracingBridge.d.ts +4 -4
- package/dist/commonjs/utils/azureSdkTracingBridge.d.ts.map +1 -1
- package/dist/commonjs/utils/azureSdkTracingBridge.js +10 -8
- package/dist/commonjs/utils/azureSdkTracingBridge.js.map +1 -1
- package/dist/commonjs/utils/common.d.ts +24 -0
- package/dist/commonjs/utils/common.d.ts.map +1 -1
- package/dist/commonjs/utils/common.js +47 -0
- package/dist/commonjs/utils/common.js.map +1 -1
- package/dist/commonjs/utils/instrumentation.d.ts +8 -0
- package/dist/commonjs/utils/instrumentation.d.ts.map +1 -0
- package/dist/commonjs/utils/instrumentation.js +26 -0
- package/dist/commonjs/utils/instrumentation.js.map +1 -0
- package/dist/commonjs/utils/statsbeat.d.ts.map +1 -1
- package/dist/commonjs/utils/statsbeat.js +3 -1
- package/dist/commonjs/utils/statsbeat.js.map +1 -1
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.d.ts.map +1 -1
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.js +1 -2
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +18 -31
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logs/handler.d.ts +2 -1
- package/dist/esm/logs/handler.d.ts.map +1 -1
- package/dist/esm/logs/handler.js +14 -8
- package/dist/esm/logs/handler.js.map +1 -1
- package/dist/esm/metrics/performanceCounters.d.ts +3 -0
- package/dist/esm/metrics/performanceCounters.d.ts.map +1 -1
- package/dist/esm/metrics/performanceCounters.js +26 -26
- package/dist/esm/metrics/performanceCounters.js.map +1 -1
- package/dist/esm/metrics/quickpulse/export/sender.d.ts +1 -1
- package/dist/esm/metrics/quickpulse/export/sender.d.ts.map +1 -1
- package/dist/esm/metrics/quickpulse/export/sender.js +29 -23
- package/dist/esm/metrics/quickpulse/export/sender.js.map +1 -1
- package/dist/esm/metrics/quickpulse/liveMetrics.d.ts +5 -1
- package/dist/esm/metrics/quickpulse/liveMetrics.d.ts.map +1 -1
- package/dist/esm/metrics/quickpulse/liveMetrics.js +86 -75
- package/dist/esm/metrics/quickpulse/liveMetrics.js.map +1 -1
- package/dist/esm/package.json +6 -1
- package/dist/esm/shared/config.d.ts +7 -0
- package/dist/esm/shared/config.d.ts.map +1 -1
- package/dist/esm/shared/config.js +28 -7
- package/dist/esm/shared/config.js.map +1 -1
- package/dist/esm/traces/azureSdkInstrumentation.d.ts +12 -0
- package/dist/esm/traces/azureSdkInstrumentation.d.ts.map +1 -0
- package/dist/esm/traces/azureSdkInstrumentation.js +60 -0
- package/dist/esm/traces/azureSdkInstrumentation.js.map +1 -0
- package/dist/esm/traces/handler.d.ts +2 -13
- package/dist/esm/traces/handler.d.ts.map +1 -1
- package/dist/esm/traces/handler.js +14 -42
- package/dist/esm/traces/handler.js.map +1 -1
- package/dist/esm/traces/sampler.js +1 -1
- package/dist/esm/traces/sampler.js.map +1 -1
- package/dist/esm/types.d.ts +11 -2
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/azureSdkTracingBridge.d.ts +4 -4
- package/dist/esm/utils/azureSdkTracingBridge.d.ts.map +1 -1
- package/dist/esm/utils/azureSdkTracingBridge.js +11 -7
- package/dist/esm/utils/azureSdkTracingBridge.js.map +1 -1
- package/dist/esm/utils/common.d.ts +24 -0
- package/dist/esm/utils/common.d.ts.map +1 -1
- package/dist/esm/utils/common.js +45 -0
- package/dist/esm/utils/common.js.map +1 -1
- package/dist/esm/utils/instrumentation.d.ts +8 -0
- package/dist/esm/utils/instrumentation.d.ts.map +1 -0
- package/dist/esm/utils/instrumentation.js +23 -0
- package/dist/esm/utils/instrumentation.js.map +1 -0
- package/dist/esm/utils/statsbeat.d.ts.map +1 -1
- package/dist/esm/utils/statsbeat.js +4 -2
- package/dist/esm/utils/statsbeat.js.map +1 -1
- package/package.json +33 -30
|
@@ -8,6 +8,7 @@ import type { Instrumentation } from "@opentelemetry/instrumentation";
|
|
|
8
8
|
* Azure Monitor OpenTelemetry Trace Handler
|
|
9
9
|
*/
|
|
10
10
|
export declare class TraceHandler {
|
|
11
|
+
private readonly instrumentationCache?;
|
|
11
12
|
private _batchSpanProcessor;
|
|
12
13
|
private _azureSpanProcessor;
|
|
13
14
|
private _azureExporter;
|
|
@@ -21,7 +22,7 @@ export declare class TraceHandler {
|
|
|
21
22
|
* @param _config - Configuration.
|
|
22
23
|
* @param _metricHandler - MetricHandler.
|
|
23
24
|
*/
|
|
24
|
-
constructor(config: InternalConfig, metricHandler: MetricHandler);
|
|
25
|
+
constructor(config: InternalConfig, metricHandler: MetricHandler, instrumentationCache?: Map<string, Instrumentation> | undefined);
|
|
25
26
|
getSampler(): Sampler;
|
|
26
27
|
getBatchSpanProcessor(): BatchSpanProcessor;
|
|
27
28
|
getAzureMonitorSpanProcessor(): AzureMonitorSpanProcessor;
|
|
@@ -34,17 +35,5 @@ export declare class TraceHandler {
|
|
|
34
35
|
* Start auto collection of telemetry
|
|
35
36
|
*/
|
|
36
37
|
private _initializeInstrumentations;
|
|
37
|
-
/**
|
|
38
|
-
* Wire the Azure SDK instrumenter into `@azure/core-tracing` directly.
|
|
39
|
-
*
|
|
40
|
-
* The Azure SDK instrumentation registers its instrumenter through an OpenTelemetry
|
|
41
|
-
* module-patch hook that only fires via `require`/`import`-in-the-middle. In ESM hosts
|
|
42
|
-
* where the OpenTelemetry loader cannot be registered up front (for example, Azure
|
|
43
|
-
* Functions, which controls the Node.js start command), that hook never runs, so Azure
|
|
44
|
-
* SDK dependency spans are missing. Because `@azure/core-tracing` resolves its
|
|
45
|
-
* instrumenter lazily at span-creation time from shared module-local state, applying
|
|
46
|
-
* the same patch directly here enables Azure SDK tracing regardless of module system.
|
|
47
|
-
*/
|
|
48
|
-
private _wireAzureSdkInstrumenter;
|
|
49
38
|
}
|
|
50
39
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/traces/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/traces/handler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAWnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAMtE;;GAEG;AACH,qBAAa,YAAY;IAkBrB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAjBxC,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,mBAAmB,CAA4B;IACvD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,QAAQ,CAAU;IAE1B;;;;OAIG;gBAED,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,aAAa,EACX,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,YAAA;IAsB/D,UAAU,IAAI,OAAO;IAIrB,qBAAqB,IAAI,kBAAkB;IAI3C,4BAA4B,IAAI,yBAAyB;IAIzD,mBAAmB,IAAI,eAAe,EAAE;IAI/C;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtC;;OAEG;IACH,OAAO,CAAC,2BAA2B;CAmFpC"}
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.TraceHandler = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const opentelemetry_instrumentation_azure_sdk_1 = require("@azure/opentelemetry-instrumentation-azure-sdk");
|
|
8
|
-
const coreTracing = tslib_1.__importStar(require("@azure/core-tracing"));
|
|
9
6
|
const monitor_opentelemetry_exporter_1 = require("@azure/monitor-opentelemetry-exporter");
|
|
10
7
|
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
11
8
|
const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
|
|
@@ -17,11 +14,14 @@ const common_js_1 = require("../utils/common.js");
|
|
|
17
14
|
const spanProcessor_js_1 = require("./spanProcessor.js");
|
|
18
15
|
const azureFnHook_js_1 = require("./azureFnHook.js");
|
|
19
16
|
const sampler_js_1 = require("./sampler.js");
|
|
20
|
-
const
|
|
17
|
+
const azureSdkTracingBridge_js_1 = require("../utils/azureSdkTracingBridge.js");
|
|
18
|
+
const instrumentation_js_1 = require("../utils/instrumentation.js");
|
|
19
|
+
const azureSdkInstrumentation_js_1 = require("./azureSdkInstrumentation.js");
|
|
21
20
|
/**
|
|
22
21
|
* Azure Monitor OpenTelemetry Trace Handler
|
|
23
22
|
*/
|
|
24
23
|
class TraceHandler {
|
|
24
|
+
instrumentationCache;
|
|
25
25
|
_batchSpanProcessor;
|
|
26
26
|
_azureSpanProcessor;
|
|
27
27
|
_azureExporter;
|
|
@@ -35,7 +35,8 @@ class TraceHandler {
|
|
|
35
35
|
* @param _config - Configuration.
|
|
36
36
|
* @param _metricHandler - MetricHandler.
|
|
37
37
|
*/
|
|
38
|
-
constructor(config, metricHandler) {
|
|
38
|
+
constructor(config, metricHandler, instrumentationCache) {
|
|
39
|
+
this.instrumentationCache = instrumentationCache;
|
|
39
40
|
this._config = config;
|
|
40
41
|
this._metricHandler = metricHandler;
|
|
41
42
|
this._instrumentations = [];
|
|
@@ -52,13 +53,7 @@ class TraceHandler {
|
|
|
52
53
|
this._sampler = new sampler_js_1.ApplicationInsightsSampler(this._config.samplingRatio);
|
|
53
54
|
}
|
|
54
55
|
this._azureExporter = new monitor_opentelemetry_exporter_1.AzureMonitorTraceExporter(this._config.azureMonitorExporterOptions);
|
|
55
|
-
|
|
56
|
-
maxExportBatchSize: 512,
|
|
57
|
-
scheduledDelayMillis: 5000,
|
|
58
|
-
exportTimeoutMillis: 30000,
|
|
59
|
-
maxQueueSize: 2048,
|
|
60
|
-
};
|
|
61
|
-
this._batchSpanProcessor = new sdk_trace_base_1.BatchSpanProcessor(this._azureExporter, bufferConfig);
|
|
56
|
+
this._batchSpanProcessor = new sdk_trace_base_1.BatchSpanProcessor(this._azureExporter);
|
|
62
57
|
this._azureSpanProcessor = new spanProcessor_js_1.AzureMonitorSpanProcessor(this._metricHandler);
|
|
63
58
|
this._azureFunctionsHook = new azureFnHook_js_1.AzureFunctionsHook();
|
|
64
59
|
this._initializeInstrumentations();
|
|
@@ -104,49 +99,25 @@ class TraceHandler {
|
|
|
104
99
|
return result;
|
|
105
100
|
};
|
|
106
101
|
httpinstrumentationOptions.ignoreOutgoingRequestHook = mergedIgnoreOutgoingRequestHook;
|
|
107
|
-
this._instrumentations.push(
|
|
102
|
+
this._instrumentations.push((0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "http", httpinstrumentationOptions, (options) => new instrumentation_http_1.HttpInstrumentation(options)));
|
|
108
103
|
}
|
|
109
104
|
if (this._config.instrumentationOptions.azureSdk?.enabled) {
|
|
110
|
-
const azureSdkInstrumentation = (0,
|
|
105
|
+
const azureSdkInstrumentation = (0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "azureSdk", this._config.instrumentationOptions.azureSdk, (options) => new azureSdkInstrumentation_js_1.AzureSdkInstrumentation(options));
|
|
111
106
|
this._instrumentations.push(azureSdkInstrumentation);
|
|
112
|
-
|
|
107
|
+
(0, azureSdkTracingBridge_js_1.ensureAzureSdkTracingBridge)(azureSdkInstrumentation);
|
|
113
108
|
}
|
|
114
109
|
if (this._config.instrumentationOptions.mongoDb?.enabled) {
|
|
115
|
-
this._instrumentations.push(
|
|
110
|
+
this._instrumentations.push((0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "mongoDb", this._config.instrumentationOptions.mongoDb, (options) => new instrumentation_mongodb_1.MongoDBInstrumentation(options)));
|
|
116
111
|
}
|
|
117
112
|
if (this._config.instrumentationOptions.mySql?.enabled) {
|
|
118
|
-
this._instrumentations.push(
|
|
113
|
+
this._instrumentations.push((0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "mySql", this._config.instrumentationOptions.mySql, (options) => new instrumentation_mysql_1.MySQLInstrumentation(options)));
|
|
119
114
|
}
|
|
120
115
|
if (this._config.instrumentationOptions.postgreSql?.enabled) {
|
|
121
|
-
this._instrumentations.push(
|
|
116
|
+
this._instrumentations.push((0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "postgreSql", this._config.instrumentationOptions.postgreSql, (options) => new instrumentation_pg_1.PgInstrumentation(options)));
|
|
122
117
|
}
|
|
123
118
|
if (this._config.instrumentationOptions.redis?.enabled ||
|
|
124
119
|
this._config.instrumentationOptions.redis4?.enabled) {
|
|
125
|
-
this._instrumentations.push(
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Wire the Azure SDK instrumenter into `@azure/core-tracing` directly.
|
|
130
|
-
*
|
|
131
|
-
* The Azure SDK instrumentation registers its instrumenter through an OpenTelemetry
|
|
132
|
-
* module-patch hook that only fires via `require`/`import`-in-the-middle. In ESM hosts
|
|
133
|
-
* where the OpenTelemetry loader cannot be registered up front (for example, Azure
|
|
134
|
-
* Functions, which controls the Node.js start command), that hook never runs, so Azure
|
|
135
|
-
* SDK dependency spans are missing. Because `@azure/core-tracing` resolves its
|
|
136
|
-
* instrumenter lazily at span-creation time from shared module-local state, applying
|
|
137
|
-
* the same patch directly here enables Azure SDK tracing regardless of module system.
|
|
138
|
-
*/
|
|
139
|
-
_wireAzureSdkInstrumenter(instrumentation) {
|
|
140
|
-
try {
|
|
141
|
-
const moduleDefinitions = instrumentation.getModuleDefinitions?.() ?? [];
|
|
142
|
-
for (const moduleDefinition of moduleDefinitions) {
|
|
143
|
-
if (moduleDefinition.name === "@azure/core-tracing" && moduleDefinition.patch) {
|
|
144
|
-
moduleDefinition.patch(coreTracing);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
index_js_1.Logger.getInstance().warn("Failed to enable Azure SDK tracing for ESM applications", error);
|
|
120
|
+
this._instrumentations.push((0, instrumentation_js_1.configureInstrumentation)(this.instrumentationCache, "redis", this._config.instrumentationOptions.redis ?? {}, (options) => new instrumentation_redis_1.RedisInstrumentation(options)));
|
|
150
121
|
}
|
|
151
122
|
}
|
|
152
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/traces/handler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,4GAA+F;AAC/F,yEAAmD;AACnD,0FAG+C;AAE/C,kEAA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D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CACzB,IAAI,sCAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,UAAU,CAAC,CACtE,CAAC;QACJ,CAAC;QACD,IACE,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO;YAClD,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,MAAM,EAAE,OAAO,EACnD,CAAC;YACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CACzB,IAAI,4CAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CACpE,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACK,yBAAyB,CAAC,eAAgC;QAChE,IAAI,CAAC;YACH,MAAM,iBAAiB,GAEnB,eAGD,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC;YACnC,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;gBACjD,IAAI,gBAAgB,CAAC,IAAI,KAAK,qBAAqB,IAAI,gBAAgB,CAAC,KAAK,EAAE,CAAC;oBAC9E,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAM,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,yDAAyD,EAAE,KAAK,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;CACF;AA3JD,oCA2JC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RequestOptions } from \"node:http\";\nimport { createAzureSdkInstrumentation } from \"@azure/opentelemetry-instrumentation-azure-sdk\";\nimport * as coreTracing from \"@azure/core-tracing\";\nimport {\n AzureMonitorTraceExporter,\n RateLimitedSampler,\n} from \"@azure/monitor-opentelemetry-exporter\";\nimport type { BufferConfig, Sampler } from \"@opentelemetry/sdk-trace-base\";\nimport { BatchSpanProcessor } from \"@opentelemetry/sdk-trace-base\";\nimport type {\n HttpInstrumentationConfig,\n IgnoreOutgoingRequestFunction,\n} from \"@opentelemetry/instrumentation-http\";\nimport { HttpInstrumentation } from \"@opentelemetry/instrumentation-http\";\nimport { MongoDBInstrumentation } from \"@opentelemetry/instrumentation-mongodb\";\nimport { MySQLInstrumentation } from \"@opentelemetry/instrumentation-mysql\";\nimport { PgInstrumentation } from \"@opentelemetry/instrumentation-pg\";\nimport { RedisInstrumentation } from \"@opentelemetry/instrumentation-redis\";\n\nimport type { InternalConfig } from \"../shared/config.js\";\nimport type { MetricHandler } from \"../metrics/handler.js\";\nimport { ignoreOutgoingRequestHook } from \"../utils/common.js\";\nimport { AzureMonitorSpanProcessor } from \"./spanProcessor.js\";\nimport { AzureFunctionsHook } from \"./azureFnHook.js\";\nimport type {\n Instrumentation,\n InstrumentationModuleDefinition,\n} from \"@opentelemetry/instrumentation\";\nimport { ApplicationInsightsSampler } from \"./sampler.js\";\nimport { Logger } from \"../shared/logging/index.js\";\n\n/**\n * Azure Monitor OpenTelemetry Trace Handler\n */\nexport class TraceHandler {\n private _batchSpanProcessor: BatchSpanProcessor;\n private _azureSpanProcessor: AzureMonitorSpanProcessor;\n private _azureExporter: AzureMonitorTraceExporter;\n private _instrumentations: Instrumentation[];\n private _config: InternalConfig;\n private _metricHandler: MetricHandler;\n private _azureFunctionsHook: AzureFunctionsHook;\n private _sampler: Sampler;\n\n /**\n * Initializes a new instance of the TraceHandler class.\n * @param _config - Configuration.\n * @param _metricHandler - MetricHandler.\n */\n constructor(config: InternalConfig, metricHandler: MetricHandler) {\n this._config = config;\n this._metricHandler = metricHandler;\n this._instrumentations = [];\n // Check sampler precedence\n if (this._config.sampler) {\n this._sampler = this._config.sampler;\n } else if (this._config.tracesPerSecond && this._config.tracesPerSecond > 0) {\n // If tracesPerSecond is set to a positive number, use RateLimitedSampler\n this._sampler = new RateLimitedSampler(this._config.tracesPerSecond);\n } else {\n // Otherwise, use PercentageSampler with samplingRatio\n this._sampler = new ApplicationInsightsSampler(this._config.samplingRatio);\n }\n this._azureExporter = new AzureMonitorTraceExporter(this._config.azureMonitorExporterOptions);\n const bufferConfig: BufferConfig = {\n maxExportBatchSize: 512,\n scheduledDelayMillis: 5000,\n exportTimeoutMillis: 30000,\n maxQueueSize: 2048,\n };\n this._batchSpanProcessor = new BatchSpanProcessor(this._azureExporter, bufferConfig);\n this._azureSpanProcessor = new AzureMonitorSpanProcessor(this._metricHandler);\n this._azureFunctionsHook = new AzureFunctionsHook();\n this._initializeInstrumentations();\n }\n\n public getSampler(): Sampler {\n return this._sampler;\n }\n\n public getBatchSpanProcessor(): BatchSpanProcessor {\n return this._batchSpanProcessor;\n }\n\n public getAzureMonitorSpanProcessor(): AzureMonitorSpanProcessor {\n return this._azureSpanProcessor;\n }\n\n public getInstrumentations(): Instrumentation[] {\n return this._instrumentations;\n }\n\n /**\n * Shutdown handler\n */\n public async shutdown(): Promise<void> {\n this._azureFunctionsHook.shutdown();\n await this._batchSpanProcessor.shutdown();\n await this._azureSpanProcessor.shutdown();\n await this._azureExporter.shutdown();\n }\n\n /**\n * Start auto collection of telemetry\n */\n private _initializeInstrumentations(): void {\n if (this._config.instrumentationOptions.http?.enabled) {\n const httpinstrumentationOptions = this._config.instrumentationOptions\n .http as HttpInstrumentationConfig;\n const providedIgnoreOutgoingRequestHook =\n httpinstrumentationOptions.ignoreOutgoingRequestHook;\n const mergedIgnoreOutgoingRequestHook: IgnoreOutgoingRequestFunction = (\n request: RequestOptions,\n ) => {\n const result = ignoreOutgoingRequestHook(request);\n if (!result) {\n // Not internal call\n if (providedIgnoreOutgoingRequestHook) {\n // Provided hook in config\n return providedIgnoreOutgoingRequestHook(request);\n }\n }\n return result;\n };\n httpinstrumentationOptions.ignoreOutgoingRequestHook = mergedIgnoreOutgoingRequestHook;\n this._instrumentations.push(\n new HttpInstrumentation(this._config.instrumentationOptions.http),\n );\n }\n if (this._config.instrumentationOptions.azureSdk?.enabled) {\n const azureSdkInstrumentation = createAzureSdkInstrumentation(\n this._config.instrumentationOptions.azureSdk,\n );\n this._instrumentations.push(azureSdkInstrumentation);\n this._wireAzureSdkInstrumenter(azureSdkInstrumentation);\n }\n if (this._config.instrumentationOptions.mongoDb?.enabled) {\n this._instrumentations.push(\n new MongoDBInstrumentation(this._config.instrumentationOptions.mongoDb),\n );\n }\n if (this._config.instrumentationOptions.mySql?.enabled) {\n this._instrumentations.push(\n new MySQLInstrumentation(this._config.instrumentationOptions.mySql),\n );\n }\n if (this._config.instrumentationOptions.postgreSql?.enabled) {\n this._instrumentations.push(\n new PgInstrumentation(this._config.instrumentationOptions.postgreSql),\n );\n }\n if (\n this._config.instrumentationOptions.redis?.enabled ||\n this._config.instrumentationOptions.redis4?.enabled\n ) {\n this._instrumentations.push(\n new RedisInstrumentation(this._config.instrumentationOptions.redis),\n );\n }\n }\n\n /**\n * Wire the Azure SDK instrumenter into `@azure/core-tracing` directly.\n *\n * The Azure SDK instrumentation registers its instrumenter through an OpenTelemetry\n * module-patch hook that only fires via `require`/`import`-in-the-middle. In ESM hosts\n * where the OpenTelemetry loader cannot be registered up front (for example, Azure\n * Functions, which controls the Node.js start command), that hook never runs, so Azure\n * SDK dependency spans are missing. Because `@azure/core-tracing` resolves its\n * instrumenter lazily at span-creation time from shared module-local state, applying\n * the same patch directly here enables Azure SDK tracing regardless of module system.\n */\n private _wireAzureSdkInstrumenter(instrumentation: Instrumentation): void {\n try {\n const moduleDefinitions =\n (\n instrumentation as Instrumentation & {\n getModuleDefinitions?: () => InstrumentationModuleDefinition[];\n }\n ).getModuleDefinitions?.() ?? [];\n for (const moduleDefinition of moduleDefinitions) {\n if (moduleDefinition.name === \"@azure/core-tracing\" && moduleDefinition.patch) {\n moduleDefinition.patch(coreTracing);\n }\n }\n } catch (error) {\n Logger.getInstance().warn(\"Failed to enable Azure SDK tracing for ESM applications\", error);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"handler.js","sourceR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,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YACvD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CACzB,IAAA,6CAAwB,EACtB,IAAI,CAAC,oBAAoB,EACzB,OAAO,EACP,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,EACzC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,4CAAoB,CAAC,OAAO,CAAC,CAC/C,CACF,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC;YAC5D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CACzB,IAAA,6CAAwB,EACtB,IAAI,CAAC,oBAAoB,EACzB,YAAY,EACZ,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,UAAU,EAC9C,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,sCAAiB,CAAC,OAAO,CAAC,CAC5C,CACF,CAAC;QACJ,CAAC;QACD,IACE,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO;YAClD,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,MAAM,EAAE,OAAO,EACnD,CAAC;YACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CACzB,IAAA,6CAAwB,EACtB,IAAI,CAAC,oBAAoB,EACzB,OAAO,EACP,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,EAAE,EAC/C,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,4CAAoB,CAAC,OAAO,CAAC,CAC/C,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAxJD,oCAwJC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RequestOptions } from \"node:http\";\nimport {\n AzureMonitorTraceExporter,\n RateLimitedSampler,\n} from \"@azure/monitor-opentelemetry-exporter\";\nimport type { Sampler } from \"@opentelemetry/sdk-trace-base\";\nimport { BatchSpanProcessor } from \"@opentelemetry/sdk-trace-base\";\nimport type {\n HttpInstrumentationConfig,\n IgnoreOutgoingRequestFunction,\n} from \"@opentelemetry/instrumentation-http\";\nimport { HttpInstrumentation } from \"@opentelemetry/instrumentation-http\";\nimport { MongoDBInstrumentation } from \"@opentelemetry/instrumentation-mongodb\";\nimport { MySQLInstrumentation } from \"@opentelemetry/instrumentation-mysql\";\nimport { PgInstrumentation } from \"@opentelemetry/instrumentation-pg\";\nimport { RedisInstrumentation } from \"@opentelemetry/instrumentation-redis\";\n\nimport type { InternalConfig } from \"../shared/config.js\";\nimport type { MetricHandler } from \"../metrics/handler.js\";\nimport { ignoreOutgoingRequestHook } from \"../utils/common.js\";\nimport { AzureMonitorSpanProcessor } from \"./spanProcessor.js\";\nimport { AzureFunctionsHook } from \"./azureFnHook.js\";\nimport type { Instrumentation } from \"@opentelemetry/instrumentation\";\nimport { ApplicationInsightsSampler } from \"./sampler.js\";\nimport { ensureAzureSdkTracingBridge } from \"../utils/azureSdkTracingBridge.js\";\nimport { configureInstrumentation } from \"../utils/instrumentation.js\";\nimport { AzureSdkInstrumentation } from \"./azureSdkInstrumentation.js\";\n\n/**\n * Azure Monitor OpenTelemetry Trace Handler\n */\nexport class TraceHandler {\n private _batchSpanProcessor: BatchSpanProcessor;\n private _azureSpanProcessor: AzureMonitorSpanProcessor;\n private _azureExporter: AzureMonitorTraceExporter;\n private _instrumentations: Instrumentation[];\n private _config: InternalConfig;\n private _metricHandler: MetricHandler;\n private _azureFunctionsHook: AzureFunctionsHook;\n private _sampler: Sampler;\n\n /**\n * Initializes a new instance of the TraceHandler class.\n * @param _config - Configuration.\n * @param _metricHandler - MetricHandler.\n */\n constructor(\n config: InternalConfig,\n metricHandler: MetricHandler,\n private readonly instrumentationCache?: Map<string, Instrumentation>,\n ) {\n this._config = config;\n this._metricHandler = metricHandler;\n this._instrumentations = [];\n // Check sampler precedence\n if (this._config.sampler) {\n this._sampler = this._config.sampler;\n } else if (this._config.tracesPerSecond && this._config.tracesPerSecond > 0) {\n // If tracesPerSecond is set to a positive number, use RateLimitedSampler\n this._sampler = new RateLimitedSampler(this._config.tracesPerSecond);\n } else {\n // Otherwise, use PercentageSampler with samplingRatio\n this._sampler = new ApplicationInsightsSampler(this._config.samplingRatio);\n }\n this._azureExporter = new AzureMonitorTraceExporter(this._config.azureMonitorExporterOptions);\n this._batchSpanProcessor = new BatchSpanProcessor(this._azureExporter);\n this._azureSpanProcessor = new AzureMonitorSpanProcessor(this._metricHandler);\n this._azureFunctionsHook = new AzureFunctionsHook();\n this._initializeInstrumentations();\n }\n\n public getSampler(): Sampler {\n return this._sampler;\n }\n\n public getBatchSpanProcessor(): BatchSpanProcessor {\n return this._batchSpanProcessor;\n }\n\n public getAzureMonitorSpanProcessor(): AzureMonitorSpanProcessor {\n return this._azureSpanProcessor;\n }\n\n public getInstrumentations(): Instrumentation[] {\n return this._instrumentations;\n }\n\n /**\n * Shutdown handler\n */\n public async shutdown(): Promise<void> {\n this._azureFunctionsHook.shutdown();\n await this._batchSpanProcessor.shutdown();\n await this._azureSpanProcessor.shutdown();\n await this._azureExporter.shutdown();\n }\n\n /**\n * Start auto collection of telemetry\n */\n private _initializeInstrumentations(): void {\n if (this._config.instrumentationOptions.http?.enabled) {\n const httpinstrumentationOptions = this._config.instrumentationOptions\n .http as HttpInstrumentationConfig;\n const providedIgnoreOutgoingRequestHook =\n httpinstrumentationOptions.ignoreOutgoingRequestHook;\n const mergedIgnoreOutgoingRequestHook: IgnoreOutgoingRequestFunction = (\n request: RequestOptions,\n ) => {\n const result = ignoreOutgoingRequestHook(request);\n if (!result) {\n // Not internal call\n if (providedIgnoreOutgoingRequestHook) {\n // Provided hook in config\n return providedIgnoreOutgoingRequestHook(request);\n }\n }\n return result;\n };\n httpinstrumentationOptions.ignoreOutgoingRequestHook = mergedIgnoreOutgoingRequestHook;\n this._instrumentations.push(\n configureInstrumentation(\n this.instrumentationCache,\n \"http\",\n httpinstrumentationOptions,\n (options) => new HttpInstrumentation(options),\n ),\n );\n }\n if (this._config.instrumentationOptions.azureSdk?.enabled) {\n const azureSdkInstrumentation = configureInstrumentation(\n this.instrumentationCache,\n \"azureSdk\",\n this._config.instrumentationOptions.azureSdk,\n (options) => new AzureSdkInstrumentation(options),\n );\n this._instrumentations.push(azureSdkInstrumentation);\n ensureAzureSdkTracingBridge(azureSdkInstrumentation);\n }\n if (this._config.instrumentationOptions.mongoDb?.enabled) {\n this._instrumentations.push(\n configureInstrumentation(\n this.instrumentationCache,\n \"mongoDb\",\n this._config.instrumentationOptions.mongoDb,\n (options) => new MongoDBInstrumentation(options),\n ),\n );\n }\n if (this._config.instrumentationOptions.mySql?.enabled) {\n this._instrumentations.push(\n configureInstrumentation(\n this.instrumentationCache,\n \"mySql\",\n this._config.instrumentationOptions.mySql,\n (options) => new MySQLInstrumentation(options),\n ),\n );\n }\n if (this._config.instrumentationOptions.postgreSql?.enabled) {\n this._instrumentations.push(\n configureInstrumentation(\n this.instrumentationCache,\n \"postgreSql\",\n this._config.instrumentationOptions.postgreSql,\n (options) => new PgInstrumentation(options),\n ),\n );\n }\n if (\n this._config.instrumentationOptions.redis?.enabled ||\n this._config.instrumentationOptions.redis4?.enabled\n ) {\n this._instrumentations.push(\n configureInstrumentation(\n this.instrumentationCache,\n \"redis\",\n this._config.instrumentationOptions.redis ?? {},\n (options) => new RedisInstrumentation(options),\n ),\n );\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler.js","sourceRoot":"","sources":["../../../src/traces/sampler.ts"],"names":[],"mappings":";;;AAOA,4CAA0C;AAE1C,kEAAiE;AACjE,0CAAqD;AAErD;;;;;GAKG;AACH,MAAa,0BAA0B;IACpB,WAAW,CAAS;IACpB,cAAc,CAAS;IAExC;;;OAGG;IACH,YAAY,gBAAwB,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,aAAa,CAA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AAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,uGAAuG;YACvG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,GAAG,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC;IAClC,CAAC;CACF;AA5FD,gEA4FC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * TODO: Remove this sampler in favor of the implementation in the AzMon Exporter once we support M2M approach for standard metrics.\n * This sampler specifically marks spans as sampled out and records them instead of dropping the span altogether.\n */\nimport type { Link, Attributes, SpanKind, Context } from \"@opentelemetry/api\";\nimport { diag } from \"@opentelemetry/api\";\nimport type { Sampler, SamplingResult } from \"@opentelemetry/sdk-trace-base\";\nimport { SamplingDecision } from \"@opentelemetry/sdk-trace-base\";\nimport { AzureMonitorSampleRate } from \"../types.js\";\n\n/**\n * ApplicationInsightsSampler is responsible for the following:\n * Implements same trace id hashing algorithm so that traces are sampled the same across multiple nodes\n * Adds item count to span attribute if span is sampled (needed for ingestion service)\n * @param samplingRatio - 0 to 1 value.\n */\nexport class ApplicationInsightsSampler implements Sampler {\n private readonly _sampleRate: number;\n private readonly _samplingRatio: number;\n\n /**\n * Initializes a new instance of the ApplicationInsightsSampler class.\n * @param samplingRatio - Value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out.\n */\n constructor(samplingRatio: number = 1) {\n this._samplingRatio = samplingRatio;\n if (\n this._samplingRatio > 1 ||\n this._samplingRatio < 0 ||\n !Number.isFinite(this._samplingRatio)\n ) {\n diag.warn(\"Invalid sampling rate, sampling rate must be a value in the range [0,1].\");\n }\n this._sampleRate = Math.round(this._samplingRatio * 100);\n }\n\n /**\n * Checks whether span needs to be created and tracked.\n *\n * @param context - Parent Context which may contain a span.\n * @param traceId - of the span to be created. It can be different from the\n * traceId in the {@link SpanContext}. Typically in situations when the\n * span to be created starts a new trace.\n * @param spanName - of the span to be created.\n * @param spanKind - of the span to be created.\n * @param attributes - Initial set of SpanAttributes for the Span being constructed.\n * @param links - Collection of links that will be associated with the Span to\n * be created. Typically useful for batch operations.\n * @returns a {@link SamplingResult}.\n */\n public shouldSample(\n // @ts-expect-error unused var\n context: Context,\n traceId: string,\n // @ts-expect-error unused var\n spanName: string,\n // @ts-expect-error unused var\n spanKind: SpanKind,\n attributes: Attributes,\n // @ts-expect-error unused var\n links: Link[],\n ): SamplingResult {\n let isSampledIn: boolean;\n if (this._sampleRate === 100) {\n isSampledIn = true;\n } else if (this._sampleRate === 0) {\n isSampledIn = false;\n } else {\n isSampledIn = this._getSamplingHashCode(traceId) < this._sampleRate;\n }\n // Add sample rate as span attribute if it is not 100\n attributes = attributes || {};\n if (this._sampleRate !== 100) {\n attributes[AzureMonitorSampleRate] = this._sampleRate;\n }\n return isSampledIn\n ? { decision: SamplingDecision.RECORD_AND_SAMPLED, attributes: attributes }\n : { decision: SamplingDecision.RECORD, attributes: attributes };\n }\n\n /**\n * Return Sampler description\n */\n public toString(): string {\n return `ApplicationInsightsSampler{${this._samplingRatio}}`;\n }\n\n private _getSamplingHashCode(input: string): number {\n const csharpMin = -2147483648;\n const csharpMax = 2147483647;\n let hash = 5381;\n\n if (!input) {\n return 0;\n }\n\n while (input.length < 8) {\n input = input + input;\n }\n\n for (let i = 0; i < input.length; i++) {\n // JS doesn't respond to integer overflow by wrapping around. Simulate it with bitwise operators ( | 0)\n hash = ((((hash << 5) + hash) | 0) + input.charCodeAt(i)) | 0;\n }\n\n hash = hash <= csharpMin ? csharpMax : Math.abs(hash);\n return (hash / csharpMax) * 100;\n }\n}\n"]}
|
package/dist/commonjs/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AzureMonitorExporterOptions } from "@azure/monitor-opentelemetry-exporter";
|
|
2
2
|
import type { InstrumentationConfig } from "@opentelemetry/instrumentation";
|
|
3
|
+
import type { SeverityNumber } from "@opentelemetry/api-logs";
|
|
3
4
|
import type { Resource } from "@opentelemetry/resources";
|
|
4
5
|
import type { LogRecordProcessor } from "@opentelemetry/sdk-logs";
|
|
5
6
|
import type { MetricReader, ViewOptions } from "@opentelemetry/sdk-metrics";
|
|
@@ -60,7 +61,15 @@ export interface InstrumentationOptions {
|
|
|
60
61
|
/** Winston Instrumentation Config */
|
|
61
62
|
winston?: InstrumentationConfig;
|
|
62
63
|
/** Console Instrumentation Config */
|
|
63
|
-
console?:
|
|
64
|
+
console?: ConsoleInstrumentationOptions;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Console Instrumentation Configuration interface
|
|
68
|
+
*/
|
|
69
|
+
export interface ConsoleInstrumentationOptions extends InstrumentationConfig {
|
|
70
|
+
/** The minimum severity of `console` calls to collect. Defaults to the value derived from the
|
|
71
|
+
* `APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL` environment variable. */
|
|
72
|
+
logSeverity?: SeverityNumber;
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
75
|
* Statsbeat Features Configuration interface
|
|
@@ -143,7 +152,7 @@ export interface BrowserSdkLoaderOptions {
|
|
|
143
152
|
/** Browser SDK Loader Connection String */
|
|
144
153
|
connectionString?: string;
|
|
145
154
|
}
|
|
146
|
-
export declare const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.
|
|
155
|
+
export declare const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.1";
|
|
147
156
|
export declare const AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES";
|
|
148
157
|
export declare const AZURE_MONITOR_PREFIX = "AZURE_MONITOR_PREFIX";
|
|
149
158
|
export declare const AZURE_MONITOR_AUTO_ATTACH = "AZURE_MONITOR_AUTO_ATTACH";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,2CAA2C;IAC3C,2BAA2B,CAAC,EAAE,2BAA2B,CAAC;IAC1D,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,yCAAyC;IACzC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mKAAmK;IACnK,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,+FAA+F;IAC/F,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,qEAAqE;IACrE,cAAc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S,YAAY;IACrB,MAAM,YAAY;IAClB,WAAW,aAAa;IACxB,GAAG,aAAa;IAChB,IAAI,aAAa;IACjB,OAAO,aAAa;IACpB,MAAM,cAAc;IACpB,OAAO,cAAc;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,qBA8BtC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAqCvC,CAAC;AAEH,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,OAAO,EAAE,gBAAgB,CAAC;CAC3B"}
|
package/dist/commonjs/types.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.StatsbeatFeaturesMap = new Map([
|
|
|
16
16
|
["multiIkey", 128],
|
|
17
17
|
["aksResourceDetectorPopulation", 256],
|
|
18
18
|
]);
|
|
19
|
-
exports.AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.
|
|
19
|
+
exports.AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.1";
|
|
20
20
|
exports.AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES";
|
|
21
21
|
exports.AZURE_MONITOR_PREFIX = "AZURE_MONITOR_PREFIX";
|
|
22
22
|
exports.AZURE_MONITOR_AUTO_ATTACH = "AZURE_MONITOR_AUTO_ATTACH";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAqFA;;;GAGG;AACU,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAAiB;IAC1D,CAAC,WAAW,EAAE,CAAC,CAAC;IAChB,CAAC,aAAa,EAAE,CAAC,CAAC;IAClB,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACvB,CAAC,QAAQ,EAAE,CAAC,CAAC;IACb,CAAC,aAAa,EAAE,EAAE,CAAC;IACnB,CAAC,MAAM,EAAE,EAAE,CAAC;IACZ,CAAC,kBAAkB,EAAE,EAAE,C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,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;IACvC,CAAC,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC;IACrC,CAAC,WAAW,EAAE,wBAAwB,CAAC,SAAS,CAAC;IACjD,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;IAC3C,CAAC,YAAY,EAAE,wBAAwB,CAAC,WAAW,CAAC;IACpD,CAAC,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC;IACrC,CAAC,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;IACvC,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;CAC5C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { AzureMonitorExporterOptions } from \"@azure/monitor-opentelemetry-exporter\";\nimport type { InstrumentationConfig } from \"@opentelemetry/instrumentation\";\nimport type { Resource } from \"@opentelemetry/resources\";\nimport type { LogRecordProcessor } from \"@opentelemetry/sdk-logs\";\nimport type { MetricReader, ViewOptions } from \"@opentelemetry/sdk-metrics\";\nimport type { SpanProcessor } from \"@opentelemetry/sdk-trace-base\";\n\n/**\n * Azure Monitor OpenTelemetry Options\n */\nexport interface AzureMonitorOpenTelemetryOptions {\n /** Azure Monitor Exporter Configuration */\n azureMonitorExporterOptions?: AzureMonitorExporterOptions;\n /** OpenTelemetry Resource */\n resource?: Resource;\n /** The rate of telemetry items tracked that should be transmitted (Default 1.0) */\n samplingRatio?: number;\n /** The maximum number of traces to sample per second (Default 5). Set to 0 to use samplingRatio instead. */\n tracesPerSecond?: number;\n /** Enable Live Metrics feature (Default false)*/\n enableLiveMetrics?: boolean;\n /** Enable Standard Metrics feature (Default true)*/\n enableStandardMetrics?: boolean;\n /** Enable log sampling based on trace (Default true) */\n enableTraceBasedSamplingForLogs?: boolean;\n /** Enable Performance Counter feature */\n enablePerformanceCounters?: boolean;\n /** OpenTelemetry Instrumentations options included as part of Azure Monitor. See {@link InstrumentationOptions} for the full set of supported instrumentations. */\n instrumentationOptions?: InstrumentationOptions;\n /** Application Insights Web Instrumentation options (enabled, connectionString, src, config)*/\n browserSdkLoaderOptions?: BrowserSdkLoaderOptions;\n /** An array of log record processors to register to the logger provider.*/\n logRecordProcessors?: LogRecordProcessor[];\n /** An array of span processors to register to the tracer provider.*/\n spanProcessors?: SpanProcessor[];\n /** An array of metric readers to register to the meter provider.*/\n metricReaders?: MetricReader[];\n /** An array of metric views to register to the meter provider.*/\n views?: ViewOptions[];\n}\n\n/**\n * OpenTelemetry Instrumentations Configuration interface\n */\nexport interface InstrumentationOptions {\n /** Azure SDK Instrumentation Config */\n azureSdk?: InstrumentationConfig;\n /** HTTP Instrumentation Config */\n http?: InstrumentationConfig;\n /** MongoDB Instrumentation Config */\n mongoDb?: InstrumentationConfig;\n /** MySQL Instrumentation Config */\n mySql?: InstrumentationConfig;\n /** PostgreSql Instrumentation Config */\n postgreSql?: InstrumentationConfig;\n /** Redis Instrumentation Config */\n redis?: InstrumentationConfig;\n /** Redis4 Instrumentation Config */\n redis4?: InstrumentationConfig;\n /** Bunyan Instrumentation Config */\n bunyan?: InstrumentationConfig;\n /** Winston Instrumentation Config */\n winston?: InstrumentationConfig;\n /** Console Instrumentation Config */\n console?: InstrumentationConfig;\n}\n\n/**\n * Statsbeat Features Configuration interface\n * @internal\n */\nexport interface StatsbeatFeatures {\n diskRetry?: boolean;\n aadHandling?: boolean;\n browserSdkLoader?: boolean;\n distro?: boolean;\n liveMetrics?: boolean;\n shim?: boolean;\n customerSdkStats?: boolean;\n multiIkey?: boolean;\n aksResourceDetectorPopulation?: boolean;\n}\n\n/**\n * Statsbeat Features Mapping\n * @internal\n */\nexport const StatsbeatFeaturesMap = new Map<string, number>([\n [\"diskRetry\", 1],\n [\"aadHandling\", 2],\n [\"browserSdkLoader\", 4],\n [\"distro\", 8],\n [\"liveMetrics\", 16],\n [\"shim\", 32],\n [\"customerSdkStats\", 64],\n [\"multiIkey\", 128],\n [\"aksResourceDetectorPopulation\", 256],\n]);\n\n/**\n * Statsbeat Instrumentations Configuration interface\n * @internal\n */\nexport interface StatsbeatInstrumentations {\n /** Azure Monitor Supported Instrumentations */\n azureSdk?: boolean;\n mongoDb?: boolean;\n mySql?: boolean;\n postgreSql?: boolean;\n redis?: boolean;\n bunyan?: boolean;\n winston?: boolean;\n console?: boolean;\n /** OpenTelemetry Community Instrumentations */\n amqplib?: boolean;\n cucumber?: boolean;\n dataloader?: boolean;\n fs?: boolean;\n lruMemoizer?: boolean;\n mongoose?: boolean;\n runtimeNode?: boolean;\n socketIo?: boolean;\n tedious?: boolean;\n undici?: boolean;\n cassandra?: boolean;\n connect?: boolean;\n dns?: boolean;\n express?: boolean;\n fastify?: boolean;\n genericPool?: boolean;\n graphql?: boolean;\n hapi?: boolean;\n ioredis?: boolean;\n knex?: boolean;\n koa?: boolean;\n memcached?: boolean;\n mysql2?: boolean;\n nestjsCore?: boolean;\n net?: boolean;\n pino?: boolean;\n restify?: boolean;\n router?: boolean;\n}\n\n/**\n * Statsbeat Instrumentation and Feature Option interface\n * @internal\n */\nexport interface StatsbeatOption {\n option: string;\n value: boolean;\n}\n\n/**\n * Application Insights Web Instrumentation Configuration interface\n */\nexport interface BrowserSdkLoaderOptions {\n /** Browser SDK Loader Enable */\n enabled?: boolean;\n /** Browser SDK Loader Connection String */\n connectionString?: string;\n}\n\nexport const AZURE_MONITOR_OPENTELEMETRY_VERSION = \"1.19.0\";\nexport const AZURE_MONITOR_STATSBEAT_FEATURES = \"AZURE_MONITOR_STATSBEAT_FEATURES\";\nexport const AZURE_MONITOR_PREFIX = \"AZURE_MONITOR_PREFIX\";\nexport const AZURE_MONITOR_AUTO_ATTACH = \"AZURE_MONITOR_AUTO_ATTACH\";\nexport const APPLICATION_INSIGHTS_SHIM_VERSION = \"APPLICATION_INSIGHTS_SHIM_VERSION\";\nexport const APPLICATIONINSIGHTS_AUTHENTICATION_STRING =\n \"APPLICATIONINSIGHTS_AUTHENTICATION_STRING\";\n\nexport enum AttachTypePrefix {\n INTEGRATED_AUTO = \"i\",\n MANUAL = \"m\",\n}\n\n/**\n * Default Browser SDK Loader Source\n * @internal\n */\nexport const BROWSER_SDK_LOADER_DEFAULT_SOURCE = \"https://js.monitor.azure.com/scripts/b/ai\";\n\n/**\n * Default Breeze endpoint.\n * @internal\n */\nexport const DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\n/**\n * Default Live Metrics endpoint.\n * @internal\n */\nexport const DEFAULT_LIVEMETRICS_ENDPOINT = \"https://global.livediagnostics.monitor.azure.com\";\n\n/**\n * Internal attribute name for sample rate\n * @internal\n */\nexport const AzureMonitorSampleRate = \"microsoft.sample_rate\";\n\n/**\n * Disables customer-facing SDK Stats.\n * @internal\n */\nexport const APPLICATIONINSIGHTS_SDKSTATS_DISABLED = \"APPLICATIONINSIGHTS_SDKSTATS_DISABLED\";\n\nexport enum StatsbeatFeature {\n NONE = 0,\n DISK_RETRY = 1,\n AAD_HANDLING = 2,\n BROWSER_SDK_LOADER = 4,\n DISTRO = 8,\n LIVE_METRICS = 16,\n SHIM = 32,\n CUSTOMER_SDKSTATS = 64,\n MULTI_IKEY = 128,\n AKS_RESOURCE_DETECTOR_POPULATION = 256,\n}\n\nexport enum StatsbeatInstrumentation {\n /** Azure Monitor Supported Instrumentations */\n NONE = 0,\n AZURE_CORE_TRACING = 1,\n MONGODB = 2,\n MYSQL = 4,\n REDIS = 8,\n POSTGRES = 16,\n BUNYAN = 32,\n WINSTON = 64,\n CONSOLE = 128,\n /** OpenTelemetry Supported Instrumentations */\n CUCUMBER = 256,\n DATALOADER = 512,\n FS = 1024,\n LRU_MEMOIZER = 2048,\n MONGOOSE = 4096,\n RUNTIME_NODE = 8192,\n SOCKET_IO = 16384,\n TEDIOUS = 32768,\n UNDICI = 65536,\n CASSANDRA = 131072,\n CONNECT = 262144,\n DNS = 524288,\n EXPRESS = 1048576,\n FASTIFY = 2097152,\n GENERIC_POOL = 4194304,\n GRAPHQL = 8388608,\n HAPI = 16777216,\n IOREDIS = 33554432,\n KNEX = 67108864,\n KOA = 134217728,\n MEMCACHED = 268435456,\n MYSQL2 = 536870912,\n NESTJS_CORE = 1073741824,\n NET = 2147483648,\n PINO = 4294967296,\n RESTIFY = 8589934592,\n ROUTER = 17179869184,\n AMQPLIB = 34359738368,\n}\n\n/**\n * Statsbeat Instrumentation Mapping\n * @internal\n */\nexport const StatsbeatInstrumentationMap = new Map<string, number>([\n [\"@opentelemetry/instrumentation-console\", StatsbeatInstrumentation.CONSOLE],\n [\"@opentelemetry/instrumentation-amqplib\", StatsbeatInstrumentation.AMQPLIB],\n [\"@opentelemetry/instrumentation-cucumber\", StatsbeatInstrumentation.CUCUMBER],\n [\"@opentelemetry/instrumentation-dataloader\", StatsbeatInstrumentation.DATALOADER],\n [\"@opentelemetry/instrumentation-fs\", StatsbeatInstrumentation.FS],\n [\"@opentelemetry/instrumentation-lru-memoizer\", StatsbeatInstrumentation.LRU_MEMOIZER],\n [\"@opentelemetry/instrumentation-mongoose\", StatsbeatInstrumentation.MONGOOSE],\n [\"@opentelemetry/instrumentation-runtime-node\", StatsbeatInstrumentation.RUNTIME_NODE],\n [\"@opentelemetry/instrumentation-socket.io\", StatsbeatInstrumentation.SOCKET_IO],\n [\"@opentelemetry/instrumentation-tedious\", StatsbeatInstrumentation.TEDIOUS],\n [\"@opentelemetry/instrumentation-undici\", StatsbeatInstrumentation.UNDICI],\n [\"@opentelemetry/instrumentation-cassandra-driver\", StatsbeatInstrumentation.CASSANDRA],\n [\"@opentelemetry/instrumentation-connect\", StatsbeatInstrumentation.CONNECT],\n [\"@opentelemetry/instrumentation-dns\", StatsbeatInstrumentation.DNS],\n [\"@opentelemetry/instrumentation-express\", StatsbeatInstrumentation.EXPRESS],\n [\"@opentelemetry/instrumentation-fastify\", StatsbeatInstrumentation.FASTIFY],\n [\"@opentelemetry/instrumentation-generic-pool\", StatsbeatInstrumentation.GENERIC_POOL],\n [\"@opentelemetry/instrumentation-graphql\", StatsbeatInstrumentation.GRAPHQL],\n [\"@opentelemetry/instrumentation-hapi\", StatsbeatInstrumentation.HAPI],\n [\"@opentelemetry/instrumentation-ioredis\", StatsbeatInstrumentation.IOREDIS],\n [\"@opentelemetry/instrumentation-knex\", StatsbeatInstrumentation.KNEX],\n [\"@opentelemetry/instrumentation-koa\", StatsbeatInstrumentation.KOA],\n [\"@opentelemetry/instrumentation-memcached\", StatsbeatInstrumentation.MEMCACHED],\n [\"@opentelemetry/instrumentation-mysql2\", StatsbeatInstrumentation.MYSQL2],\n [\"@opentelemetry/instrumentation-nestjs-core\", StatsbeatInstrumentation.NESTJS_CORE],\n [\"@opentelemetry/instrumentation-net\", StatsbeatInstrumentation.NET],\n [\"@opentelemetry/instrumentation-pino\", StatsbeatInstrumentation.PINO],\n [\"@opentelemetry/instrumentation-restify\", StatsbeatInstrumentation.RESTIFY],\n [\"@opentelemetry/instrumentation-router\", StatsbeatInstrumentation.ROUTER],\n]);\n\n/**\n * Maps Statsbeat instrumentation option names to their assigned bits.\n * @internal\n */\nexport const StatsbeatInstrumentationsMap = new Map<string, number>([\n [\"azureSdk\", StatsbeatInstrumentation.AZURE_CORE_TRACING],\n [\"mongoDb\", StatsbeatInstrumentation.MONGODB],\n [\"mySql\", StatsbeatInstrumentation.MYSQL],\n [\"postgreSql\", StatsbeatInstrumentation.POSTGRES],\n [\"redis\", StatsbeatInstrumentation.REDIS],\n [\"bunyan\", StatsbeatInstrumentation.BUNYAN],\n [\"winston\", StatsbeatInstrumentation.WINSTON],\n [\"console\", StatsbeatInstrumentation.CONSOLE],\n [\"amqplib\", StatsbeatInstrumentation.AMQPLIB],\n [\"cucumber\", StatsbeatInstrumentation.CUCUMBER],\n [\"dataloader\", StatsbeatInstrumentation.DATALOADER],\n [\"fs\", StatsbeatInstrumentation.FS],\n [\"lruMemoizer\", StatsbeatInstrumentation.LRU_MEMOIZER],\n [\"mongoose\", StatsbeatInstrumentation.MONGOOSE],\n [\"runtimeNode\", StatsbeatInstrumentation.RUNTIME_NODE],\n [\"socketIo\", StatsbeatInstrumentation.SOCKET_IO],\n [\"tedious\", StatsbeatInstrumentation.TEDIOUS],\n [\"undici\", StatsbeatInstrumentation.UNDICI],\n [\"cassandra\", StatsbeatInstrumentation.CASSANDRA],\n [\"connect\", StatsbeatInstrumentation.CONNECT],\n [\"dns\", StatsbeatInstrumentation.DNS],\n [\"express\", StatsbeatInstrumentation.EXPRESS],\n [\"fastify\", StatsbeatInstrumentation.FASTIFY],\n [\"genericPool\", StatsbeatInstrumentation.GENERIC_POOL],\n [\"graphql\", StatsbeatInstrumentation.GRAPHQL],\n [\"hapi\", StatsbeatInstrumentation.HAPI],\n [\"ioredis\", StatsbeatInstrumentation.IOREDIS],\n [\"knex\", StatsbeatInstrumentation.KNEX],\n [\"koa\", StatsbeatInstrumentation.KOA],\n [\"memcached\", StatsbeatInstrumentation.MEMCACHED],\n [\"mysql2\", StatsbeatInstrumentation.MYSQL2],\n [\"nestjsCore\", StatsbeatInstrumentation.NESTJS_CORE],\n [\"net\", StatsbeatInstrumentation.NET],\n [\"pino\", StatsbeatInstrumentation.PINO],\n [\"restify\", StatsbeatInstrumentation.RESTIFY],\n [\"router\", StatsbeatInstrumentation.ROUTER],\n]);\n\nexport interface StatsbeatEnvironmentConfig {\n instrumentation: StatsbeatInstrumentation;\n feature: StatsbeatFeature;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AA+FA;;;GAGG;AACU,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAAiB;IAC1D,CAAC,WAAW,EAAE,CAAC,CAAC;IAChB,CAAC,aAAa,EAAE,CAAC,CAAC;IAClB,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACvB,CAAC,QAAQ,EAAE,CAAC,CA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,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;IACvC,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;IACvC,CAAC,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC;IACrC,CAAC,WAAW,EAAE,wBAAwB,CAAC,SAAS,CAAC;IACjD,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;IAC3C,CAAC,YAAY,EAAE,wBAAwB,CAAC,WAAW,CAAC;IACpD,CAAC,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC;IACrC,CAAC,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC;IACvC,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;CAC5C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { AzureMonitorExporterOptions } from \"@azure/monitor-opentelemetry-exporter\";\nimport type { InstrumentationConfig } from \"@opentelemetry/instrumentation\";\nimport type { SeverityNumber } from \"@opentelemetry/api-logs\";\nimport type { Resource } from \"@opentelemetry/resources\";\nimport type { LogRecordProcessor } from \"@opentelemetry/sdk-logs\";\nimport type { MetricReader, ViewOptions } from \"@opentelemetry/sdk-metrics\";\nimport type { SpanProcessor } from \"@opentelemetry/sdk-trace-base\";\n\n/**\n * Azure Monitor OpenTelemetry Options\n */\nexport interface AzureMonitorOpenTelemetryOptions {\n /** Azure Monitor Exporter Configuration */\n azureMonitorExporterOptions?: AzureMonitorExporterOptions;\n /** OpenTelemetry Resource */\n resource?: Resource;\n /** The rate of telemetry items tracked that should be transmitted (Default 1.0) */\n samplingRatio?: number;\n /** The maximum number of traces to sample per second (Default 5). Set to 0 to use samplingRatio instead. */\n tracesPerSecond?: number;\n /** Enable Live Metrics feature (Default false)*/\n enableLiveMetrics?: boolean;\n /** Enable Standard Metrics feature (Default true)*/\n enableStandardMetrics?: boolean;\n /** Enable log sampling based on trace (Default true) */\n enableTraceBasedSamplingForLogs?: boolean;\n /** Enable Performance Counter feature */\n enablePerformanceCounters?: boolean;\n /** OpenTelemetry Instrumentations options included as part of Azure Monitor. See {@link InstrumentationOptions} for the full set of supported instrumentations. */\n instrumentationOptions?: InstrumentationOptions;\n /** Application Insights Web Instrumentation options (enabled, connectionString, src, config)*/\n browserSdkLoaderOptions?: BrowserSdkLoaderOptions;\n /** An array of log record processors to register to the logger provider.*/\n logRecordProcessors?: LogRecordProcessor[];\n /** An array of span processors to register to the tracer provider.*/\n spanProcessors?: SpanProcessor[];\n /** An array of metric readers to register to the meter provider.*/\n metricReaders?: MetricReader[];\n /** An array of metric views to register to the meter provider.*/\n views?: ViewOptions[];\n}\n\n/**\n * OpenTelemetry Instrumentations Configuration interface\n */\nexport interface InstrumentationOptions {\n /** Azure SDK Instrumentation Config */\n azureSdk?: InstrumentationConfig;\n /** HTTP Instrumentation Config */\n http?: InstrumentationConfig;\n /** MongoDB Instrumentation Config */\n mongoDb?: InstrumentationConfig;\n /** MySQL Instrumentation Config */\n mySql?: InstrumentationConfig;\n /** PostgreSql Instrumentation Config */\n postgreSql?: InstrumentationConfig;\n /** Redis Instrumentation Config */\n redis?: InstrumentationConfig;\n /** Redis4 Instrumentation Config */\n redis4?: InstrumentationConfig;\n /** Bunyan Instrumentation Config */\n bunyan?: InstrumentationConfig;\n /** Winston Instrumentation Config */\n winston?: InstrumentationConfig;\n /** Console Instrumentation Config */\n console?: ConsoleInstrumentationOptions;\n}\n\n/**\n * Console Instrumentation Configuration interface\n */\nexport interface ConsoleInstrumentationOptions extends InstrumentationConfig {\n /** The minimum severity of `console` calls to collect. Defaults to the value derived from the\n * `APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL` environment variable. */\n logSeverity?: SeverityNumber;\n}\n\n/**\n * Statsbeat Features Configuration interface\n * @internal\n */\nexport interface StatsbeatFeatures {\n diskRetry?: boolean;\n aadHandling?: boolean;\n browserSdkLoader?: boolean;\n distro?: boolean;\n liveMetrics?: boolean;\n shim?: boolean;\n customerSdkStats?: boolean;\n multiIkey?: boolean;\n aksResourceDetectorPopulation?: boolean;\n}\n\n/**\n * Statsbeat Features Mapping\n * @internal\n */\nexport const StatsbeatFeaturesMap = new Map<string, number>([\n [\"diskRetry\", 1],\n [\"aadHandling\", 2],\n [\"browserSdkLoader\", 4],\n [\"distro\", 8],\n [\"liveMetrics\", 16],\n [\"shim\", 32],\n [\"customerSdkStats\", 64],\n [\"multiIkey\", 128],\n [\"aksResourceDetectorPopulation\", 256],\n]);\n\n/**\n * Statsbeat Instrumentations Configuration interface\n * @internal\n */\nexport interface StatsbeatInstrumentations {\n /** Azure Monitor Supported Instrumentations */\n azureSdk?: boolean;\n mongoDb?: boolean;\n mySql?: boolean;\n postgreSql?: boolean;\n redis?: boolean;\n bunyan?: boolean;\n winston?: boolean;\n console?: boolean;\n /** OpenTelemetry Community Instrumentations */\n amqplib?: boolean;\n cucumber?: boolean;\n dataloader?: boolean;\n fs?: boolean;\n lruMemoizer?: boolean;\n mongoose?: boolean;\n runtimeNode?: boolean;\n socketIo?: boolean;\n tedious?: boolean;\n undici?: boolean;\n cassandra?: boolean;\n connect?: boolean;\n dns?: boolean;\n express?: boolean;\n fastify?: boolean;\n genericPool?: boolean;\n graphql?: boolean;\n hapi?: boolean;\n ioredis?: boolean;\n knex?: boolean;\n koa?: boolean;\n memcached?: boolean;\n mysql2?: boolean;\n nestjsCore?: boolean;\n net?: boolean;\n pino?: boolean;\n restify?: boolean;\n router?: boolean;\n}\n\n/**\n * Statsbeat Instrumentation and Feature Option interface\n * @internal\n */\nexport interface StatsbeatOption {\n option: string;\n value: boolean;\n}\n\n/**\n * Application Insights Web Instrumentation Configuration interface\n */\nexport interface BrowserSdkLoaderOptions {\n /** Browser SDK Loader Enable */\n enabled?: boolean;\n /** Browser SDK Loader Connection String */\n connectionString?: string;\n}\n\nexport const AZURE_MONITOR_OPENTELEMETRY_VERSION = \"1.20.1\";\nexport const AZURE_MONITOR_STATSBEAT_FEATURES = \"AZURE_MONITOR_STATSBEAT_FEATURES\";\nexport const AZURE_MONITOR_PREFIX = \"AZURE_MONITOR_PREFIX\";\nexport const AZURE_MONITOR_AUTO_ATTACH = \"AZURE_MONITOR_AUTO_ATTACH\";\nexport const APPLICATION_INSIGHTS_SHIM_VERSION = \"APPLICATION_INSIGHTS_SHIM_VERSION\";\nexport const APPLICATIONINSIGHTS_AUTHENTICATION_STRING =\n \"APPLICATIONINSIGHTS_AUTHENTICATION_STRING\";\n\nexport enum AttachTypePrefix {\n INTEGRATED_AUTO = \"i\",\n MANUAL = \"m\",\n}\n\n/**\n * Default Browser SDK Loader Source\n * @internal\n */\nexport const BROWSER_SDK_LOADER_DEFAULT_SOURCE = \"https://js.monitor.azure.com/scripts/b/ai\";\n\n/**\n * Default Breeze endpoint.\n * @internal\n */\nexport const DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\n/**\n * Default Live Metrics endpoint.\n * @internal\n */\nexport const DEFAULT_LIVEMETRICS_ENDPOINT = \"https://global.livediagnostics.monitor.azure.com\";\n\n/**\n * Internal attribute name for sample rate\n * @internal\n */\nexport const AzureMonitorSampleRate = \"microsoft.sample_rate\";\n\n/**\n * Disables customer-facing SDK Stats.\n * @internal\n */\nexport const APPLICATIONINSIGHTS_SDKSTATS_DISABLED = \"APPLICATIONINSIGHTS_SDKSTATS_DISABLED\";\n\nexport enum StatsbeatFeature {\n NONE = 0,\n DISK_RETRY = 1,\n AAD_HANDLING = 2,\n BROWSER_SDK_LOADER = 4,\n DISTRO = 8,\n LIVE_METRICS = 16,\n SHIM = 32,\n CUSTOMER_SDKSTATS = 64,\n MULTI_IKEY = 128,\n AKS_RESOURCE_DETECTOR_POPULATION = 256,\n}\n\nexport enum StatsbeatInstrumentation {\n /** Azure Monitor Supported Instrumentations */\n NONE = 0,\n AZURE_CORE_TRACING = 1,\n MONGODB = 2,\n MYSQL = 4,\n REDIS = 8,\n POSTGRES = 16,\n BUNYAN = 32,\n WINSTON = 64,\n CONSOLE = 128,\n /** OpenTelemetry Supported Instrumentations */\n CUCUMBER = 256,\n DATALOADER = 512,\n FS = 1024,\n LRU_MEMOIZER = 2048,\n MONGOOSE = 4096,\n RUNTIME_NODE = 8192,\n SOCKET_IO = 16384,\n TEDIOUS = 32768,\n UNDICI = 65536,\n CASSANDRA = 131072,\n CONNECT = 262144,\n DNS = 524288,\n EXPRESS = 1048576,\n FASTIFY = 2097152,\n GENERIC_POOL = 4194304,\n GRAPHQL = 8388608,\n HAPI = 16777216,\n IOREDIS = 33554432,\n KNEX = 67108864,\n KOA = 134217728,\n MEMCACHED = 268435456,\n MYSQL2 = 536870912,\n NESTJS_CORE = 1073741824,\n NET = 2147483648,\n PINO = 4294967296,\n RESTIFY = 8589934592,\n ROUTER = 17179869184,\n AMQPLIB = 34359738368,\n}\n\n/**\n * Statsbeat Instrumentation Mapping\n * @internal\n */\nexport const StatsbeatInstrumentationMap = new Map<string, number>([\n [\"@opentelemetry/instrumentation-console\", StatsbeatInstrumentation.CONSOLE],\n [\"@opentelemetry/instrumentation-amqplib\", StatsbeatInstrumentation.AMQPLIB],\n [\"@opentelemetry/instrumentation-cucumber\", StatsbeatInstrumentation.CUCUMBER],\n [\"@opentelemetry/instrumentation-dataloader\", StatsbeatInstrumentation.DATALOADER],\n [\"@opentelemetry/instrumentation-fs\", StatsbeatInstrumentation.FS],\n [\"@opentelemetry/instrumentation-lru-memoizer\", StatsbeatInstrumentation.LRU_MEMOIZER],\n [\"@opentelemetry/instrumentation-mongoose\", StatsbeatInstrumentation.MONGOOSE],\n [\"@opentelemetry/instrumentation-runtime-node\", StatsbeatInstrumentation.RUNTIME_NODE],\n [\"@opentelemetry/instrumentation-socket.io\", StatsbeatInstrumentation.SOCKET_IO],\n [\"@opentelemetry/instrumentation-tedious\", StatsbeatInstrumentation.TEDIOUS],\n [\"@opentelemetry/instrumentation-undici\", StatsbeatInstrumentation.UNDICI],\n [\"@opentelemetry/instrumentation-cassandra-driver\", StatsbeatInstrumentation.CASSANDRA],\n [\"@opentelemetry/instrumentation-connect\", StatsbeatInstrumentation.CONNECT],\n [\"@opentelemetry/instrumentation-dns\", StatsbeatInstrumentation.DNS],\n [\"@opentelemetry/instrumentation-express\", StatsbeatInstrumentation.EXPRESS],\n [\"@opentelemetry/instrumentation-fastify\", StatsbeatInstrumentation.FASTIFY],\n [\"@opentelemetry/instrumentation-generic-pool\", StatsbeatInstrumentation.GENERIC_POOL],\n [\"@opentelemetry/instrumentation-graphql\", StatsbeatInstrumentation.GRAPHQL],\n [\"@opentelemetry/instrumentation-hapi\", StatsbeatInstrumentation.HAPI],\n [\"@opentelemetry/instrumentation-ioredis\", StatsbeatInstrumentation.IOREDIS],\n [\"@opentelemetry/instrumentation-knex\", StatsbeatInstrumentation.KNEX],\n [\"@opentelemetry/instrumentation-koa\", StatsbeatInstrumentation.KOA],\n [\"@opentelemetry/instrumentation-memcached\", StatsbeatInstrumentation.MEMCACHED],\n [\"@opentelemetry/instrumentation-mysql2\", StatsbeatInstrumentation.MYSQL2],\n [\"@opentelemetry/instrumentation-nestjs-core\", StatsbeatInstrumentation.NESTJS_CORE],\n [\"@opentelemetry/instrumentation-net\", StatsbeatInstrumentation.NET],\n [\"@opentelemetry/instrumentation-pino\", StatsbeatInstrumentation.PINO],\n [\"@opentelemetry/instrumentation-restify\", StatsbeatInstrumentation.RESTIFY],\n [\"@opentelemetry/instrumentation-router\", StatsbeatInstrumentation.ROUTER],\n]);\n\n/**\n * Maps Statsbeat instrumentation option names to their assigned bits.\n * @internal\n */\nexport const StatsbeatInstrumentationsMap = new Map<string, number>([\n [\"azureSdk\", StatsbeatInstrumentation.AZURE_CORE_TRACING],\n [\"mongoDb\", StatsbeatInstrumentation.MONGODB],\n [\"mySql\", StatsbeatInstrumentation.MYSQL],\n [\"postgreSql\", StatsbeatInstrumentation.POSTGRES],\n [\"redis\", StatsbeatInstrumentation.REDIS],\n [\"bunyan\", StatsbeatInstrumentation.BUNYAN],\n [\"winston\", StatsbeatInstrumentation.WINSTON],\n [\"console\", StatsbeatInstrumentation.CONSOLE],\n [\"amqplib\", StatsbeatInstrumentation.AMQPLIB],\n [\"cucumber\", StatsbeatInstrumentation.CUCUMBER],\n [\"dataloader\", StatsbeatInstrumentation.DATALOADER],\n [\"fs\", StatsbeatInstrumentation.FS],\n [\"lruMemoizer\", StatsbeatInstrumentation.LRU_MEMOIZER],\n [\"mongoose\", StatsbeatInstrumentation.MONGOOSE],\n [\"runtimeNode\", StatsbeatInstrumentation.RUNTIME_NODE],\n [\"socketIo\", StatsbeatInstrumentation.SOCKET_IO],\n [\"tedious\", StatsbeatInstrumentation.TEDIOUS],\n [\"undici\", StatsbeatInstrumentation.UNDICI],\n [\"cassandra\", StatsbeatInstrumentation.CASSANDRA],\n [\"connect\", StatsbeatInstrumentation.CONNECT],\n [\"dns\", StatsbeatInstrumentation.DNS],\n [\"express\", StatsbeatInstrumentation.EXPRESS],\n [\"fastify\", StatsbeatInstrumentation.FASTIFY],\n [\"genericPool\", StatsbeatInstrumentation.GENERIC_POOL],\n [\"graphql\", StatsbeatInstrumentation.GRAPHQL],\n [\"hapi\", StatsbeatInstrumentation.HAPI],\n [\"ioredis\", StatsbeatInstrumentation.IOREDIS],\n [\"knex\", StatsbeatInstrumentation.KNEX],\n [\"koa\", StatsbeatInstrumentation.KOA],\n [\"memcached\", StatsbeatInstrumentation.MEMCACHED],\n [\"mysql2\", StatsbeatInstrumentation.MYSQL2],\n [\"nestjsCore\", StatsbeatInstrumentation.NESTJS_CORE],\n [\"net\", StatsbeatInstrumentation.NET],\n [\"pino\", StatsbeatInstrumentation.PINO],\n [\"restify\", StatsbeatInstrumentation.RESTIFY],\n [\"router\", StatsbeatInstrumentation.ROUTER],\n]);\n\nexport interface StatsbeatEnvironmentConfig {\n instrumentation: StatsbeatInstrumentation;\n feature: StatsbeatFeature;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Instrumentation } from "@opentelemetry/instrumentation";
|
|
1
2
|
/**
|
|
2
3
|
* Eagerly installs the OpenTelemetry bridge for \@azure/core-tracing.
|
|
3
4
|
*
|
|
@@ -8,11 +9,10 @@
|
|
|
8
9
|
* imported \@azure/ai-projects or any other Azure SDK package first), the hook
|
|
9
10
|
* never fires, and Azure SDK spans are silently dropped.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* patches the already-loaded \@azure/core-tracing singleton state.
|
|
12
|
+
* Apply the registered instrumentation's patch so the eager bridge follows the
|
|
13
|
+
* same enable/disable lifecycle as the module hooks.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export declare function ensureAzureSdkTracingBridge(): void;
|
|
17
|
+
export declare function ensureAzureSdkTracingBridge(instrumentation: Instrumentation): void;
|
|
18
18
|
//# sourceMappingURL=azureSdkTracingBridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureSdkTracingBridge.d.ts","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"azureSdkTracingBridge.d.ts","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI,CAkBlF"}
|
|
@@ -14,19 +14,21 @@ const api_1 = require("@opentelemetry/api");
|
|
|
14
14
|
* imported \@azure/ai-projects or any other Azure SDK package first), the hook
|
|
15
15
|
* never fires, and Azure SDK spans are silently dropped.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* patches the already-loaded \@azure/core-tracing singleton state.
|
|
17
|
+
* Apply the registered instrumentation's patch so the eager bridge follows the
|
|
18
|
+
* same enable/disable lifecycle as the module hooks.
|
|
20
19
|
*
|
|
21
20
|
* @internal
|
|
22
21
|
*/
|
|
23
|
-
function ensureAzureSdkTracingBridge() {
|
|
22
|
+
function ensureAzureSdkTracingBridge(instrumentation) {
|
|
24
23
|
try {
|
|
25
24
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
25
|
+
const coreTracing = require("@azure/core-tracing");
|
|
26
|
+
const moduleDefinitions = instrumentation.getModuleDefinitions?.() ?? [];
|
|
27
|
+
for (const moduleDefinition of moduleDefinitions) {
|
|
28
|
+
if (moduleDefinition.name === "@azure/core-tracing" && moduleDefinition.patch) {
|
|
29
|
+
moduleDefinition.patch(coreTracing);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
30
32
|
}
|
|
31
33
|
catch (e) {
|
|
32
34
|
api_1.diag.warn("Failed to install Azure SDK tracing bridge", e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureSdkTracingBridge.js","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"azureSdkTracingBridge.js","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwBlC,kEAkBC;AAxCD,4CAA0C;AAO1C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,2BAA2B,CAAC,eAAgC;IAC1E,IAAI,CAAC;QACH,iEAAiE;QACjE,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAuB,CAAC;QACzE,MAAM,iBAAiB,GAEnB,eAGD,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC;QACnC,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;YACjD,IAAI,gBAAgB,CAAC,IAAI,KAAK,qBAAqB,IAAI,gBAAgB,CAAC,KAAK,EAAE,CAAC;gBAC9E,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,UAAI,CAAC,IAAI,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { diag } from \"@opentelemetry/api\";\nimport type * as CoreTracing from \"@azure/core-tracing\";\nimport type {\n Instrumentation,\n InstrumentationModuleDefinition,\n} from \"@opentelemetry/instrumentation\";\n\n/**\n * Eagerly installs the OpenTelemetry bridge for \\@azure/core-tracing.\n *\n * The \\@azure/opentelemetry-instrumentation-azure-sdk package normally installs\n * the bridge via a require-in-the-middle (RITM) hook that intercepts future\n * `require(\"@azure/core-tracing\")` calls. However, if \\@azure/core-tracing is\n * already loaded before useAzureMonitor() is called (e.g. because the customer\n * imported \\@azure/ai-projects or any other Azure SDK package first), the hook\n * never fires, and Azure SDK spans are silently dropped.\n *\n * Apply the registered instrumentation's patch so the eager bridge follows the\n * same enable/disable lifecycle as the module hooks.\n *\n * @internal\n */\nexport function ensureAzureSdkTracingBridge(instrumentation: Instrumentation): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const coreTracing = require(\"@azure/core-tracing\") as typeof CoreTracing;\n const moduleDefinitions =\n (\n instrumentation as Instrumentation & {\n getModuleDefinitions?: () => InstrumentationModuleDefinition[];\n }\n ).getModuleDefinitions?.() ?? [];\n for (const moduleDefinition of moduleDefinitions) {\n if (moduleDefinition.name === \"@azure/core-tracing\" && moduleDefinition.patch) {\n moduleDefinition.patch(coreTracing);\n }\n }\n } catch (e) {\n diag.warn(\"Failed to install Azure SDK tracing bridge\", e);\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type http from "node:http";
|
|
2
|
+
import type { Attributes } from "@opentelemetry/api";
|
|
2
3
|
import type { ResourceDetector } from "@opentelemetry/resources";
|
|
3
4
|
/**
|
|
4
5
|
* Tests a flag without 32-bit coercion.
|
|
@@ -10,6 +11,11 @@ export declare function hasNumberFlag(mask: number, flag: number): boolean;
|
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export declare function addNumberFlag(mask: number, flag: number): number;
|
|
14
|
+
/**
|
|
15
|
+
* Clears a flag without 32-bit coercion.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeNumberFlag(mask: number, flag: number): number;
|
|
13
19
|
export declare function ignoreOutgoingRequestHook(request: http.RequestOptions): boolean;
|
|
14
20
|
export declare const isWindows: () => boolean;
|
|
15
21
|
export declare const isLinux: () => boolean;
|
|
@@ -30,6 +36,24 @@ export declare const getOsPrefix: () => string;
|
|
|
30
36
|
export declare const isAppService: () => boolean;
|
|
31
37
|
export declare const isFunctionApp: () => boolean;
|
|
32
38
|
export declare const isAks: () => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Determines whether the AKS resource detector was actually able to populate the AKS cluster
|
|
41
|
+
* attributes, based on the attributes that detector - and only that detector - produced.
|
|
42
|
+
*
|
|
43
|
+
* This is only the case when the customer is running in AKS *and* has correctly wired up access
|
|
44
|
+
* to the `aks-cluster-metadata` ConfigMap in the `kube-public` namespace (RBAC role and role
|
|
45
|
+
* binding, surfaced either through the `CLUSTER_RESOURCE_ID` environment variable or through the
|
|
46
|
+
* mounted ConfigMap file).
|
|
47
|
+
*
|
|
48
|
+
* The merged resource is deliberately not inspected, because `k8s.cluster.name` and
|
|
49
|
+
* `cloud.resource_id` can also be contributed by other sources - the App Service, Functions and
|
|
50
|
+
* VM detectors all set `cloud.resource_id`, and both attributes can be supplied by the customer
|
|
51
|
+
* through `OTEL_RESOURCE_ATTRIBUTES` or a custom resource - none of which indicate that the AKS
|
|
52
|
+
* resource detector is working. The cluster resource ID is additionally validated to be a full
|
|
53
|
+
* AKS managed cluster ARM ID, since the detector does not validate the value it reads.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function isAksResourceDetectorPopulated(attributes?: Attributes): boolean;
|
|
33
57
|
/**
|
|
34
58
|
* Get prefix resource provider, vm will considered as "unknown RP"
|
|
35
59
|
* Web App: "a"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAgCjE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAiB/E;AAED,eAAO,MAAM,SAAS,QAAO,OAE5B,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,OAE1B,CAAC;AAEF,eAAO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