@azure/monitor-opentelemetry 1.20.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/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +14 -18
- 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 +10 -5
- package/dist/commonjs/logs/handler.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 +21 -16
- 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 +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 +13 -36
- package/dist/commonjs/traces/handler.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/types.d.ts +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/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/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +14 -18
- 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 +10 -5
- package/dist/esm/logs/handler.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 +21 -16
- 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 +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 +13 -35
- package/dist/esm/traces/handler.js.map +1 -1
- package/dist/esm/types.d.ts +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/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/package.json +8 -5
package/dist/esm/types.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export interface BrowserSdkLoaderOptions {
|
|
|
152
152
|
/** Browser SDK Loader Connection String */
|
|
153
153
|
connectionString?: string;
|
|
154
154
|
}
|
|
155
|
-
export declare const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.
|
|
155
|
+
export declare const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.1";
|
|
156
156
|
export declare const AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES";
|
|
157
157
|
export declare const AZURE_MONITOR_PREFIX = "AZURE_MONITOR_PREFIX";
|
|
158
158
|
export declare const AZURE_MONITOR_AUTO_ATTACH = "AZURE_MONITOR_AUTO_ATTACH";
|
package/dist/esm/types.js
CHANGED
|
@@ -13,7 +13,7 @@ export const StatsbeatFeaturesMap = new Map([
|
|
|
13
13
|
["multiIkey", 128],
|
|
14
14
|
["aksResourceDetectorPopulation", 256],
|
|
15
15
|
]);
|
|
16
|
-
export const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.
|
|
16
|
+
export const AZURE_MONITOR_OPENTELEMETRY_VERSION = "1.20.1";
|
|
17
17
|
export const AZURE_MONITOR_STATSBEAT_FEATURES = "AZURE_MONITOR_STATSBEAT_FEATURES";
|
|
18
18
|
export const AZURE_MONITOR_PREFIX = "AZURE_MONITOR_PREFIX";
|
|
19
19
|
export const AZURE_MONITOR_AUTO_ATTACH = "AZURE_MONITOR_AUTO_ATTACH";
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AA+FA;;;GAGG;AACH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AC,OAAO,CAAC;IAC7C,CAAC,QAAQ,EAAE,wBAAwB,CAAC,MAAM,CAAC;IAC3C,CAAC,WAAW,EAAE,wBAAwB,CAAC,SAAS,CAAC;IACjD,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC;IACrC,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,SAAS,EAAE,wBAAwB,CAAC,OAAO,CAAC;IAC7C,CAAC,aAAa,EAAE,wBAAwB,CAAC,YAAY,CAAC;IACtD,CAAC,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.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;AACH,MAAM,CAAC,MAAM,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,CAAC;IACxB,CAAC,WAAW,EAAE,GAAG,CAAC;IAClB,CAAC,+BAA+B,EAAE,GAAG,CAAC;CACvC,CAAC,CAAC;AAkEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,QAAQ,CAAC;AAC5D,MAAM,CAAC,MAAM,gCAAgC,GAAG,kCAAkC,CAAC;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AACrF,MAAM,CAAC,MAA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,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 to both module systems so the
|
|
13
|
+
* eager bridge follows the 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":"AAMA
|
|
1
|
+
{"version":3,"file":"azureSdkTracingBridge.d.ts","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI,CAoBlF"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { diag } from "@opentelemetry/api";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
+
import * as coreTracing from "@azure/core-tracing";
|
|
5
6
|
/**
|
|
6
7
|
* Eagerly installs the OpenTelemetry bridge for \@azure/core-tracing.
|
|
7
8
|
*
|
|
@@ -12,20 +13,23 @@ import { createRequire } from "node:module";
|
|
|
12
13
|
* imported \@azure/ai-projects or any other Azure SDK package first), the hook
|
|
13
14
|
* never fires, and Azure SDK spans are silently dropped.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* patches the already-loaded \@azure/core-tracing singleton state.
|
|
16
|
+
* Apply the registered instrumentation's patch to both module systems so the
|
|
17
|
+
* eager bridge follows the same enable/disable lifecycle as the module hooks.
|
|
18
18
|
*
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
export function ensureAzureSdkTracingBridge() {
|
|
21
|
+
export function ensureAzureSdkTracingBridge(instrumentation) {
|
|
22
22
|
try {
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24
24
|
// @ts-ignore ESM only output
|
|
25
25
|
const esmRequire = createRequire(import.meta.url);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
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
|
+
moduleDefinition.patch(esmRequire("@azure/core-tracing"));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
catch (e) {
|
|
31
35
|
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;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"azureSdkTracingBridge.js","sourceRoot":"","sources":["../../../src/utils/azureSdkTracingBridge.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AAMnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,2BAA2B,CAAC,eAAgC;IAC1E,IAAI,CAAC;QACH,6DAA6D;QAC7D,6BAA6B;QAC7B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,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;gBACpC,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,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 { createRequire } from \"node:module\";\nimport * 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 to both module systems so the\n * eager bridge follows the 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/ban-ts-comment\n // @ts-ignore ESM only output\n const esmRequire = createRequire(import.meta.url);\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 moduleDefinition.patch(esmRequire(\"@azure/core-tracing\"));\n }\n }\n } catch (e) {\n diag.warn(\"Failed to install Azure SDK tracing bridge\", e);\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Instrumentation, InstrumentationConfig } from "@opentelemetry/instrumentation";
|
|
2
|
+
/**
|
|
3
|
+
* Reuse module hooks across SDK lifetimes: new hooks cannot reliably patch
|
|
4
|
+
* libraries that have already been loaded. NodeSDK supplies the new providers
|
|
5
|
+
* before enabling the returned instrumentation.
|
|
6
|
+
*/
|
|
7
|
+
export declare function configureInstrumentation<T extends InstrumentationConfig>(cache: Map<string, Instrumentation> | undefined, name: string, config: T, create: (config: T) => Instrumentation): Instrumentation;
|
|
8
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../src/utils/instrumentation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE7F;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,qBAAqB,EACtE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,EAC/C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,eAAe,GACrC,eAAe,CAajB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Reuse module hooks across SDK lifetimes: new hooks cannot reliably patch
|
|
5
|
+
* libraries that have already been loaded. NodeSDK supplies the new providers
|
|
6
|
+
* before enabling the returned instrumentation.
|
|
7
|
+
*/
|
|
8
|
+
export function configureInstrumentation(cache, name, config, create) {
|
|
9
|
+
if (!cache) {
|
|
10
|
+
return create(config);
|
|
11
|
+
}
|
|
12
|
+
const deferredConfig = { ...config, enabled: false };
|
|
13
|
+
let instrumentation = cache.get(name);
|
|
14
|
+
if (instrumentation) {
|
|
15
|
+
instrumentation.setConfig(deferredConfig);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
instrumentation = create(deferredConfig);
|
|
19
|
+
cache.set(name, instrumentation);
|
|
20
|
+
}
|
|
21
|
+
return instrumentation;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../src/utils/instrumentation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAA+C,EAC/C,IAAY,EACZ,MAAS,EACT,MAAsC;IAEtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IACD,MAAM,cAAc,GAAG,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACrD,IAAI,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,eAAe,EAAE,CAAC;QACpB,eAAe,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QACzC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Instrumentation, InstrumentationConfig } from \"@opentelemetry/instrumentation\";\n\n/**\n * Reuse module hooks across SDK lifetimes: new hooks cannot reliably patch\n * libraries that have already been loaded. NodeSDK supplies the new providers\n * before enabling the returned instrumentation.\n */\nexport function configureInstrumentation<T extends InstrumentationConfig>(\n cache: Map<string, Instrumentation> | undefined,\n name: string,\n config: T,\n create: (config: T) => Instrumentation,\n): Instrumentation {\n if (!cache) {\n return create(config);\n }\n const deferredConfig = { ...config, enabled: false };\n let instrumentation = cache.get(name);\n if (instrumentation) {\n instrumentation.setConfig(deferredConfig);\n } else {\n instrumentation = create(deferredConfig);\n cache.set(name, instrumentation);\n }\n return instrumentation;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure/monitor-opentelemetry",
|
|
3
3
|
"author": "Microsoft Corporation",
|
|
4
4
|
"sdk-type": "client",
|
|
5
|
-
"version": "1.20.
|
|
5
|
+
"version": "1.20.1",
|
|
6
6
|
"description": "Azure Monitor OpenTelemetry (Node.js)",
|
|
7
7
|
"main": "./dist/commonjs/index.js",
|
|
8
8
|
"module": "./dist/esm/index.js",
|
|
@@ -51,16 +51,19 @@
|
|
|
51
51
|
"@azure/functions-old": "npm:@azure/functions@3.5.1",
|
|
52
52
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
|
|
53
53
|
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
|
|
54
|
+
"@types/bunyan": "^1.8.11",
|
|
54
55
|
"@types/node": "^22.0.0",
|
|
55
|
-
"@vitest/browser-playwright": "^
|
|
56
|
-
"@vitest/coverage-istanbul": "^
|
|
56
|
+
"@vitest/browser-playwright": "^5.0.0",
|
|
57
|
+
"@vitest/coverage-istanbul": "^5.0.0",
|
|
58
|
+
"bunyan": "^1.8.15",
|
|
57
59
|
"cross-env": "^10.1.0",
|
|
58
60
|
"dotenv": "^16.6.1",
|
|
59
61
|
"eslint": "^10.8.0",
|
|
60
62
|
"prettier": "^3.9.1",
|
|
61
63
|
"rimraf": "^6.1.0",
|
|
62
64
|
"typescript": "~6.0.2",
|
|
63
|
-
"vitest": "^
|
|
65
|
+
"vitest": "^5.0.0",
|
|
66
|
+
"winston": "^3.19.0"
|
|
64
67
|
},
|
|
65
68
|
"dependencies": {
|
|
66
69
|
"@azure-rest/core-client": "^2.5.2",
|
|
@@ -69,7 +72,7 @@
|
|
|
69
72
|
"@azure/core-tracing": "^1.2.0",
|
|
70
73
|
"@azure/identity": "^4.13.1",
|
|
71
74
|
"@azure/logger": "^1.3.0",
|
|
72
|
-
"@azure/monitor-opentelemetry-exporter": "1.0.0-beta.
|
|
75
|
+
"@azure/monitor-opentelemetry-exporter": "1.0.0-beta.46",
|
|
73
76
|
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.1.0-beta.1",
|
|
74
77
|
"@microsoft/applicationinsights-web-snippet": "^1.2.3",
|
|
75
78
|
"@opentelemetry/api": "^1.9.1",
|