@ohos-ports/opentelemetry-auto-instrumentations-node 0.81.0-beta.1 → 0.83.0-beta.0

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.
Files changed (81) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/index.cjs +4 -0
  3. package/dist/index.d.cts +2 -0
  4. package/dist/index.d.mts +2 -0
  5. package/dist/index.mjs +2 -0
  6. package/dist/register.cjs +35 -0
  7. package/dist/register.cjs.map +1 -0
  8. package/dist/register.d.cts +1 -0
  9. package/dist/register.d.mts +1 -0
  10. package/dist/register.mjs +34 -0
  11. package/dist/register.mjs.map +1 -0
  12. package/dist/utils.cjs +207 -0
  13. package/dist/utils.cjs.map +1 -0
  14. package/dist/utils.d.cts +93 -0
  15. package/dist/utils.d.cts.map +1 -0
  16. package/dist/utils.d.mts +93 -0
  17. package/dist/utils.d.mts.map +1 -0
  18. package/dist/utils.mjs +206 -0
  19. package/dist/utils.mjs.map +1 -0
  20. package/package.json +88 -72
  21. package/build/src/index.d.ts +0 -3
  22. package/build/src/index.js +0 -11
  23. package/build/src/index.js.map +0 -1
  24. package/build/src/register.d.ts +0 -2
  25. package/build/src/register.js +0 -49
  26. package/build/src/register.js.map +0 -1
  27. package/build/src/utils.d.ts +0 -94
  28. package/build/src/utils.js +0 -245
  29. package/build/src/utils.js.map +0 -1
  30. package/vendor/README.md +0 -37
  31. package/vendor/instrumentation-host-metrics-ohos/LICENSE +0 -201
  32. package/vendor/instrumentation-host-metrics-ohos/README.md +0 -87
  33. package/vendor/instrumentation-host-metrics-ohos/build/src/index.d.ts +0 -3
  34. package/vendor/instrumentation-host-metrics-ohos/build/src/index.js +0 -10
  35. package/vendor/instrumentation-host-metrics-ohos/build/src/index.js.map +0 -1
  36. package/vendor/instrumentation-host-metrics-ohos/build/src/metric.d.ts +0 -19
  37. package/vendor/instrumentation-host-metrics-ohos/build/src/metric.js +0 -230
  38. package/vendor/instrumentation-host-metrics-ohos/build/src/metric.js.map +0 -1
  39. package/vendor/instrumentation-host-metrics-ohos/build/src/semconv.d.ts +0 -165
  40. package/vendor/instrumentation-host-metrics-ohos/build/src/semconv.js +0 -177
  41. package/vendor/instrumentation-host-metrics-ohos/build/src/semconv.js.map +0 -1
  42. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/common.d.ts +0 -26
  43. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/common.js +0 -127
  44. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/common.js.map +0 -1
  45. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/si.d.ts +0 -3
  46. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/si.js +0 -22
  47. package/vendor/instrumentation-host-metrics-ohos/build/src/stats/si.js.map +0 -1
  48. package/vendor/instrumentation-host-metrics-ohos/build/src/types.d.ts +0 -30
  49. package/vendor/instrumentation-host-metrics-ohos/build/src/types.js +0 -7
  50. package/vendor/instrumentation-host-metrics-ohos/build/src/types.js.map +0 -1
  51. package/vendor/instrumentation-host-metrics-ohos/build/src/version.d.ts +0 -3
  52. package/vendor/instrumentation-host-metrics-ohos/build/src/version.js +0 -11
  53. package/vendor/instrumentation-host-metrics-ohos/build/src/version.js.map +0 -1
  54. package/vendor/instrumentation-host-metrics-ohos/package.json +0 -55
  55. package/vendor/systeminformation-5.33.15-ohos/LICENSE +0 -20
  56. package/vendor/systeminformation-5.33.15-ohos/README.md +0 -1251
  57. package/vendor/systeminformation-5.33.15-ohos/lib/audio.js +0 -335
  58. package/vendor/systeminformation-5.33.15-ohos/lib/battery.js +0 -355
  59. package/vendor/systeminformation-5.33.15-ohos/lib/bluetooth.js +0 -315
  60. package/vendor/systeminformation-5.33.15-ohos/lib/bluetoothVendors.js +0 -1138
  61. package/vendor/systeminformation-5.33.15-ohos/lib/cli.js +0 -100
  62. package/vendor/systeminformation-5.33.15-ohos/lib/cpu.js +0 -2285
  63. package/vendor/systeminformation-5.33.15-ohos/lib/docker.js +0 -791
  64. package/vendor/systeminformation-5.33.15-ohos/lib/dockerSocket.js +0 -117
  65. package/vendor/systeminformation-5.33.15-ohos/lib/filesystem.js +0 -1933
  66. package/vendor/systeminformation-5.33.15-ohos/lib/graphics.js +0 -1317
  67. package/vendor/systeminformation-5.33.15-ohos/lib/index.d.ts +0 -1051
  68. package/vendor/systeminformation-5.33.15-ohos/lib/index.js +0 -520
  69. package/vendor/systeminformation-5.33.15-ohos/lib/internet.js +0 -265
  70. package/vendor/systeminformation-5.33.15-ohos/lib/memory.js +0 -620
  71. package/vendor/systeminformation-5.33.15-ohos/lib/network.js +0 -2023
  72. package/vendor/systeminformation-5.33.15-ohos/lib/osinfo.js +0 -1304
  73. package/vendor/systeminformation-5.33.15-ohos/lib/printer.js +0 -209
  74. package/vendor/systeminformation-5.33.15-ohos/lib/processes.js +0 -1496
  75. package/vendor/systeminformation-5.33.15-ohos/lib/system.js +0 -855
  76. package/vendor/systeminformation-5.33.15-ohos/lib/usb.js +0 -309
  77. package/vendor/systeminformation-5.33.15-ohos/lib/users.js +0 -412
  78. package/vendor/systeminformation-5.33.15-ohos/lib/util.js +0 -2872
  79. package/vendor/systeminformation-5.33.15-ohos/lib/virtualbox.js +0 -116
  80. package/vendor/systeminformation-5.33.15-ohos/lib/wifi.js +0 -839
  81. package/vendor/systeminformation-5.33.15-ohos/package.json +0 -103
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
package/dist/index.cjs ADDED
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_utils = require("./utils.cjs");
3
+ exports.getNodeAutoInstrumentations = require_utils.getNodeAutoInstrumentations;
4
+ exports.getResourceDetectors = require_utils.getResourceDetectorsFromEnv;
@@ -0,0 +1,2 @@
1
+ import { InstrumentationConfigMap, getNodeAutoInstrumentations, getResourceDetectorsFromEnv } from "./utils.cjs";
2
+ export { type InstrumentationConfigMap, getNodeAutoInstrumentations, getResourceDetectorsFromEnv as getResourceDetectors };
@@ -0,0 +1,2 @@
1
+ import { InstrumentationConfigMap, getNodeAutoInstrumentations, getResourceDetectorsFromEnv } from "./utils.mjs";
2
+ export { type InstrumentationConfigMap, getNodeAutoInstrumentations, getResourceDetectorsFromEnv as getResourceDetectors };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { getNodeAutoInstrumentations, getResourceDetectorsFromEnv } from "./utils.mjs";
2
+ export { getNodeAutoInstrumentations, getResourceDetectorsFromEnv as getResourceDetectors };
@@ -0,0 +1,35 @@
1
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
+ const require_utils = require("./utils.cjs");
3
+ let _opentelemetry_api = require("@opentelemetry/api");
4
+ let _opentelemetry_sdk_node = require("@opentelemetry/sdk-node");
5
+ _opentelemetry_sdk_node = require_runtime.__toESM(_opentelemetry_sdk_node);
6
+ let _opentelemetry_core = require("@opentelemetry/core");
7
+ //#region src/register.ts
8
+ const logLevel = (0, _opentelemetry_core.getStringFromEnv)("OTEL_LOG_LEVEL");
9
+ if (logLevel != null) _opentelemetry_api.diag.setLogger(new _opentelemetry_api.DiagConsoleLogger(), { logLevel: (0, _opentelemetry_core.diagLogLevelFromString)(logLevel) });
10
+ const instrumentations = require_utils.getNodeAutoInstrumentations();
11
+ const resourceDetectors = require_utils.getResourceDetectorsFromEnv();
12
+ if (logLevel != null) _opentelemetry_api.diag.disable();
13
+ const sdk = new _opentelemetry_sdk_node.NodeSDK({
14
+ instrumentations,
15
+ resourceDetectors
16
+ });
17
+ try {
18
+ sdk.start();
19
+ _opentelemetry_api.diag.info("OpenTelemetry automatic instrumentation started successfully");
20
+ } catch (error) {
21
+ _opentelemetry_api.diag.error("Error initializing OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry", error);
22
+ }
23
+ async function shutdown() {
24
+ try {
25
+ await sdk.shutdown();
26
+ _opentelemetry_api.diag.debug("OpenTelemetry SDK terminated");
27
+ } catch (error) {
28
+ _opentelemetry_api.diag.error("Error terminating OpenTelemetry SDK", error);
29
+ }
30
+ }
31
+ process.on("SIGTERM", shutdown);
32
+ process.once("beforeExit", shutdown);
33
+ //#endregion
34
+
35
+ //# sourceMappingURL=register.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.cjs","names":["getStringFromEnv","DiagConsoleLogger","diagLogLevelFromString","getNodeAutoInstrumentations","getResourceDetectorsFromEnv","opentelemetry"],"sources":["../src/register.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as opentelemetry from '@opentelemetry/sdk-node';\nimport { diag, DiagConsoleLogger } from '@opentelemetry/api';\nimport { getStringFromEnv, diagLogLevelFromString } from '@opentelemetry/core';\nimport {\n getNodeAutoInstrumentations,\n getResourceDetectorsFromEnv,\n} from './utils';\n\nconst logLevel = getStringFromEnv('OTEL_LOG_LEVEL');\nif (logLevel != null) {\n diag.setLogger(new DiagConsoleLogger(), {\n logLevel: diagLogLevelFromString(logLevel),\n });\n}\n\nconst instrumentations = getNodeAutoInstrumentations();\nconst resourceDetectors = getResourceDetectorsFromEnv();\n\n// `NodeSDK` registers its own `DiagConsoleLogger` based on `OTEL_LOG_LEVEL`\n// internally, so disable the logger set up above to avoid the \"Current\n// logger will be overwritten\" warning being logged on every start.\nif (logLevel != null) {\n diag.disable();\n}\n\nconst sdk = new opentelemetry.NodeSDK({\n instrumentations,\n resourceDetectors,\n});\n\ntry {\n sdk.start();\n diag.info('OpenTelemetry automatic instrumentation started successfully');\n} catch (error) {\n diag.error(\n 'Error initializing OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry',\n error\n );\n}\n\nasync function shutdown(): Promise<void> {\n try {\n await sdk.shutdown();\n diag.debug('OpenTelemetry SDK terminated');\n } catch (error) {\n diag.error('Error terminating OpenTelemetry SDK', error);\n }\n}\n\n// Gracefully shutdown SDK if a SIGTERM is received\nprocess.on('SIGTERM', shutdown);\n// Gracefully shutdown SDK if Node.js is exiting normally\nprocess.once('beforeExit', shutdown);\n"],"mappings":";;;;;;;AAYA,MAAM,YAAA,GAAWA,oBAAAA,iBAAAA,CAAiB,gBAAgB;AAClD,IAAI,YAAY,MACd,mBAAA,KAAK,UAAU,IAAIC,mBAAAA,kBAAkB,GAAG,EACtC,WAAA,GAAUC,oBAAAA,uBAAAA,CAAuB,QAAQ,EAC3C,CAAC;AAGH,MAAM,mBAAmBC,cAAAA,4BAA4B;AACrD,MAAM,oBAAoBC,cAAAA,4BAA4B;AAKtD,IAAI,YAAY,MACd,mBAAA,KAAK,QAAQ;AAGf,MAAM,MAAM,IAAIC,wBAAc,QAAQ;CACpC;CACA;AACF,CAAC;AAED,IAAI;CACF,IAAI,MAAM;CACV,mBAAA,KAAK,KAAK,8DAA8D;AAC1E,SAAS,OAAO;CACd,mBAAA,KAAK,MACH,6GACA,KACF;AACF;AAEA,eAAe,WAA0B;CACvC,IAAI;EACF,MAAM,IAAI,SAAS;EACnB,mBAAA,KAAK,MAAM,8BAA8B;CAC3C,SAAS,OAAO;EACd,mBAAA,KAAK,MAAM,uCAAuC,KAAK;CACzD;AACF;AAGA,QAAQ,GAAG,WAAW,QAAQ;AAE9B,QAAQ,KAAK,cAAc,QAAQ"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,34 @@
1
+ import { getNodeAutoInstrumentations, getResourceDetectorsFromEnv } from "./utils.mjs";
2
+ import { DiagConsoleLogger, diag } from "@opentelemetry/api";
3
+ import * as opentelemetry from "@opentelemetry/sdk-node";
4
+ import { diagLogLevelFromString, getStringFromEnv } from "@opentelemetry/core";
5
+ //#region src/register.ts
6
+ const logLevel = getStringFromEnv("OTEL_LOG_LEVEL");
7
+ if (logLevel != null) diag.setLogger(new DiagConsoleLogger(), { logLevel: diagLogLevelFromString(logLevel) });
8
+ const instrumentations = getNodeAutoInstrumentations();
9
+ const resourceDetectors = getResourceDetectorsFromEnv();
10
+ if (logLevel != null) diag.disable();
11
+ const sdk = new opentelemetry.NodeSDK({
12
+ instrumentations,
13
+ resourceDetectors
14
+ });
15
+ try {
16
+ sdk.start();
17
+ diag.info("OpenTelemetry automatic instrumentation started successfully");
18
+ } catch (error) {
19
+ diag.error("Error initializing OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry", error);
20
+ }
21
+ async function shutdown() {
22
+ try {
23
+ await sdk.shutdown();
24
+ diag.debug("OpenTelemetry SDK terminated");
25
+ } catch (error) {
26
+ diag.error("Error terminating OpenTelemetry SDK", error);
27
+ }
28
+ }
29
+ process.on("SIGTERM", shutdown);
30
+ process.once("beforeExit", shutdown);
31
+ //#endregion
32
+ export {};
33
+
34
+ //# sourceMappingURL=register.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.mjs","names":[],"sources":["../src/register.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as opentelemetry from '@opentelemetry/sdk-node';\nimport { diag, DiagConsoleLogger } from '@opentelemetry/api';\nimport { getStringFromEnv, diagLogLevelFromString } from '@opentelemetry/core';\nimport {\n getNodeAutoInstrumentations,\n getResourceDetectorsFromEnv,\n} from './utils';\n\nconst logLevel = getStringFromEnv('OTEL_LOG_LEVEL');\nif (logLevel != null) {\n diag.setLogger(new DiagConsoleLogger(), {\n logLevel: diagLogLevelFromString(logLevel),\n });\n}\n\nconst instrumentations = getNodeAutoInstrumentations();\nconst resourceDetectors = getResourceDetectorsFromEnv();\n\n// `NodeSDK` registers its own `DiagConsoleLogger` based on `OTEL_LOG_LEVEL`\n// internally, so disable the logger set up above to avoid the \"Current\n// logger will be overwritten\" warning being logged on every start.\nif (logLevel != null) {\n diag.disable();\n}\n\nconst sdk = new opentelemetry.NodeSDK({\n instrumentations,\n resourceDetectors,\n});\n\ntry {\n sdk.start();\n diag.info('OpenTelemetry automatic instrumentation started successfully');\n} catch (error) {\n diag.error(\n 'Error initializing OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry',\n error\n );\n}\n\nasync function shutdown(): Promise<void> {\n try {\n await sdk.shutdown();\n diag.debug('OpenTelemetry SDK terminated');\n } catch (error) {\n diag.error('Error terminating OpenTelemetry SDK', error);\n }\n}\n\n// Gracefully shutdown SDK if a SIGTERM is received\nprocess.on('SIGTERM', shutdown);\n// Gracefully shutdown SDK if Node.js is exiting normally\nprocess.once('beforeExit', shutdown);\n"],"mappings":";;;;;AAYA,MAAM,WAAW,iBAAiB,gBAAgB;AAClD,IAAI,YAAY,MACd,KAAK,UAAU,IAAI,kBAAkB,GAAG,EACtC,UAAU,uBAAuB,QAAQ,EAC3C,CAAC;AAGH,MAAM,mBAAmB,4BAA4B;AACrD,MAAM,oBAAoB,4BAA4B;AAKtD,IAAI,YAAY,MACd,KAAK,QAAQ;AAGf,MAAM,MAAM,IAAI,cAAc,QAAQ;CACpC;CACA;AACF,CAAC;AAED,IAAI;CACF,IAAI,MAAM;CACV,KAAK,KAAK,8DAA8D;AAC1E,SAAS,OAAO;CACd,KAAK,MACH,6GACA,KACF;AACF;AAEA,eAAe,WAA0B;CACvC,IAAI;EACF,MAAM,IAAI,SAAS;EACnB,KAAK,MAAM,8BAA8B;CAC3C,SAAS,OAAO;EACd,KAAK,MAAM,uCAAuC,KAAK;CACzD;AACF;AAGA,QAAQ,GAAG,WAAW,QAAQ;AAE9B,QAAQ,KAAK,cAAc,QAAQ"}
package/dist/utils.cjs ADDED
@@ -0,0 +1,207 @@
1
+ let _opentelemetry_api = require("@opentelemetry/api");
2
+ let _opentelemetry_instrumentation_amqplib = require("@opentelemetry/instrumentation-amqplib");
3
+ let _opentelemetry_instrumentation_aws_lambda = require("@opentelemetry/instrumentation-aws-lambda");
4
+ let _opentelemetry_instrumentation_aws_sdk = require("@opentelemetry/instrumentation-aws-sdk");
5
+ let _opentelemetry_instrumentation_bunyan = require("@opentelemetry/instrumentation-bunyan");
6
+ let _opentelemetry_instrumentation_cassandra_driver = require("@opentelemetry/instrumentation-cassandra-driver");
7
+ let _opentelemetry_instrumentation_connect = require("@opentelemetry/instrumentation-connect");
8
+ let _opentelemetry_instrumentation_cucumber = require("@opentelemetry/instrumentation-cucumber");
9
+ let _opentelemetry_instrumentation_dataloader = require("@opentelemetry/instrumentation-dataloader");
10
+ let _opentelemetry_instrumentation_dns = require("@opentelemetry/instrumentation-dns");
11
+ let _opentelemetry_instrumentation_express = require("@opentelemetry/instrumentation-express");
12
+ let _opentelemetry_instrumentation_fs = require("@opentelemetry/instrumentation-fs");
13
+ let _opentelemetry_instrumentation_generic_pool = require("@opentelemetry/instrumentation-generic-pool");
14
+ let _opentelemetry_instrumentation_graphql = require("@opentelemetry/instrumentation-graphql");
15
+ let _opentelemetry_instrumentation_grpc = require("@opentelemetry/instrumentation-grpc");
16
+ let _opentelemetry_instrumentation_hapi = require("@opentelemetry/instrumentation-hapi");
17
+ let _opentelemetry_instrumentation_host_metrics = require("@opentelemetry/instrumentation-host-metrics");
18
+ let _opentelemetry_instrumentation_http = require("@opentelemetry/instrumentation-http");
19
+ let _opentelemetry_instrumentation_ioredis = require("@opentelemetry/instrumentation-ioredis");
20
+ let _opentelemetry_instrumentation_kafkajs = require("@opentelemetry/instrumentation-kafkajs");
21
+ let _opentelemetry_instrumentation_knex = require("@opentelemetry/instrumentation-knex");
22
+ let _opentelemetry_instrumentation_koa = require("@opentelemetry/instrumentation-koa");
23
+ let _opentelemetry_instrumentation_lru_memoizer = require("@opentelemetry/instrumentation-lru-memoizer");
24
+ let _opentelemetry_instrumentation_memcached = require("@opentelemetry/instrumentation-memcached");
25
+ let _opentelemetry_instrumentation_mongodb = require("@opentelemetry/instrumentation-mongodb");
26
+ let _opentelemetry_instrumentation_mongoose = require("@opentelemetry/instrumentation-mongoose");
27
+ let _opentelemetry_instrumentation_mysql2 = require("@opentelemetry/instrumentation-mysql2");
28
+ let _opentelemetry_instrumentation_mysql = require("@opentelemetry/instrumentation-mysql");
29
+ let _opentelemetry_instrumentation_nestjs_core = require("@opentelemetry/instrumentation-nestjs-core");
30
+ let _opentelemetry_instrumentation_net = require("@opentelemetry/instrumentation-net");
31
+ let _opentelemetry_instrumentation_openai = require("@opentelemetry/instrumentation-openai");
32
+ let _opentelemetry_instrumentation_oracledb = require("@opentelemetry/instrumentation-oracledb");
33
+ let _opentelemetry_instrumentation_pg = require("@opentelemetry/instrumentation-pg");
34
+ let _opentelemetry_instrumentation_pino = require("@opentelemetry/instrumentation-pino");
35
+ let _opentelemetry_instrumentation_redis = require("@opentelemetry/instrumentation-redis");
36
+ let _opentelemetry_instrumentation_restify = require("@opentelemetry/instrumentation-restify");
37
+ let _opentelemetry_instrumentation_router = require("@opentelemetry/instrumentation-router");
38
+ let _opentelemetry_instrumentation_runtime_node = require("@opentelemetry/instrumentation-runtime-node");
39
+ let _opentelemetry_instrumentation_socket_io = require("@opentelemetry/instrumentation-socket.io");
40
+ let _opentelemetry_instrumentation_tedious = require("@opentelemetry/instrumentation-tedious");
41
+ let _opentelemetry_instrumentation_undici = require("@opentelemetry/instrumentation-undici");
42
+ let _opentelemetry_instrumentation_winston = require("@opentelemetry/instrumentation-winston");
43
+ let _opentelemetry_resource_detector_alibaba_cloud = require("@opentelemetry/resource-detector-alibaba-cloud");
44
+ let _opentelemetry_resource_detector_aws = require("@opentelemetry/resource-detector-aws");
45
+ let _opentelemetry_resource_detector_container = require("@opentelemetry/resource-detector-container");
46
+ let _opentelemetry_resource_detector_gcp = require("@opentelemetry/resource-detector-gcp");
47
+ let _opentelemetry_resources = require("@opentelemetry/resources");
48
+ let _opentelemetry_resource_detector_azure = require("@opentelemetry/resource-detector-azure");
49
+ //#region src/utils.ts
50
+ const RESOURCE_DETECTOR_CONTAINER = "container";
51
+ const RESOURCE_DETECTOR_ENVIRONMENT = "env";
52
+ const RESOURCE_DETECTOR_HOST = "host";
53
+ const RESOURCE_DETECTOR_OS = "os";
54
+ const RESOURCE_DETECTOR_SERVICE_INSTANCE_ID = "serviceinstance";
55
+ const RESOURCE_DETECTOR_PROCESS = "process";
56
+ const RESOURCE_DETECTOR_ALIBABA = "alibaba";
57
+ const RESOURCE_DETECTOR_AWS = "aws";
58
+ const RESOURCE_DETECTOR_AZURE = "azure";
59
+ const RESOURCE_DETECTOR_GCP = "gcp";
60
+ const InstrumentationMap = {
61
+ "@opentelemetry/instrumentation-amqplib": _opentelemetry_instrumentation_amqplib.AmqplibInstrumentation,
62
+ "@opentelemetry/instrumentation-aws-lambda": _opentelemetry_instrumentation_aws_lambda.AwsLambdaInstrumentation,
63
+ "@opentelemetry/instrumentation-aws-sdk": _opentelemetry_instrumentation_aws_sdk.AwsInstrumentation,
64
+ "@opentelemetry/instrumentation-bunyan": _opentelemetry_instrumentation_bunyan.BunyanInstrumentation,
65
+ "@opentelemetry/instrumentation-cassandra-driver": _opentelemetry_instrumentation_cassandra_driver.CassandraDriverInstrumentation,
66
+ "@opentelemetry/instrumentation-connect": _opentelemetry_instrumentation_connect.ConnectInstrumentation,
67
+ "@opentelemetry/instrumentation-cucumber": _opentelemetry_instrumentation_cucumber.CucumberInstrumentation,
68
+ "@opentelemetry/instrumentation-dataloader": _opentelemetry_instrumentation_dataloader.DataloaderInstrumentation,
69
+ "@opentelemetry/instrumentation-dns": _opentelemetry_instrumentation_dns.DnsInstrumentation,
70
+ "@opentelemetry/instrumentation-express": _opentelemetry_instrumentation_express.ExpressInstrumentation,
71
+ "@opentelemetry/instrumentation-fs": _opentelemetry_instrumentation_fs.FsInstrumentation,
72
+ "@opentelemetry/instrumentation-generic-pool": _opentelemetry_instrumentation_generic_pool.GenericPoolInstrumentation,
73
+ "@opentelemetry/instrumentation-graphql": _opentelemetry_instrumentation_graphql.GraphQLInstrumentation,
74
+ "@opentelemetry/instrumentation-grpc": _opentelemetry_instrumentation_grpc.GrpcInstrumentation,
75
+ "@opentelemetry/instrumentation-hapi": _opentelemetry_instrumentation_hapi.HapiInstrumentation,
76
+ "@opentelemetry/instrumentation-host-metrics": _opentelemetry_instrumentation_host_metrics.HostMetricsInstrumentation,
77
+ "@opentelemetry/instrumentation-http": _opentelemetry_instrumentation_http.HttpInstrumentation,
78
+ "@opentelemetry/instrumentation-ioredis": _opentelemetry_instrumentation_ioredis.IORedisInstrumentation,
79
+ "@opentelemetry/instrumentation-kafkajs": _opentelemetry_instrumentation_kafkajs.KafkaJsInstrumentation,
80
+ "@opentelemetry/instrumentation-knex": _opentelemetry_instrumentation_knex.KnexInstrumentation,
81
+ "@opentelemetry/instrumentation-koa": _opentelemetry_instrumentation_koa.KoaInstrumentation,
82
+ "@opentelemetry/instrumentation-lru-memoizer": _opentelemetry_instrumentation_lru_memoizer.LruMemoizerInstrumentation,
83
+ "@opentelemetry/instrumentation-memcached": _opentelemetry_instrumentation_memcached.MemcachedInstrumentation,
84
+ "@opentelemetry/instrumentation-mongodb": _opentelemetry_instrumentation_mongodb.MongoDBInstrumentation,
85
+ "@opentelemetry/instrumentation-mongoose": _opentelemetry_instrumentation_mongoose.MongooseInstrumentation,
86
+ "@opentelemetry/instrumentation-mysql2": _opentelemetry_instrumentation_mysql2.MySQL2Instrumentation,
87
+ "@opentelemetry/instrumentation-mysql": _opentelemetry_instrumentation_mysql.MySQLInstrumentation,
88
+ "@opentelemetry/instrumentation-nestjs-core": _opentelemetry_instrumentation_nestjs_core.NestInstrumentation,
89
+ "@opentelemetry/instrumentation-net": _opentelemetry_instrumentation_net.NetInstrumentation,
90
+ "@opentelemetry/instrumentation-openai": _opentelemetry_instrumentation_openai.OpenAIInstrumentation,
91
+ "@opentelemetry/instrumentation-oracledb": _opentelemetry_instrumentation_oracledb.OracleInstrumentation,
92
+ "@opentelemetry/instrumentation-pg": _opentelemetry_instrumentation_pg.PgInstrumentation,
93
+ "@opentelemetry/instrumentation-pino": _opentelemetry_instrumentation_pino.PinoInstrumentation,
94
+ "@opentelemetry/instrumentation-redis": _opentelemetry_instrumentation_redis.RedisInstrumentation,
95
+ "@opentelemetry/instrumentation-restify": _opentelemetry_instrumentation_restify.RestifyInstrumentation,
96
+ "@opentelemetry/instrumentation-router": _opentelemetry_instrumentation_router.RouterInstrumentation,
97
+ "@opentelemetry/instrumentation-runtime-node": _opentelemetry_instrumentation_runtime_node.RuntimeNodeInstrumentation,
98
+ "@opentelemetry/instrumentation-socket.io": _opentelemetry_instrumentation_socket_io.SocketIoInstrumentation,
99
+ "@opentelemetry/instrumentation-tedious": _opentelemetry_instrumentation_tedious.TediousInstrumentation,
100
+ "@opentelemetry/instrumentation-undici": _opentelemetry_instrumentation_undici.UndiciInstrumentation,
101
+ "@opentelemetry/instrumentation-winston": _opentelemetry_instrumentation_winston.WinstonInstrumentation
102
+ };
103
+ const defaultExcludedInstrumentations = ["@opentelemetry/instrumentation-fs", "@opentelemetry/instrumentation-host-metrics"];
104
+ function shouldDisableInstrumentation(name, userConfig, enabledInstrumentationsFromEnv, disabledInstrumentationsFromEnv) {
105
+ if (userConfig.enabled === false) {
106
+ _opentelemetry_api.diag.debug(`Disabling instrumentation for ${name} - disabled by user config`);
107
+ return true;
108
+ }
109
+ if (userConfig.enabled === true) {
110
+ _opentelemetry_api.diag.debug(`Enabling instrumentation for ${name} - explicitly enabled by user config`);
111
+ return false;
112
+ }
113
+ if (disabledInstrumentationsFromEnv.includes(name)) {
114
+ _opentelemetry_api.diag.debug(`Disabling instrumentation for ${name} - disabled by env var`);
115
+ return true;
116
+ }
117
+ const isEnabledEnvSet = !!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS;
118
+ if (isEnabledEnvSet && !enabledInstrumentationsFromEnv.includes(name)) {
119
+ _opentelemetry_api.diag.debug(`Disabling instrumentation for ${name} - not in enabled env var list`);
120
+ return true;
121
+ }
122
+ if (!isEnabledEnvSet && defaultExcludedInstrumentations.includes(name)) {
123
+ _opentelemetry_api.diag.debug(`Disabling instrumentation for ${name} - excluded by default`);
124
+ return true;
125
+ }
126
+ return false;
127
+ }
128
+ function getNodeAutoInstrumentations(inputConfigs = {}) {
129
+ checkManuallyProvidedInstrumentationNames(Object.keys(inputConfigs));
130
+ const enabledInstrumentationsFromEnv = getEnabledInstrumentationsFromEnv();
131
+ const disabledInstrumentationsFromEnv = getDisabledInstrumentationsFromEnv();
132
+ const instrumentations = [];
133
+ for (const name of Object.keys(InstrumentationMap)) {
134
+ const Instance = InstrumentationMap[name];
135
+ const userConfig = inputConfigs[name] ?? {};
136
+ if (shouldDisableInstrumentation(name, userConfig, enabledInstrumentationsFromEnv, disabledInstrumentationsFromEnv)) continue;
137
+ try {
138
+ _opentelemetry_api.diag.debug(`Loading instrumentation for ${name}`);
139
+ instrumentations.push(new Instance(userConfig));
140
+ } catch (e) {
141
+ _opentelemetry_api.diag.error(e);
142
+ }
143
+ }
144
+ return instrumentations;
145
+ }
146
+ function checkManuallyProvidedInstrumentationNames(manuallyProvidedInstrumentationNames) {
147
+ for (const name of manuallyProvidedInstrumentationNames) if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) _opentelemetry_api.diag.error(`Provided instrumentation name "${name}" not found`);
148
+ }
149
+ function getInstrumentationsFromEnv(envVar) {
150
+ const envVarValue = process.env[envVar];
151
+ if (envVarValue == null) return [];
152
+ const instrumentationsFromEnv = envVarValue?.split(",").map((instrumentationPkgSuffix) => `@opentelemetry/instrumentation-${instrumentationPkgSuffix.trim()}`);
153
+ checkManuallyProvidedInstrumentationNames(instrumentationsFromEnv);
154
+ return instrumentationsFromEnv;
155
+ }
156
+ /**
157
+ * Returns the list of instrumentations that are enabled based on the environment variable.
158
+ * If the environment variable is unset, returns all instrumentation that are enabled by default.
159
+ */
160
+ function getEnabledInstrumentationsFromEnv() {
161
+ if (!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS) return Object.keys(InstrumentationMap).filter((key) => !defaultExcludedInstrumentations.includes(key));
162
+ return getInstrumentationsFromEnv("OTEL_NODE_ENABLED_INSTRUMENTATIONS");
163
+ }
164
+ /**
165
+ * Returns the list of instrumentations that are disabled based on the environment variable.
166
+ */
167
+ function getDisabledInstrumentationsFromEnv() {
168
+ if (!process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS) return [];
169
+ return getInstrumentationsFromEnv("OTEL_NODE_DISABLED_INSTRUMENTATIONS");
170
+ }
171
+ function getResourceDetectorsFromEnv() {
172
+ const resourceDetectors = /* @__PURE__ */ new Map([
173
+ [RESOURCE_DETECTOR_CONTAINER, _opentelemetry_resource_detector_container.containerDetector],
174
+ [RESOURCE_DETECTOR_HOST, _opentelemetry_resources.hostDetector],
175
+ [RESOURCE_DETECTOR_OS, _opentelemetry_resources.osDetector],
176
+ [RESOURCE_DETECTOR_SERVICE_INSTANCE_ID, _opentelemetry_resources.serviceInstanceIdDetector],
177
+ [RESOURCE_DETECTOR_PROCESS, _opentelemetry_resources.processDetector],
178
+ [RESOURCE_DETECTOR_ALIBABA, _opentelemetry_resource_detector_alibaba_cloud.alibabaCloudEcsDetector],
179
+ [RESOURCE_DETECTOR_GCP, _opentelemetry_resource_detector_gcp.gcpDetector],
180
+ [RESOURCE_DETECTOR_AWS, [
181
+ _opentelemetry_resource_detector_aws.awsEc2Detector,
182
+ _opentelemetry_resource_detector_aws.awsEcsDetector,
183
+ _opentelemetry_resource_detector_aws.awsEksDetector,
184
+ _opentelemetry_resource_detector_aws.awsBeanstalkDetector,
185
+ _opentelemetry_resource_detector_aws.awsLambdaDetector
186
+ ]],
187
+ [RESOURCE_DETECTOR_AZURE, [
188
+ _opentelemetry_resource_detector_azure.azureAppServiceDetector,
189
+ _opentelemetry_resource_detector_azure.azureFunctionsDetector,
190
+ _opentelemetry_resource_detector_azure.azureVmDetector
191
+ ]],
192
+ [RESOURCE_DETECTOR_ENVIRONMENT, _opentelemetry_resources.envDetector]
193
+ ]);
194
+ const resourceDetectorsFromEnv = process.env.OTEL_NODE_RESOURCE_DETECTORS?.split(",") ?? ["all"];
195
+ if (resourceDetectorsFromEnv.includes("all")) return [...resourceDetectors.values()].flat();
196
+ if (resourceDetectorsFromEnv.includes("none")) return [];
197
+ return resourceDetectorsFromEnv.flatMap((detector) => {
198
+ const resourceDetector = resourceDetectors.get(detector);
199
+ if (!resourceDetector) _opentelemetry_api.diag.error(`Invalid resource detector "${detector}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`);
200
+ return resourceDetector || [];
201
+ });
202
+ }
203
+ //#endregion
204
+ exports.getNodeAutoInstrumentations = getNodeAutoInstrumentations;
205
+ exports.getResourceDetectorsFromEnv = getResourceDetectorsFromEnv;
206
+
207
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs","names":["AmqplibInstrumentation","AwsLambdaInstrumentation","AwsInstrumentation","BunyanInstrumentation","CassandraDriverInstrumentation","ConnectInstrumentation","CucumberInstrumentation","DataloaderInstrumentation","DnsInstrumentation","ExpressInstrumentation","FsInstrumentation","GenericPoolInstrumentation","GraphQLInstrumentation","GrpcInstrumentation","HapiInstrumentation","HostMetricsInstrumentation","HttpInstrumentation","IORedisInstrumentation","KafkaJsInstrumentation","KnexInstrumentation","KoaInstrumentation","LruMemoizerInstrumentation","MemcachedInstrumentation","MongoDBInstrumentation","MongooseInstrumentation","MySQL2Instrumentation","MySQLInstrumentation","NestInstrumentation","NetInstrumentation","OpenAIInstrumentation","OracleInstrumentation","PgInstrumentation","PinoInstrumentation","RedisInstrumentation","RestifyInstrumentation","RouterInstrumentation","RuntimeNodeInstrumentation","SocketIoInstrumentation","TediousInstrumentation","UndiciInstrumentation","WinstonInstrumentation","containerDetector","hostDetector","osDetector","serviceInstanceIdDetector","processDetector","alibabaCloudEcsDetector","gcpDetector","awsEc2Detector","awsEcsDetector","awsEksDetector","awsBeanstalkDetector","awsLambdaDetector","azureAppServiceDetector","azureFunctionsDetector","azureVmDetector","envDetector"],"sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { Instrumentation } from '@opentelemetry/instrumentation';\n\nimport { AmqplibInstrumentation } from '@opentelemetry/instrumentation-amqplib';\nimport { AwsLambdaInstrumentation } from '@opentelemetry/instrumentation-aws-lambda';\nimport { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk';\nimport { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\nimport { CassandraDriverInstrumentation } from '@opentelemetry/instrumentation-cassandra-driver';\nimport { ConnectInstrumentation } from '@opentelemetry/instrumentation-connect';\nimport { CucumberInstrumentation } from '@opentelemetry/instrumentation-cucumber';\nimport { DataloaderInstrumentation } from '@opentelemetry/instrumentation-dataloader';\nimport { DnsInstrumentation } from '@opentelemetry/instrumentation-dns';\nimport { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';\nimport { FsInstrumentation } from '@opentelemetry/instrumentation-fs';\nimport { GenericPoolInstrumentation } from '@opentelemetry/instrumentation-generic-pool';\nimport { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';\nimport { GrpcInstrumentation } from '@opentelemetry/instrumentation-grpc';\nimport { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';\nimport { HostMetricsInstrumentation } from '@opentelemetry/instrumentation-host-metrics';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';\nimport { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';\nimport { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';\nimport { MemcachedInstrumentation } from '@opentelemetry/instrumentation-memcached';\nimport { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';\nimport { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';\nimport { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';\nimport { NestInstrumentation } from '@opentelemetry/instrumentation-nestjs-core';\nimport { NetInstrumentation } from '@opentelemetry/instrumentation-net';\nimport { OpenAIInstrumentation } from '@opentelemetry/instrumentation-openai';\nimport { OracleInstrumentation } from '@opentelemetry/instrumentation-oracledb';\nimport { PgInstrumentation } from '@opentelemetry/instrumentation-pg';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';\nimport { RestifyInstrumentation } from '@opentelemetry/instrumentation-restify';\nimport { RouterInstrumentation } from '@opentelemetry/instrumentation-router';\nimport { RuntimeNodeInstrumentation } from '@opentelemetry/instrumentation-runtime-node';\nimport { SocketIoInstrumentation } from '@opentelemetry/instrumentation-socket.io';\nimport { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious';\nimport { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici';\nimport { WinstonInstrumentation } from '@opentelemetry/instrumentation-winston';\n\nimport { alibabaCloudEcsDetector } from '@opentelemetry/resource-detector-alibaba-cloud';\nimport {\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n} from '@opentelemetry/resource-detector-aws';\nimport { containerDetector } from '@opentelemetry/resource-detector-container';\nimport { gcpDetector } from '@opentelemetry/resource-detector-gcp';\nimport {\n ResourceDetector,\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from '@opentelemetry/resources';\nimport {\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n} from '@opentelemetry/resource-detector-azure';\n\nconst RESOURCE_DETECTOR_CONTAINER = 'container';\nconst RESOURCE_DETECTOR_ENVIRONMENT = 'env';\nconst RESOURCE_DETECTOR_HOST = 'host';\nconst RESOURCE_DETECTOR_OS = 'os';\nconst RESOURCE_DETECTOR_SERVICE_INSTANCE_ID = 'serviceinstance';\nconst RESOURCE_DETECTOR_PROCESS = 'process';\nconst RESOURCE_DETECTOR_ALIBABA = 'alibaba';\nconst RESOURCE_DETECTOR_AWS = 'aws';\nconst RESOURCE_DETECTOR_AZURE = 'azure';\nconst RESOURCE_DETECTOR_GCP = 'gcp';\n\nconst InstrumentationMap = {\n '@opentelemetry/instrumentation-amqplib': AmqplibInstrumentation,\n '@opentelemetry/instrumentation-aws-lambda': AwsLambdaInstrumentation,\n '@opentelemetry/instrumentation-aws-sdk': AwsInstrumentation,\n '@opentelemetry/instrumentation-bunyan': BunyanInstrumentation,\n '@opentelemetry/instrumentation-cassandra-driver':\n CassandraDriverInstrumentation,\n '@opentelemetry/instrumentation-connect': ConnectInstrumentation,\n '@opentelemetry/instrumentation-cucumber': CucumberInstrumentation,\n '@opentelemetry/instrumentation-dataloader': DataloaderInstrumentation,\n '@opentelemetry/instrumentation-dns': DnsInstrumentation,\n '@opentelemetry/instrumentation-express': ExpressInstrumentation,\n '@opentelemetry/instrumentation-fs': FsInstrumentation,\n '@opentelemetry/instrumentation-generic-pool': GenericPoolInstrumentation,\n '@opentelemetry/instrumentation-graphql': GraphQLInstrumentation,\n '@opentelemetry/instrumentation-grpc': GrpcInstrumentation,\n '@opentelemetry/instrumentation-hapi': HapiInstrumentation,\n '@opentelemetry/instrumentation-host-metrics': HostMetricsInstrumentation,\n '@opentelemetry/instrumentation-http': HttpInstrumentation,\n '@opentelemetry/instrumentation-ioredis': IORedisInstrumentation,\n '@opentelemetry/instrumentation-kafkajs': KafkaJsInstrumentation,\n '@opentelemetry/instrumentation-knex': KnexInstrumentation,\n '@opentelemetry/instrumentation-koa': KoaInstrumentation,\n '@opentelemetry/instrumentation-lru-memoizer': LruMemoizerInstrumentation,\n '@opentelemetry/instrumentation-memcached': MemcachedInstrumentation,\n '@opentelemetry/instrumentation-mongodb': MongoDBInstrumentation,\n '@opentelemetry/instrumentation-mongoose': MongooseInstrumentation,\n '@opentelemetry/instrumentation-mysql2': MySQL2Instrumentation,\n '@opentelemetry/instrumentation-mysql': MySQLInstrumentation,\n '@opentelemetry/instrumentation-nestjs-core': NestInstrumentation,\n '@opentelemetry/instrumentation-net': NetInstrumentation,\n '@opentelemetry/instrumentation-openai': OpenAIInstrumentation,\n '@opentelemetry/instrumentation-oracledb': OracleInstrumentation,\n '@opentelemetry/instrumentation-pg': PgInstrumentation,\n '@opentelemetry/instrumentation-pino': PinoInstrumentation,\n '@opentelemetry/instrumentation-redis': RedisInstrumentation,\n '@opentelemetry/instrumentation-restify': RestifyInstrumentation,\n '@opentelemetry/instrumentation-router': RouterInstrumentation,\n '@opentelemetry/instrumentation-runtime-node': RuntimeNodeInstrumentation,\n '@opentelemetry/instrumentation-socket.io': SocketIoInstrumentation,\n '@opentelemetry/instrumentation-tedious': TediousInstrumentation,\n '@opentelemetry/instrumentation-undici': UndiciInstrumentation,\n '@opentelemetry/instrumentation-winston': WinstonInstrumentation,\n};\n\nconst defaultExcludedInstrumentations = [\n '@opentelemetry/instrumentation-fs',\n '@opentelemetry/instrumentation-host-metrics',\n];\n\n// Config types inferred automatically from the first argument of the constructor\ntype ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;\nexport type InstrumentationConfigMap = {\n [Name in keyof typeof InstrumentationMap]?: ConfigArg<\n (typeof InstrumentationMap)[Name]\n >;\n};\n\nfunction shouldDisableInstrumentation(\n name: string,\n userConfig: any,\n enabledInstrumentationsFromEnv: string[],\n disabledInstrumentationsFromEnv: string[]\n): boolean {\n // Priority 1: Programmatic config\n if (userConfig.enabled === false) {\n diag.debug(\n `Disabling instrumentation for ${name} - disabled by user config`\n );\n return true;\n }\n\n if (userConfig.enabled === true) {\n diag.debug(\n `Enabling instrumentation for ${name} - explicitly enabled by user config`\n );\n return false;\n }\n\n // Priority 2: Environment variables\n if (disabledInstrumentationsFromEnv.includes(name)) {\n diag.debug(`Disabling instrumentation for ${name} - disabled by env var`);\n return true;\n }\n\n const isEnabledEnvSet = !!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS;\n if (isEnabledEnvSet && !enabledInstrumentationsFromEnv.includes(name)) {\n diag.debug(\n `Disabling instrumentation for ${name} - not in enabled env var list`\n );\n return true;\n }\n\n // Priority 3: Default exclusions\n if (!isEnabledEnvSet && defaultExcludedInstrumentations.includes(name)) {\n diag.debug(`Disabling instrumentation for ${name} - excluded by default`);\n return true;\n }\n\n return false;\n}\n\nexport function getNodeAutoInstrumentations(\n inputConfigs: InstrumentationConfigMap = {}\n): Instrumentation[] {\n checkManuallyProvidedInstrumentationNames(Object.keys(inputConfigs));\n const enabledInstrumentationsFromEnv = getEnabledInstrumentationsFromEnv();\n const disabledInstrumentationsFromEnv = getDisabledInstrumentationsFromEnv();\n\n const instrumentations: Instrumentation[] = [];\n\n for (const name of Object.keys(InstrumentationMap) as Array<\n keyof typeof InstrumentationMap\n >) {\n const Instance = InstrumentationMap[name];\n // Defaults are defined by the instrumentation itself\n const userConfig: any = inputConfigs[name] ?? {};\n\n const shouldDisable = shouldDisableInstrumentation(\n name,\n userConfig,\n enabledInstrumentationsFromEnv,\n disabledInstrumentationsFromEnv\n );\n\n if (shouldDisable) {\n continue;\n }\n\n try {\n diag.debug(`Loading instrumentation for ${name}`);\n instrumentations.push(new Instance(userConfig));\n } catch (e: any) {\n diag.error(e);\n }\n }\n\n return instrumentations;\n}\n\nfunction checkManuallyProvidedInstrumentationNames(\n manuallyProvidedInstrumentationNames: string[]\n) {\n for (const name of manuallyProvidedInstrumentationNames) {\n if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) {\n diag.error(`Provided instrumentation name \"${name}\" not found`);\n }\n }\n}\n\nfunction getInstrumentationsFromEnv(envVar: string): string[] {\n const envVarValue = process.env[envVar];\n if (envVarValue == null) {\n return [];\n }\n\n const instrumentationsFromEnv = envVarValue\n ?.split(',')\n .map(\n instrumentationPkgSuffix =>\n `@opentelemetry/instrumentation-${instrumentationPkgSuffix.trim()}`\n );\n checkManuallyProvidedInstrumentationNames(instrumentationsFromEnv);\n return instrumentationsFromEnv;\n}\n\n/**\n * Returns the list of instrumentations that are enabled based on the environment variable.\n * If the environment variable is unset, returns all instrumentation that are enabled by default.\n */\nfunction getEnabledInstrumentationsFromEnv() {\n if (!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS) {\n // all keys in the InstrumentationMap except for everything that is not enabled by default.\n return Object.keys(InstrumentationMap).filter(\n key => !defaultExcludedInstrumentations.includes(key)\n );\n }\n\n const instrumentationsFromEnv = getInstrumentationsFromEnv(\n 'OTEL_NODE_ENABLED_INSTRUMENTATIONS'\n );\n return instrumentationsFromEnv;\n}\n\n/**\n * Returns the list of instrumentations that are disabled based on the environment variable.\n */\nfunction getDisabledInstrumentationsFromEnv() {\n if (!process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS) {\n return [];\n }\n\n const instrumentationsFromEnv = getInstrumentationsFromEnv(\n 'OTEL_NODE_DISABLED_INSTRUMENTATIONS'\n );\n return instrumentationsFromEnv;\n}\n\nexport function getResourceDetectorsFromEnv(): Array<ResourceDetector> {\n const resourceDetectors = new Map<\n string,\n ResourceDetector | ResourceDetector[]\n >([\n [RESOURCE_DETECTOR_CONTAINER, containerDetector],\n [RESOURCE_DETECTOR_HOST, hostDetector],\n [RESOURCE_DETECTOR_OS, osDetector],\n [RESOURCE_DETECTOR_SERVICE_INSTANCE_ID, serviceInstanceIdDetector],\n [RESOURCE_DETECTOR_PROCESS, processDetector],\n [RESOURCE_DETECTOR_ALIBABA, alibabaCloudEcsDetector],\n [RESOURCE_DETECTOR_GCP, gcpDetector],\n [\n RESOURCE_DETECTOR_AWS,\n [\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsBeanstalkDetector,\n awsLambdaDetector,\n ],\n ],\n [\n RESOURCE_DETECTOR_AZURE,\n [azureAppServiceDetector, azureFunctionsDetector, azureVmDetector],\n ],\n [RESOURCE_DETECTOR_ENVIRONMENT, envDetector],\n ]);\n\n const resourceDetectorsFromEnv =\n process.env.OTEL_NODE_RESOURCE_DETECTORS?.split(',') ?? ['all'];\n\n if (resourceDetectorsFromEnv.includes('all')) {\n return [...resourceDetectors.values()].flat();\n }\n\n if (resourceDetectorsFromEnv.includes('none')) {\n return [];\n }\n\n return resourceDetectorsFromEnv.flatMap(detector => {\n const resourceDetector = resourceDetectors.get(detector);\n if (!resourceDetector) {\n diag.error(\n `Invalid resource detector \"${detector}\" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`\n );\n }\n return resourceDetector || [];\n });\n}\n"],"mappings":"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"}
@@ -0,0 +1,93 @@
1
+ import { Instrumentation } from "@opentelemetry/instrumentation";
2
+ import { AmqplibInstrumentation } from "@opentelemetry/instrumentation-amqplib";
3
+ import { AwsLambdaInstrumentation } from "@opentelemetry/instrumentation-aws-lambda";
4
+ import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
5
+ import { BunyanInstrumentation } from "@opentelemetry/instrumentation-bunyan";
6
+ import { CassandraDriverInstrumentation } from "@opentelemetry/instrumentation-cassandra-driver";
7
+ import { ConnectInstrumentation } from "@opentelemetry/instrumentation-connect";
8
+ import { CucumberInstrumentation } from "@opentelemetry/instrumentation-cucumber";
9
+ import { DataloaderInstrumentation } from "@opentelemetry/instrumentation-dataloader";
10
+ import { DnsInstrumentation } from "@opentelemetry/instrumentation-dns";
11
+ import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
12
+ import { FsInstrumentation } from "@opentelemetry/instrumentation-fs";
13
+ import { GenericPoolInstrumentation } from "@opentelemetry/instrumentation-generic-pool";
14
+ import { GraphQLInstrumentation } from "@opentelemetry/instrumentation-graphql";
15
+ import { GrpcInstrumentation } from "@opentelemetry/instrumentation-grpc";
16
+ import { HapiInstrumentation } from "@opentelemetry/instrumentation-hapi";
17
+ import { HostMetricsInstrumentation } from "@opentelemetry/instrumentation-host-metrics";
18
+ import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
19
+ import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis";
20
+ import { KafkaJsInstrumentation } from "@opentelemetry/instrumentation-kafkajs";
21
+ import { KnexInstrumentation } from "@opentelemetry/instrumentation-knex";
22
+ import { KoaInstrumentation } from "@opentelemetry/instrumentation-koa";
23
+ import { LruMemoizerInstrumentation } from "@opentelemetry/instrumentation-lru-memoizer";
24
+ import { MemcachedInstrumentation } from "@opentelemetry/instrumentation-memcached";
25
+ import { MongoDBInstrumentation } from "@opentelemetry/instrumentation-mongodb";
26
+ import { MongooseInstrumentation } from "@opentelemetry/instrumentation-mongoose";
27
+ import { MySQL2Instrumentation } from "@opentelemetry/instrumentation-mysql2";
28
+ import { MySQLInstrumentation } from "@opentelemetry/instrumentation-mysql";
29
+ import { NestInstrumentation } from "@opentelemetry/instrumentation-nestjs-core";
30
+ import { NetInstrumentation } from "@opentelemetry/instrumentation-net";
31
+ import { OpenAIInstrumentation } from "@opentelemetry/instrumentation-openai";
32
+ import { OracleInstrumentation } from "@opentelemetry/instrumentation-oracledb";
33
+ import { PgInstrumentation } from "@opentelemetry/instrumentation-pg";
34
+ import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino";
35
+ import { RedisInstrumentation } from "@opentelemetry/instrumentation-redis";
36
+ import { RestifyInstrumentation } from "@opentelemetry/instrumentation-restify";
37
+ import { RouterInstrumentation } from "@opentelemetry/instrumentation-router";
38
+ import { RuntimeNodeInstrumentation } from "@opentelemetry/instrumentation-runtime-node";
39
+ import { SocketIoInstrumentation } from "@opentelemetry/instrumentation-socket.io";
40
+ import { TediousInstrumentation } from "@opentelemetry/instrumentation-tedious";
41
+ import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici";
42
+ import { WinstonInstrumentation } from "@opentelemetry/instrumentation-winston";
43
+ import { ResourceDetector } from "@opentelemetry/resources";
44
+ //#region src/utils.d.ts
45
+ declare const InstrumentationMap: {
46
+ '@opentelemetry/instrumentation-amqplib': typeof AmqplibInstrumentation;
47
+ '@opentelemetry/instrumentation-aws-lambda': typeof AwsLambdaInstrumentation;
48
+ '@opentelemetry/instrumentation-aws-sdk': typeof AwsInstrumentation;
49
+ '@opentelemetry/instrumentation-bunyan': typeof BunyanInstrumentation;
50
+ '@opentelemetry/instrumentation-cassandra-driver': typeof CassandraDriverInstrumentation;
51
+ '@opentelemetry/instrumentation-connect': typeof ConnectInstrumentation;
52
+ '@opentelemetry/instrumentation-cucumber': typeof CucumberInstrumentation;
53
+ '@opentelemetry/instrumentation-dataloader': typeof DataloaderInstrumentation;
54
+ '@opentelemetry/instrumentation-dns': typeof DnsInstrumentation;
55
+ '@opentelemetry/instrumentation-express': typeof ExpressInstrumentation;
56
+ '@opentelemetry/instrumentation-fs': typeof FsInstrumentation;
57
+ '@opentelemetry/instrumentation-generic-pool': typeof GenericPoolInstrumentation;
58
+ '@opentelemetry/instrumentation-graphql': typeof GraphQLInstrumentation;
59
+ '@opentelemetry/instrumentation-grpc': typeof GrpcInstrumentation;
60
+ '@opentelemetry/instrumentation-hapi': typeof HapiInstrumentation;
61
+ '@opentelemetry/instrumentation-host-metrics': typeof HostMetricsInstrumentation;
62
+ '@opentelemetry/instrumentation-http': typeof HttpInstrumentation;
63
+ '@opentelemetry/instrumentation-ioredis': typeof IORedisInstrumentation;
64
+ '@opentelemetry/instrumentation-kafkajs': typeof KafkaJsInstrumentation;
65
+ '@opentelemetry/instrumentation-knex': typeof KnexInstrumentation;
66
+ '@opentelemetry/instrumentation-koa': typeof KoaInstrumentation;
67
+ '@opentelemetry/instrumentation-lru-memoizer': typeof LruMemoizerInstrumentation;
68
+ '@opentelemetry/instrumentation-memcached': typeof MemcachedInstrumentation;
69
+ '@opentelemetry/instrumentation-mongodb': typeof MongoDBInstrumentation;
70
+ '@opentelemetry/instrumentation-mongoose': typeof MongooseInstrumentation;
71
+ '@opentelemetry/instrumentation-mysql2': typeof MySQL2Instrumentation;
72
+ '@opentelemetry/instrumentation-mysql': typeof MySQLInstrumentation;
73
+ '@opentelemetry/instrumentation-nestjs-core': typeof NestInstrumentation;
74
+ '@opentelemetry/instrumentation-net': typeof NetInstrumentation;
75
+ '@opentelemetry/instrumentation-openai': typeof OpenAIInstrumentation;
76
+ '@opentelemetry/instrumentation-oracledb': typeof OracleInstrumentation;
77
+ '@opentelemetry/instrumentation-pg': typeof PgInstrumentation;
78
+ '@opentelemetry/instrumentation-pino': typeof PinoInstrumentation;
79
+ '@opentelemetry/instrumentation-redis': typeof RedisInstrumentation;
80
+ '@opentelemetry/instrumentation-restify': typeof RestifyInstrumentation;
81
+ '@opentelemetry/instrumentation-router': typeof RouterInstrumentation;
82
+ '@opentelemetry/instrumentation-runtime-node': typeof RuntimeNodeInstrumentation;
83
+ '@opentelemetry/instrumentation-socket.io': typeof SocketIoInstrumentation;
84
+ '@opentelemetry/instrumentation-tedious': typeof TediousInstrumentation;
85
+ '@opentelemetry/instrumentation-undici': typeof UndiciInstrumentation;
86
+ '@opentelemetry/instrumentation-winston': typeof WinstonInstrumentation;
87
+ };
88
+ type ConfigArg<T> = T extends (new (...args: infer U) => unknown) ? U[0] : never;
89
+ export type InstrumentationConfigMap = { [Name in keyof typeof InstrumentationMap]?: ConfigArg<(typeof InstrumentationMap)[Name]>; };
90
+ export declare function getNodeAutoInstrumentations(inputConfigs?: InstrumentationConfigMap): Instrumentation[];
91
+ export declare function getResourceDetectorsFromEnv(): Array<ResourceDetector>;
92
+ //#endregion
93
+ //# sourceMappingURL=utils.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.d.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Cc;EACV,iDAAiD;EACjD,oDAAoD;EACpD,iDAAiD;EACjD,gDAAgD;EAChD,0DAA0D;EAC1D,iDAAiD;EACjD,kDAAkD;EAClD,oDAAoD;EACpD,6CAA6C;EAC7C,iDAAiD;EACjD,4CAA4C;EAC5C,sDAAsD;EACtD,iDAAiD;EACjD,8CAA8C;EAC9C,8CAA8C;EAC9C,sDAAsD;EACtD,8CAA8C;EAC9C,iDAAiD;EACjD,iDAAiD;EACjD,8CAA8C;EAC9C,6CAA6C;EAC7C,sDAAsD;EACtD,mDAAmD;EACnD,iDAAiD;EACjD,kDAAkD;EAClD,gDAAgD;EAChD,+CAA+C;EAC/C,qDAAqD;EACrD,6CAA6C;EAC7C,gDAAgD;EAChD,kDAAkD;EAClD,4CAA4C;EAC5C,8CAA8C;EAC9C,+CAA+C;EAC/C,iDAAiD;EACjD,gDAAgD;EAChD,sDAAsD;EACtD,mDAAmD;EACnD,iDAAiD;EACjD,gDAAgD;EAChD,iDAAiD;;KAEhD,UAAU,KAAK,mBAAkB,YAAY,iBAAgB;YACtD,8BACP,qBAAqB,sBAAsB,kBAAkB,oBAAoB;wBAE9D,4BAA4B,eAAe,2BAA2B;wBACtE,+BAA+B,MAAM"}
@@ -0,0 +1,93 @@
1
+ import { AmqplibInstrumentation } from "@opentelemetry/instrumentation-amqplib";
2
+ import { AwsLambdaInstrumentation } from "@opentelemetry/instrumentation-aws-lambda";
3
+ import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
4
+ import { BunyanInstrumentation } from "@opentelemetry/instrumentation-bunyan";
5
+ import { CassandraDriverInstrumentation } from "@opentelemetry/instrumentation-cassandra-driver";
6
+ import { ConnectInstrumentation } from "@opentelemetry/instrumentation-connect";
7
+ import { CucumberInstrumentation } from "@opentelemetry/instrumentation-cucumber";
8
+ import { DataloaderInstrumentation } from "@opentelemetry/instrumentation-dataloader";
9
+ import { DnsInstrumentation } from "@opentelemetry/instrumentation-dns";
10
+ import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
11
+ import { FsInstrumentation } from "@opentelemetry/instrumentation-fs";
12
+ import { GenericPoolInstrumentation } from "@opentelemetry/instrumentation-generic-pool";
13
+ import { GraphQLInstrumentation } from "@opentelemetry/instrumentation-graphql";
14
+ import { GrpcInstrumentation } from "@opentelemetry/instrumentation-grpc";
15
+ import { HapiInstrumentation } from "@opentelemetry/instrumentation-hapi";
16
+ import { HostMetricsInstrumentation } from "@opentelemetry/instrumentation-host-metrics";
17
+ import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
18
+ import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis";
19
+ import { KafkaJsInstrumentation } from "@opentelemetry/instrumentation-kafkajs";
20
+ import { KnexInstrumentation } from "@opentelemetry/instrumentation-knex";
21
+ import { KoaInstrumentation } from "@opentelemetry/instrumentation-koa";
22
+ import { LruMemoizerInstrumentation } from "@opentelemetry/instrumentation-lru-memoizer";
23
+ import { MemcachedInstrumentation } from "@opentelemetry/instrumentation-memcached";
24
+ import { MongoDBInstrumentation } from "@opentelemetry/instrumentation-mongodb";
25
+ import { MongooseInstrumentation } from "@opentelemetry/instrumentation-mongoose";
26
+ import { MySQL2Instrumentation } from "@opentelemetry/instrumentation-mysql2";
27
+ import { MySQLInstrumentation } from "@opentelemetry/instrumentation-mysql";
28
+ import { NestInstrumentation } from "@opentelemetry/instrumentation-nestjs-core";
29
+ import { NetInstrumentation } from "@opentelemetry/instrumentation-net";
30
+ import { OpenAIInstrumentation } from "@opentelemetry/instrumentation-openai";
31
+ import { OracleInstrumentation } from "@opentelemetry/instrumentation-oracledb";
32
+ import { PgInstrumentation } from "@opentelemetry/instrumentation-pg";
33
+ import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino";
34
+ import { RedisInstrumentation } from "@opentelemetry/instrumentation-redis";
35
+ import { RestifyInstrumentation } from "@opentelemetry/instrumentation-restify";
36
+ import { RouterInstrumentation } from "@opentelemetry/instrumentation-router";
37
+ import { RuntimeNodeInstrumentation } from "@opentelemetry/instrumentation-runtime-node";
38
+ import { SocketIoInstrumentation } from "@opentelemetry/instrumentation-socket.io";
39
+ import { TediousInstrumentation } from "@opentelemetry/instrumentation-tedious";
40
+ import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici";
41
+ import { WinstonInstrumentation } from "@opentelemetry/instrumentation-winston";
42
+ import { ResourceDetector } from "@opentelemetry/resources";
43
+ import { Instrumentation } from "@opentelemetry/instrumentation";
44
+ //#region src/utils.d.ts
45
+ declare const InstrumentationMap: {
46
+ '@opentelemetry/instrumentation-amqplib': typeof AmqplibInstrumentation;
47
+ '@opentelemetry/instrumentation-aws-lambda': typeof AwsLambdaInstrumentation;
48
+ '@opentelemetry/instrumentation-aws-sdk': typeof AwsInstrumentation;
49
+ '@opentelemetry/instrumentation-bunyan': typeof BunyanInstrumentation;
50
+ '@opentelemetry/instrumentation-cassandra-driver': typeof CassandraDriverInstrumentation;
51
+ '@opentelemetry/instrumentation-connect': typeof ConnectInstrumentation;
52
+ '@opentelemetry/instrumentation-cucumber': typeof CucumberInstrumentation;
53
+ '@opentelemetry/instrumentation-dataloader': typeof DataloaderInstrumentation;
54
+ '@opentelemetry/instrumentation-dns': typeof DnsInstrumentation;
55
+ '@opentelemetry/instrumentation-express': typeof ExpressInstrumentation;
56
+ '@opentelemetry/instrumentation-fs': typeof FsInstrumentation;
57
+ '@opentelemetry/instrumentation-generic-pool': typeof GenericPoolInstrumentation;
58
+ '@opentelemetry/instrumentation-graphql': typeof GraphQLInstrumentation;
59
+ '@opentelemetry/instrumentation-grpc': typeof GrpcInstrumentation;
60
+ '@opentelemetry/instrumentation-hapi': typeof HapiInstrumentation;
61
+ '@opentelemetry/instrumentation-host-metrics': typeof HostMetricsInstrumentation;
62
+ '@opentelemetry/instrumentation-http': typeof HttpInstrumentation;
63
+ '@opentelemetry/instrumentation-ioredis': typeof IORedisInstrumentation;
64
+ '@opentelemetry/instrumentation-kafkajs': typeof KafkaJsInstrumentation;
65
+ '@opentelemetry/instrumentation-knex': typeof KnexInstrumentation;
66
+ '@opentelemetry/instrumentation-koa': typeof KoaInstrumentation;
67
+ '@opentelemetry/instrumentation-lru-memoizer': typeof LruMemoizerInstrumentation;
68
+ '@opentelemetry/instrumentation-memcached': typeof MemcachedInstrumentation;
69
+ '@opentelemetry/instrumentation-mongodb': typeof MongoDBInstrumentation;
70
+ '@opentelemetry/instrumentation-mongoose': typeof MongooseInstrumentation;
71
+ '@opentelemetry/instrumentation-mysql2': typeof MySQL2Instrumentation;
72
+ '@opentelemetry/instrumentation-mysql': typeof MySQLInstrumentation;
73
+ '@opentelemetry/instrumentation-nestjs-core': typeof NestInstrumentation;
74
+ '@opentelemetry/instrumentation-net': typeof NetInstrumentation;
75
+ '@opentelemetry/instrumentation-openai': typeof OpenAIInstrumentation;
76
+ '@opentelemetry/instrumentation-oracledb': typeof OracleInstrumentation;
77
+ '@opentelemetry/instrumentation-pg': typeof PgInstrumentation;
78
+ '@opentelemetry/instrumentation-pino': typeof PinoInstrumentation;
79
+ '@opentelemetry/instrumentation-redis': typeof RedisInstrumentation;
80
+ '@opentelemetry/instrumentation-restify': typeof RestifyInstrumentation;
81
+ '@opentelemetry/instrumentation-router': typeof RouterInstrumentation;
82
+ '@opentelemetry/instrumentation-runtime-node': typeof RuntimeNodeInstrumentation;
83
+ '@opentelemetry/instrumentation-socket.io': typeof SocketIoInstrumentation;
84
+ '@opentelemetry/instrumentation-tedious': typeof TediousInstrumentation;
85
+ '@opentelemetry/instrumentation-undici': typeof UndiciInstrumentation;
86
+ '@opentelemetry/instrumentation-winston': typeof WinstonInstrumentation;
87
+ };
88
+ type ConfigArg<T> = T extends (new (...args: infer U) => unknown) ? U[0] : never;
89
+ export type InstrumentationConfigMap = { [Name in keyof typeof InstrumentationMap]?: ConfigArg<(typeof InstrumentationMap)[Name]>; };
90
+ export declare function getNodeAutoInstrumentations(inputConfigs?: InstrumentationConfigMap): Instrumentation[];
91
+ export declare function getResourceDetectorsFromEnv(): Array<ResourceDetector>;
92
+ //#endregion
93
+ //# sourceMappingURL=utils.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.d.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Cc;EACV,iDAAiD;EACjD,oDAAoD;EACpD,iDAAiD;EACjD,gDAAgD;EAChD,0DAA0D;EAC1D,iDAAiD;EACjD,kDAAkD;EAClD,oDAAoD;EACpD,6CAA6C;EAC7C,iDAAiD;EACjD,4CAA4C;EAC5C,sDAAsD;EACtD,iDAAiD;EACjD,8CAA8C;EAC9C,8CAA8C;EAC9C,sDAAsD;EACtD,8CAA8C;EAC9C,iDAAiD;EACjD,iDAAiD;EACjD,8CAA8C;EAC9C,6CAA6C;EAC7C,sDAAsD;EACtD,mDAAmD;EACnD,iDAAiD;EACjD,kDAAkD;EAClD,gDAAgD;EAChD,+CAA+C;EAC/C,qDAAqD;EACrD,6CAA6C;EAC7C,gDAAgD;EAChD,kDAAkD;EAClD,4CAA4C;EAC5C,8CAA8C;EAC9C,+CAA+C;EAC/C,iDAAiD;EACjD,gDAAgD;EAChD,sDAAsD;EACtD,mDAAmD;EACnD,iDAAiD;EACjD,gDAAgD;EAChD,iDAAiD;;KAEhD,UAAU,KAAK,mBAAkB,YAAY,iBAAgB;YACtD,8BACP,qBAAqB,sBAAsB,kBAAkB,oBAAoB;wBAE9D,4BAA4B,eAAe,2BAA2B;wBACtE,+BAA+B,MAAM"}