@opentelemetry/otlp-exporter-base 0.222.0 → 0.300.0-development.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.
- package/dist/ExporterMetrics.cjs +80 -0
- package/dist/ExporterMetrics.cjs.map +1 -0
- package/dist/ExporterMetrics.d.cts +27 -0
- package/dist/ExporterMetrics.d.cts.map +1 -0
- package/dist/ExporterMetrics.d.mts +27 -0
- package/dist/ExporterMetrics.d.mts.map +1 -0
- package/dist/ExporterMetrics.mjs +80 -0
- package/dist/ExporterMetrics.mjs.map +1 -0
- package/dist/OTLPExporterBase.cjs +28 -0
- package/dist/OTLPExporterBase.cjs.map +1 -0
- package/dist/OTLPExporterBase.d.cts +20 -0
- package/dist/OTLPExporterBase.d.cts.map +1 -0
- package/dist/OTLPExporterBase.d.mts +20 -0
- package/dist/OTLPExporterBase.d.mts.map +1 -0
- package/dist/OTLPExporterBase.mjs +28 -0
- package/dist/OTLPExporterBase.mjs.map +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/bounded-queue-export-promise-handler.cjs +37 -0
- package/dist/bounded-queue-export-promise-handler.cjs.map +1 -0
- package/dist/bounded-queue-export-promise-handler.mjs +37 -0
- package/dist/bounded-queue-export-promise-handler.mjs.map +1 -0
- package/dist/configuration/convert-legacy-browser-http-options.cjs +22 -0
- package/dist/configuration/convert-legacy-browser-http-options.cjs.map +1 -0
- package/dist/configuration/convert-legacy-browser-http-options.d.cts +14 -0
- package/dist/configuration/convert-legacy-browser-http-options.d.cts.map +1 -0
- package/dist/configuration/convert-legacy-browser-http-options.d.mts +14 -0
- package/dist/configuration/convert-legacy-browser-http-options.d.mts.map +1 -0
- package/dist/configuration/convert-legacy-browser-http-options.mjs +22 -0
- package/dist/configuration/convert-legacy-browser-http-options.mjs.map +1 -0
- package/dist/configuration/convert-legacy-http-options.cjs +10 -0
- package/dist/configuration/convert-legacy-http-options.cjs.map +1 -0
- package/dist/configuration/convert-legacy-http-options.mjs +10 -0
- package/dist/configuration/convert-legacy-http-options.mjs.map +1 -0
- package/dist/configuration/convert-legacy-node-http-options.cjs +38 -0
- package/{build/src/configuration/convert-legacy-node-http-options.js.map → dist/configuration/convert-legacy-node-http-options.cjs.map} +1 -1
- package/dist/configuration/convert-legacy-node-http-options.d.cts +14 -0
- package/dist/configuration/convert-legacy-node-http-options.d.cts.map +1 -0
- package/dist/configuration/convert-legacy-node-http-options.d.mts +14 -0
- package/dist/configuration/convert-legacy-node-http-options.d.mts.map +1 -0
- package/dist/configuration/convert-legacy-node-http-options.mjs +38 -0
- package/dist/configuration/convert-legacy-node-http-options.mjs.map +1 -0
- package/dist/configuration/create-legacy-browser-delegate.cjs +41 -0
- package/{build/esm/configuration/create-legacy-browser-delegate.js.map → dist/configuration/create-legacy-browser-delegate.cjs.map} +1 -1
- package/dist/configuration/create-legacy-browser-delegate.d.cts +21 -0
- package/dist/configuration/create-legacy-browser-delegate.d.cts.map +1 -0
- package/dist/configuration/create-legacy-browser-delegate.d.mts +21 -0
- package/dist/configuration/create-legacy-browser-delegate.d.mts.map +1 -0
- package/dist/configuration/create-legacy-browser-delegate.mjs +40 -0
- package/dist/configuration/create-legacy-browser-delegate.mjs.map +1 -0
- package/dist/configuration/legacy-base-configuration.d.cts +55 -0
- package/dist/configuration/legacy-base-configuration.d.cts.map +1 -0
- package/dist/configuration/legacy-base-configuration.d.mts +55 -0
- package/dist/configuration/legacy-base-configuration.d.mts.map +1 -0
- package/dist/configuration/legacy-node-configuration.cjs +10 -0
- package/dist/configuration/legacy-node-configuration.cjs.map +1 -0
- package/dist/configuration/legacy-node-configuration.d.cts +63 -0
- package/dist/configuration/legacy-node-configuration.d.cts.map +1 -0
- package/dist/configuration/legacy-node-configuration.d.mts +63 -0
- package/dist/configuration/legacy-node-configuration.d.mts.map +1 -0
- package/dist/configuration/legacy-node-configuration.mjs +10 -0
- package/dist/configuration/legacy-node-configuration.mjs.map +1 -0
- package/dist/configuration/otlp-http-configuration.cjs +45 -0
- package/dist/configuration/otlp-http-configuration.cjs.map +1 -0
- package/dist/configuration/otlp-http-configuration.d.cts +10 -0
- package/dist/configuration/otlp-http-configuration.d.cts.map +1 -0
- package/dist/configuration/otlp-http-configuration.d.mts +10 -0
- package/dist/configuration/otlp-http-configuration.d.mts.map +1 -0
- package/dist/configuration/otlp-http-configuration.mjs +44 -0
- package/dist/configuration/otlp-http-configuration.mjs.map +1 -0
- package/dist/configuration/otlp-node-http-configuration.cjs +37 -0
- package/dist/configuration/otlp-node-http-configuration.cjs.map +1 -0
- package/dist/configuration/otlp-node-http-configuration.d.cts +29 -0
- package/dist/configuration/otlp-node-http-configuration.d.cts.map +1 -0
- package/dist/configuration/otlp-node-http-configuration.d.mts +29 -0
- package/dist/configuration/otlp-node-http-configuration.d.mts.map +1 -0
- package/dist/configuration/otlp-node-http-configuration.mjs +35 -0
- package/dist/configuration/otlp-node-http-configuration.mjs.map +1 -0
- package/dist/configuration/otlp-node-http-env-configuration.cjs +98 -0
- package/dist/configuration/otlp-node-http-env-configuration.cjs.map +1 -0
- package/dist/configuration/otlp-node-http-env-configuration.mjs +95 -0
- package/dist/configuration/otlp-node-http-env-configuration.mjs.map +1 -0
- package/dist/configuration/shared-configuration.cjs +35 -0
- package/dist/configuration/shared-configuration.cjs.map +1 -0
- package/dist/configuration/shared-configuration.d.cts +24 -0
- package/dist/configuration/shared-configuration.d.cts.map +1 -0
- package/dist/configuration/shared-configuration.d.mts +24 -0
- package/dist/configuration/shared-configuration.d.mts.map +1 -0
- package/dist/configuration/shared-configuration.mjs +32 -0
- package/dist/configuration/shared-configuration.mjs.map +1 -0
- package/dist/configuration/shared-env-configuration.cjs +35 -0
- package/dist/configuration/shared-env-configuration.cjs.map +1 -0
- package/dist/configuration/shared-env-configuration.d.cts +6 -0
- package/dist/configuration/shared-env-configuration.d.cts.map +1 -0
- package/dist/configuration/shared-env-configuration.d.mts +6 -0
- package/dist/configuration/shared-env-configuration.d.mts.map +1 -0
- package/dist/configuration/shared-env-configuration.mjs +35 -0
- package/dist/configuration/shared-env-configuration.mjs.map +1 -0
- package/dist/export-response.d.cts +18 -0
- package/dist/export-response.d.cts.map +1 -0
- package/dist/export-response.d.mts +18 -0
- package/dist/export-response.d.mts.map +1 -0
- package/dist/exporter-transport.d.cts +9 -0
- package/dist/exporter-transport.d.cts.map +1 -0
- package/dist/exporter-transport.d.mts +9 -0
- package/dist/exporter-transport.d.mts.map +1 -0
- package/dist/index-browser-http.cjs +8 -0
- package/dist/index-browser-http.d.cts +4 -0
- package/dist/index-browser-http.d.mts +4 -0
- package/dist/index-browser-http.mjs +4 -0
- package/dist/index-node-http.cjs +10 -0
- package/dist/index-node-http.d.cts +5 -0
- package/dist/index-node-http.d.mts +5 -0
- package/dist/index-node-http.mjs +5 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +7 -0
- package/dist/is-export-retryable.cjs +17 -0
- package/dist/is-export-retryable.cjs.map +1 -0
- package/dist/is-export-retryable.mjs +16 -0
- package/dist/is-export-retryable.mjs.map +1 -0
- package/dist/logging-response-handler.cjs +18 -0
- package/{build/src/logging-response-handler.js.map → dist/logging-response-handler.cjs.map} +1 -1
- package/dist/logging-response-handler.mjs +18 -0
- package/dist/logging-response-handler.mjs.map +1 -0
- package/dist/otlp-browser-http-export-delegate.cjs +18 -0
- package/dist/otlp-browser-http-export-delegate.cjs.map +1 -0
- package/dist/otlp-browser-http-export-delegate.d.cts +12 -0
- package/dist/otlp-browser-http-export-delegate.d.cts.map +1 -0
- package/dist/otlp-browser-http-export-delegate.d.mts +12 -0
- package/dist/otlp-browser-http-export-delegate.d.mts.map +1 -0
- package/dist/otlp-browser-http-export-delegate.mjs +17 -0
- package/dist/otlp-browser-http-export-delegate.mjs.map +1 -0
- package/dist/otlp-export-delegate.cjs +101 -0
- package/dist/otlp-export-delegate.cjs.map +1 -0
- package/dist/otlp-export-delegate.d.cts +16 -0
- package/dist/otlp-export-delegate.d.cts.map +1 -0
- package/dist/otlp-export-delegate.d.mts +16 -0
- package/dist/otlp-export-delegate.d.mts.map +1 -0
- package/dist/otlp-export-delegate.mjs +101 -0
- package/dist/otlp-export-delegate.mjs.map +1 -0
- package/dist/otlp-http-export-delegate.cjs +34 -0
- package/dist/otlp-http-export-delegate.cjs.map +1 -0
- package/dist/otlp-http-export-delegate.d.cts +11 -0
- package/dist/otlp-http-export-delegate.d.cts.map +1 -0
- package/dist/otlp-http-export-delegate.d.mts +11 -0
- package/dist/otlp-http-export-delegate.d.mts.map +1 -0
- package/dist/otlp-http-export-delegate.mjs +33 -0
- package/dist/otlp-http-export-delegate.mjs.map +1 -0
- package/dist/otlp-network-export-delegate.cjs +15 -0
- package/dist/otlp-network-export-delegate.cjs.map +1 -0
- package/dist/otlp-network-export-delegate.d.cts +10 -0
- package/dist/otlp-network-export-delegate.d.cts.map +1 -0
- package/dist/otlp-network-export-delegate.d.mts +10 -0
- package/dist/otlp-network-export-delegate.d.mts.map +1 -0
- package/dist/otlp-network-export-delegate.mjs +15 -0
- package/dist/otlp-network-export-delegate.mjs.map +1 -0
- package/dist/retrying-transport.cjs +62 -0
- package/dist/retrying-transport.cjs.map +1 -0
- package/dist/retrying-transport.mjs +62 -0
- package/dist/retrying-transport.mjs.map +1 -0
- package/dist/semconv.cjs +100 -0
- package/dist/semconv.cjs.map +1 -0
- package/dist/semconv.mjs +95 -0
- package/dist/semconv.mjs.map +1 -0
- package/dist/transport/fetch-transport.cjs +143 -0
- package/dist/transport/fetch-transport.cjs.map +1 -0
- package/dist/transport/fetch-transport.mjs +143 -0
- package/dist/transport/fetch-transport.mjs.map +1 -0
- package/dist/transport/http-exporter-transport.cjs +38 -0
- package/dist/transport/http-exporter-transport.cjs.map +1 -0
- package/dist/transport/http-exporter-transport.mjs +38 -0
- package/dist/transport/http-exporter-transport.mjs.map +1 -0
- package/dist/transport/http-transport-utils.cjs +136 -0
- package/dist/transport/http-transport-utils.cjs.map +1 -0
- package/dist/transport/http-transport-utils.mjs +132 -0
- package/dist/transport/http-transport-utils.mjs.map +1 -0
- package/dist/types.cjs +18 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +13 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +13 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +18 -0
- package/dist/types.mjs.map +1 -0
- package/dist/util.cjs +18 -0
- package/dist/util.cjs.map +1 -0
- package/dist/util.mjs +18 -0
- package/dist/util.mjs.map +1 -0
- package/dist/version.cjs +6 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.mjs +6 -0
- package/dist/version.mjs.map +1 -0
- package/package.json +41 -38
- package/build/esm/ExporterMetrics.d.ts +0 -24
- package/build/esm/ExporterMetrics.js +0 -104
- package/build/esm/ExporterMetrics.js.map +0 -1
- package/build/esm/OTLPExporterBase.d.ts +0 -17
- package/build/esm/OTLPExporterBase.js +0 -28
- package/build/esm/OTLPExporterBase.js.map +0 -1
- package/build/esm/bounded-queue-export-promise-handler.d.ts +0 -13
- package/build/esm/bounded-queue-export-promise-handler.js +0 -39
- package/build/esm/bounded-queue-export-promise-handler.js.map +0 -1
- package/build/esm/configuration/convert-legacy-browser-http-options.d.ts +0 -11
- package/build/esm/configuration/convert-legacy-browser-http-options.js +0 -19
- package/build/esm/configuration/convert-legacy-browser-http-options.js.map +0 -1
- package/build/esm/configuration/convert-legacy-http-options.d.ts +0 -4
- package/build/esm/configuration/convert-legacy-http-options.js +0 -12
- package/build/esm/configuration/convert-legacy-http-options.js.map +0 -1
- package/build/esm/configuration/convert-legacy-node-http-options.d.ts +0 -11
- package/build/esm/configuration/convert-legacy-node-http-options.js +0 -43
- package/build/esm/configuration/convert-legacy-node-http-options.js.map +0 -1
- package/build/esm/configuration/create-legacy-browser-delegate.d.ts +0 -18
- package/build/esm/configuration/create-legacy-browser-delegate.js +0 -48
- package/build/esm/configuration/legacy-base-configuration.d.ts +0 -52
- package/build/esm/configuration/legacy-base-configuration.js +0 -2
- package/build/esm/configuration/legacy-base-configuration.js.map +0 -1
- package/build/esm/configuration/legacy-node-configuration.d.ts +0 -61
- package/build/esm/configuration/legacy-node-configuration.js +0 -10
- package/build/esm/configuration/legacy-node-configuration.js.map +0 -1
- package/build/esm/configuration/otlp-http-configuration.d.ts +0 -14
- package/build/esm/configuration/otlp-http-configuration.js +0 -59
- package/build/esm/configuration/otlp-http-configuration.js.map +0 -1
- package/build/esm/configuration/otlp-node-http-configuration.d.ts +0 -34
- package/build/esm/configuration/otlp-node-http-configuration.js +0 -35
- package/build/esm/configuration/otlp-node-http-configuration.js.map +0 -1
- package/build/esm/configuration/otlp-node-http-env-configuration.d.ts +0 -9
- package/build/esm/configuration/otlp-node-http-env-configuration.js +0 -119
- package/build/esm/configuration/otlp-node-http-env-configuration.js.map +0 -1
- package/build/esm/configuration/shared-configuration.d.ts +0 -24
- package/build/esm/configuration/shared-configuration.js +0 -42
- package/build/esm/configuration/shared-configuration.js.map +0 -1
- package/build/esm/configuration/shared-env-configuration.d.ts +0 -3
- package/build/esm/configuration/shared-env-configuration.js +0 -41
- package/build/esm/configuration/shared-env-configuration.js.map +0 -1
- package/build/esm/export-response.d.ts +0 -15
- package/build/esm/export-response.js +0 -6
- package/build/esm/export-response.js.map +0 -1
- package/build/esm/exporter-transport.d.ts +0 -6
- package/build/esm/exporter-transport.js +0 -6
- package/build/esm/exporter-transport.js.map +0 -1
- package/build/esm/index-browser-http.d.ts +0 -7
- package/build/esm/index-browser-http.js +0 -11
- package/build/esm/index-browser-http.js.map +0 -1
- package/build/esm/index-node-http.d.ts +0 -5
- package/build/esm/index-node-http.js +0 -9
- package/build/esm/index-node-http.js.map +0 -1
- package/build/esm/index.d.ts +0 -13
- package/build/esm/index.js +0 -11
- package/build/esm/index.js.map +0 -1
- package/build/esm/is-export-retryable.d.ts +0 -3
- package/build/esm/is-export-retryable.js +0 -26
- package/build/esm/is-export-retryable.js.map +0 -1
- package/build/esm/logging-response-handler.d.ts +0 -6
- package/build/esm/logging-response-handler.js +0 -27
- package/build/esm/logging-response-handler.js.map +0 -1
- package/build/esm/otlp-browser-http-export-delegate.d.ts +0 -10
- package/build/esm/otlp-browser-http-export-delegate.js +0 -19
- package/build/esm/otlp-browser-http-export-delegate.js.map +0 -1
- package/build/esm/otlp-export-delegate.d.ts +0 -27
- package/build/esm/otlp-export-delegate.js +0 -114
- package/build/esm/otlp-export-delegate.js.map +0 -1
- package/build/esm/otlp-http-export-delegate.d.ts +0 -8
- package/build/esm/otlp-http-export-delegate.js +0 -43
- package/build/esm/otlp-http-export-delegate.js.map +0 -1
- package/build/esm/otlp-network-export-delegate.d.ts +0 -7
- package/build/esm/otlp-network-export-delegate.js +0 -15
- package/build/esm/otlp-network-export-delegate.js.map +0 -1
- package/build/esm/response-handler.d.ts +0 -12
- package/build/esm/response-handler.js +0 -6
- package/build/esm/response-handler.js.map +0 -1
- package/build/esm/retrying-transport.d.ts +0 -8
- package/build/esm/retrying-transport.js +0 -70
- package/build/esm/retrying-transport.js.map +0 -1
- package/build/esm/semconv.d.ts +0 -91
- package/build/esm/semconv.js +0 -100
- package/build/esm/semconv.js.map +0 -1
- package/build/esm/transport/fetch-transport.d.ts +0 -12
- package/build/esm/transport/fetch-transport.js +0 -133
- package/build/esm/transport/fetch-transport.js.map +0 -1
- package/build/esm/transport/http-exporter-transport.d.ts +0 -4
- package/build/esm/transport/http-exporter-transport.js +0 -41
- package/build/esm/transport/http-exporter-transport.js.map +0 -1
- package/build/esm/transport/http-transport-types.d.ts +0 -8
- package/build/esm/transport/http-transport-types.js +0 -6
- package/build/esm/transport/http-transport-types.js.map +0 -1
- package/build/esm/transport/http-transport-utils.d.ts +0 -25
- package/build/esm/transport/http-transport-utils.js +0 -167
- package/build/esm/transport/http-transport-utils.js.map +0 -1
- package/build/esm/transport/node-http-transport-types.d.ts +0 -6
- package/build/esm/transport/node-http-transport-types.js +0 -6
- package/build/esm/transport/node-http-transport-types.js.map +0 -1
- package/build/esm/types.d.ts +0 -23
- package/build/esm/types.js +0 -18
- package/build/esm/types.js.map +0 -1
- package/build/esm/util.d.ts +0 -6
- package/build/esm/util.js +0 -22
- package/build/esm/util.js.map +0 -1
- package/build/esm/version.d.ts +0 -2
- package/build/esm/version.js +0 -7
- package/build/esm/version.js.map +0 -1
- package/build/esnext/ExporterMetrics.d.ts +0 -24
- package/build/esnext/ExporterMetrics.js +0 -104
- package/build/esnext/ExporterMetrics.js.map +0 -1
- package/build/esnext/OTLPExporterBase.d.ts +0 -17
- package/build/esnext/OTLPExporterBase.js +0 -28
- package/build/esnext/OTLPExporterBase.js.map +0 -1
- package/build/esnext/bounded-queue-export-promise-handler.d.ts +0 -13
- package/build/esnext/bounded-queue-export-promise-handler.js +0 -39
- package/build/esnext/bounded-queue-export-promise-handler.js.map +0 -1
- package/build/esnext/configuration/convert-legacy-browser-http-options.d.ts +0 -11
- package/build/esnext/configuration/convert-legacy-browser-http-options.js +0 -19
- package/build/esnext/configuration/convert-legacy-browser-http-options.js.map +0 -1
- package/build/esnext/configuration/convert-legacy-http-options.d.ts +0 -4
- package/build/esnext/configuration/convert-legacy-http-options.js +0 -12
- package/build/esnext/configuration/convert-legacy-http-options.js.map +0 -1
- package/build/esnext/configuration/convert-legacy-node-http-options.d.ts +0 -11
- package/build/esnext/configuration/convert-legacy-node-http-options.js +0 -43
- package/build/esnext/configuration/convert-legacy-node-http-options.js.map +0 -1
- package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +0 -18
- package/build/esnext/configuration/create-legacy-browser-delegate.js +0 -48
- package/build/esnext/configuration/create-legacy-browser-delegate.js.map +0 -1
- package/build/esnext/configuration/legacy-base-configuration.d.ts +0 -52
- package/build/esnext/configuration/legacy-base-configuration.js +0 -2
- package/build/esnext/configuration/legacy-base-configuration.js.map +0 -1
- package/build/esnext/configuration/legacy-node-configuration.d.ts +0 -61
- package/build/esnext/configuration/legacy-node-configuration.js +0 -10
- package/build/esnext/configuration/legacy-node-configuration.js.map +0 -1
- package/build/esnext/configuration/otlp-http-configuration.d.ts +0 -14
- package/build/esnext/configuration/otlp-http-configuration.js +0 -59
- package/build/esnext/configuration/otlp-http-configuration.js.map +0 -1
- package/build/esnext/configuration/otlp-node-http-configuration.d.ts +0 -34
- package/build/esnext/configuration/otlp-node-http-configuration.js +0 -35
- package/build/esnext/configuration/otlp-node-http-configuration.js.map +0 -1
- package/build/esnext/configuration/otlp-node-http-env-configuration.d.ts +0 -9
- package/build/esnext/configuration/otlp-node-http-env-configuration.js +0 -119
- package/build/esnext/configuration/otlp-node-http-env-configuration.js.map +0 -1
- package/build/esnext/configuration/shared-configuration.d.ts +0 -24
- package/build/esnext/configuration/shared-configuration.js +0 -42
- package/build/esnext/configuration/shared-configuration.js.map +0 -1
- package/build/esnext/configuration/shared-env-configuration.d.ts +0 -3
- package/build/esnext/configuration/shared-env-configuration.js +0 -41
- package/build/esnext/configuration/shared-env-configuration.js.map +0 -1
- package/build/esnext/export-response.d.ts +0 -15
- package/build/esnext/export-response.js +0 -6
- package/build/esnext/export-response.js.map +0 -1
- package/build/esnext/exporter-transport.d.ts +0 -6
- package/build/esnext/exporter-transport.js +0 -6
- package/build/esnext/exporter-transport.js.map +0 -1
- package/build/esnext/index-browser-http.d.ts +0 -7
- package/build/esnext/index-browser-http.js +0 -11
- package/build/esnext/index-browser-http.js.map +0 -1
- package/build/esnext/index-node-http.d.ts +0 -5
- package/build/esnext/index-node-http.js +0 -9
- package/build/esnext/index-node-http.js.map +0 -1
- package/build/esnext/index.d.ts +0 -13
- package/build/esnext/index.js +0 -11
- package/build/esnext/index.js.map +0 -1
- package/build/esnext/is-export-retryable.d.ts +0 -3
- package/build/esnext/is-export-retryable.js +0 -26
- package/build/esnext/is-export-retryable.js.map +0 -1
- package/build/esnext/logging-response-handler.d.ts +0 -6
- package/build/esnext/logging-response-handler.js +0 -27
- package/build/esnext/logging-response-handler.js.map +0 -1
- package/build/esnext/otlp-browser-http-export-delegate.d.ts +0 -10
- package/build/esnext/otlp-browser-http-export-delegate.js +0 -19
- package/build/esnext/otlp-browser-http-export-delegate.js.map +0 -1
- package/build/esnext/otlp-export-delegate.d.ts +0 -27
- package/build/esnext/otlp-export-delegate.js +0 -114
- package/build/esnext/otlp-export-delegate.js.map +0 -1
- package/build/esnext/otlp-http-export-delegate.d.ts +0 -8
- package/build/esnext/otlp-http-export-delegate.js +0 -43
- package/build/esnext/otlp-http-export-delegate.js.map +0 -1
- package/build/esnext/otlp-network-export-delegate.d.ts +0 -7
- package/build/esnext/otlp-network-export-delegate.js +0 -15
- package/build/esnext/otlp-network-export-delegate.js.map +0 -1
- package/build/esnext/response-handler.d.ts +0 -12
- package/build/esnext/response-handler.js +0 -6
- package/build/esnext/response-handler.js.map +0 -1
- package/build/esnext/retrying-transport.d.ts +0 -8
- package/build/esnext/retrying-transport.js +0 -70
- package/build/esnext/retrying-transport.js.map +0 -1
- package/build/esnext/semconv.d.ts +0 -91
- package/build/esnext/semconv.js +0 -100
- package/build/esnext/semconv.js.map +0 -1
- package/build/esnext/transport/fetch-transport.d.ts +0 -12
- package/build/esnext/transport/fetch-transport.js +0 -133
- package/build/esnext/transport/fetch-transport.js.map +0 -1
- package/build/esnext/transport/http-exporter-transport.d.ts +0 -4
- package/build/esnext/transport/http-exporter-transport.js +0 -41
- package/build/esnext/transport/http-exporter-transport.js.map +0 -1
- package/build/esnext/transport/http-transport-types.d.ts +0 -8
- package/build/esnext/transport/http-transport-types.js +0 -6
- package/build/esnext/transport/http-transport-types.js.map +0 -1
- package/build/esnext/transport/http-transport-utils.d.ts +0 -25
- package/build/esnext/transport/http-transport-utils.js +0 -167
- package/build/esnext/transport/http-transport-utils.js.map +0 -1
- package/build/esnext/transport/node-http-transport-types.d.ts +0 -6
- package/build/esnext/transport/node-http-transport-types.js +0 -6
- package/build/esnext/transport/node-http-transport-types.js.map +0 -1
- package/build/esnext/types.d.ts +0 -23
- package/build/esnext/types.js +0 -18
- package/build/esnext/types.js.map +0 -1
- package/build/esnext/util.d.ts +0 -6
- package/build/esnext/util.js +0 -22
- package/build/esnext/util.js.map +0 -1
- package/build/esnext/version.d.ts +0 -2
- package/build/esnext/version.js +0 -7
- package/build/esnext/version.js.map +0 -1
- package/build/src/ExporterMetrics.d.ts +0 -24
- package/build/src/ExporterMetrics.js +0 -108
- package/build/src/ExporterMetrics.js.map +0 -1
- package/build/src/OTLPExporterBase.d.ts +0 -17
- package/build/src/OTLPExporterBase.js +0 -32
- package/build/src/OTLPExporterBase.js.map +0 -1
- package/build/src/bounded-queue-export-promise-handler.d.ts +0 -13
- package/build/src/bounded-queue-export-promise-handler.js +0 -43
- package/build/src/bounded-queue-export-promise-handler.js.map +0 -1
- package/build/src/configuration/convert-legacy-browser-http-options.d.ts +0 -11
- package/build/src/configuration/convert-legacy-browser-http-options.js +0 -23
- package/build/src/configuration/convert-legacy-browser-http-options.js.map +0 -1
- package/build/src/configuration/convert-legacy-http-options.d.ts +0 -4
- package/build/src/configuration/convert-legacy-http-options.js +0 -16
- package/build/src/configuration/convert-legacy-http-options.js.map +0 -1
- package/build/src/configuration/convert-legacy-node-http-options.d.ts +0 -11
- package/build/src/configuration/convert-legacy-node-http-options.js +0 -47
- package/build/src/configuration/create-legacy-browser-delegate.d.ts +0 -18
- package/build/src/configuration/create-legacy-browser-delegate.js +0 -53
- package/build/src/configuration/create-legacy-browser-delegate.js.map +0 -1
- package/build/src/configuration/legacy-base-configuration.d.ts +0 -52
- package/build/src/configuration/legacy-base-configuration.js +0 -3
- package/build/src/configuration/legacy-base-configuration.js.map +0 -1
- package/build/src/configuration/legacy-node-configuration.d.ts +0 -61
- package/build/src/configuration/legacy-node-configuration.js +0 -13
- package/build/src/configuration/legacy-node-configuration.js.map +0 -1
- package/build/src/configuration/otlp-http-configuration.d.ts +0 -14
- package/build/src/configuration/otlp-http-configuration.js +0 -64
- package/build/src/configuration/otlp-http-configuration.js.map +0 -1
- package/build/src/configuration/otlp-node-http-configuration.d.ts +0 -34
- package/build/src/configuration/otlp-node-http-configuration.js +0 -41
- package/build/src/configuration/otlp-node-http-configuration.js.map +0 -1
- package/build/src/configuration/otlp-node-http-env-configuration.d.ts +0 -9
- package/build/src/configuration/otlp-node-http-env-configuration.js +0 -123
- package/build/src/configuration/otlp-node-http-env-configuration.js.map +0 -1
- package/build/src/configuration/shared-configuration.d.ts +0 -24
- package/build/src/configuration/shared-configuration.js +0 -49
- package/build/src/configuration/shared-configuration.js.map +0 -1
- package/build/src/configuration/shared-env-configuration.d.ts +0 -3
- package/build/src/configuration/shared-env-configuration.js +0 -45
- package/build/src/configuration/shared-env-configuration.js.map +0 -1
- package/build/src/export-response.d.ts +0 -15
- package/build/src/export-response.js +0 -7
- package/build/src/export-response.js.map +0 -1
- package/build/src/exporter-transport.d.ts +0 -6
- package/build/src/exporter-transport.js +0 -7
- package/build/src/exporter-transport.js.map +0 -1
- package/build/src/index-browser-http.d.ts +0 -7
- package/build/src/index-browser-http.js +0 -18
- package/build/src/index-browser-http.js.map +0 -1
- package/build/src/index-node-http.d.ts +0 -5
- package/build/src/index-node-http.js +0 -17
- package/build/src/index-node-http.js.map +0 -1
- package/build/src/index.d.ts +0 -13
- package/build/src/index.js +0 -21
- package/build/src/index.js.map +0 -1
- package/build/src/is-export-retryable.d.ts +0 -3
- package/build/src/is-export-retryable.js +0 -31
- package/build/src/is-export-retryable.js.map +0 -1
- package/build/src/logging-response-handler.d.ts +0 -6
- package/build/src/logging-response-handler.js +0 -31
- package/build/src/otlp-browser-http-export-delegate.d.ts +0 -10
- package/build/src/otlp-browser-http-export-delegate.js +0 -24
- package/build/src/otlp-browser-http-export-delegate.js.map +0 -1
- package/build/src/otlp-export-delegate.d.ts +0 -27
- package/build/src/otlp-export-delegate.js +0 -118
- package/build/src/otlp-export-delegate.js.map +0 -1
- package/build/src/otlp-http-export-delegate.d.ts +0 -8
- package/build/src/otlp-http-export-delegate.js +0 -48
- package/build/src/otlp-http-export-delegate.js.map +0 -1
- package/build/src/otlp-network-export-delegate.d.ts +0 -7
- package/build/src/otlp-network-export-delegate.js +0 -19
- package/build/src/otlp-network-export-delegate.js.map +0 -1
- package/build/src/response-handler.d.ts +0 -12
- package/build/src/response-handler.js +0 -7
- package/build/src/response-handler.js.map +0 -1
- package/build/src/retrying-transport.d.ts +0 -8
- package/build/src/retrying-transport.js +0 -74
- package/build/src/retrying-transport.js.map +0 -1
- package/build/src/semconv.d.ts +0 -91
- package/build/src/semconv.js +0 -103
- package/build/src/semconv.js.map +0 -1
- package/build/src/transport/fetch-transport.d.ts +0 -12
- package/build/src/transport/fetch-transport.js +0 -137
- package/build/src/transport/fetch-transport.js.map +0 -1
- package/build/src/transport/http-exporter-transport.d.ts +0 -4
- package/build/src/transport/http-exporter-transport.js +0 -45
- package/build/src/transport/http-exporter-transport.js.map +0 -1
- package/build/src/transport/http-transport-types.d.ts +0 -8
- package/build/src/transport/http-transport-types.js +0 -7
- package/build/src/transport/http-transport-types.js.map +0 -1
- package/build/src/transport/http-transport-utils.d.ts +0 -25
- package/build/src/transport/http-transport-utils.js +0 -172
- package/build/src/transport/http-transport-utils.js.map +0 -1
- package/build/src/transport/node-http-transport-types.d.ts +0 -6
- package/build/src/transport/node-http-transport-types.js +0 -7
- package/build/src/transport/node-http-transport-types.js.map +0 -1
- package/build/src/types.d.ts +0 -23
- package/build/src/types.js +0 -22
- package/build/src/types.js.map +0 -1
- package/build/src/util.d.ts +0 -6
- package/build/src/util.js +0 -26
- package/build/src/util.js.map +0 -1
- package/build/src/version.d.ts +0 -2
- package/build/src/version.js +0 -10
- package/build/src/version.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-browser-delegate.js","sourceRoot":"","sources":["../../../src/configuration/create-legacy-browser-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,4FAAqF;AACrF,+FAAwF;AAGxF,wCAA4D;AAC5D,wDAAqD;AAErD;;GAEG;AACH,SAAgB,sCAAsC,CACpD,oBAA4B,EAC5B,qBAAuD,EACvD,GAAuB,EACvB,aAAwC;IAExC,OAAO,IAAI,iCAAe,CAAC;QACzB,aAAa,EAAE,oBAAoB;QACnC,aAAa,EAAE,qBAAqB;QACpC,GAAG;QACH,aAAa;QACb,2BAA2B,EAAE,CAAC,KAAiC,EAAE,EAAE;YACjE,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO;oBACL,CAAC,wCAA8B,CAAC,EAAE,GAAG;iBACtC,CAAC;aACH;YACD,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE;gBAC7B,OAAO,EAAE,CAAC;aACX;YACD,IACE,KAAK,CAAC,OAAO,CAAC,UAAU,CACtB,iDAAiD,CAClD,EACD;gBACA,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CACvC,iDAAiD,CAAC,MAAM,CACzD,CAAC;gBACF,OAAO;oBACL,CAAC,wCAA8B,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;iBACpD,CAAC;aACH;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAnCD,wFAmCC;AAED;;;;;;GAMG;AACH,SAAgB,qCAAqC,CACnD,MAA8B,EAC9B,UAA2C,EAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,aAAwC,EACxC,kBAA0B,EAC1B,eAAuC;IAEvC,MAAM,OAAO,GAAG,IAAA,qEAA+B,EAC7C,MAAM,EACN,kBAAkB,EAClB,eAAe,CAChB,CAAC;IAEF,OAAO,IAAA,iEAA6B,EAClC,OAAO,EACP,UAAU,EACV,sCAAsC,CACpC,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,CAAC,GAAG,EACX,MAAM,CAAC,oBAAoB,CAC5B,CACF,CAAC;AACJ,CAAC;AAzBD,sFAyBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '@opentelemetry/api';\nimport type {\n IExporterMetricsHelper,\n ISerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { createOtlpFetchExportDelegate } from '../otlp-browser-http-export-delegate';\nimport { convertLegacyBrowserHttpOptions } from './convert-legacy-browser-http-options';\nimport type { IOtlpExportDelegate } from '../otlp-export-delegate';\nimport type { OTLPExporterConfigBase } from './legacy-base-configuration';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from '../semconv';\nimport { ExporterMetrics } from '../ExporterMetrics';\n\n/**\n * @deprecated\n */\nexport function createLegacyOtlpBrowserExporterMetrics<Internal>(\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n url: string | undefined,\n meterProvider: MeterProvider | undefined\n): ExporterMetrics<Internal> {\n return new ExporterMetrics({\n componentType: metricsComponentType,\n metricsHelper: exporterMetricsHelper,\n url,\n meterProvider,\n responseAttributesFromError: (error: Error | string | undefined) => {\n if (!error) {\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,\n };\n }\n if (!(error instanceof Error)) {\n return {};\n }\n if (\n error.message.startsWith(\n 'Fetch request failed with non-retryable status '\n )\n ) {\n const statusStr = error.message.substring(\n 'Fetch request failed with non-retryable status '.length\n );\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: Number(statusStr),\n };\n }\n return {};\n },\n });\n}\n\n/**\n * @deprecated\n * @param config\n * @param serializer\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function createLegacyOtlpBrowserExportDelegate<Internal, Response>(\n config: OTLPExporterConfigBase,\n serializer: ISerializer<Internal, Response>,\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n meterProvider: MeterProvider | undefined,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): IOtlpExportDelegate<Internal> {\n const options = convertLegacyBrowserHttpOptions(\n config,\n signalResourcePath,\n requiredHeaders\n );\n\n return createOtlpFetchExportDelegate(\n options,\n serializer,\n createLegacyOtlpBrowserExporterMetrics(\n metricsComponentType,\n exporterMetricsHelper,\n options.url,\n config.selfObsMeterProvider\n )\n );\n}\n"]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { MeterProvider } from '@opentelemetry/api';
|
|
2
|
-
import type { HeadersFactory } from './otlp-http-configuration';
|
|
3
|
-
export interface OTLPExporterConfigBase {
|
|
4
|
-
/**
|
|
5
|
-
* Custom headers that will be attached to the HTTP request that's sent to the endpoint.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Prefer using a plain object over a factory function wherever possible.
|
|
9
|
-
* A factory function may be async and MUST NOT throw errors.
|
|
10
|
-
* It should return a string map containing the headers to add to the request.
|
|
11
|
-
*
|
|
12
|
-
* @example <caption> Using headers options directly: </caption>
|
|
13
|
-
* headers: {
|
|
14
|
-
* Authorization: "Api-Token my-secret-token",
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* @example <caption> Using a custom factory function </caption>
|
|
18
|
-
* headers: async () => {
|
|
19
|
-
* return {
|
|
20
|
-
* Authorization: `Bearer ${token}`,
|
|
21
|
-
* };
|
|
22
|
-
* };
|
|
23
|
-
*/
|
|
24
|
-
headers?: Record<string, string> | HeadersFactory;
|
|
25
|
-
/**
|
|
26
|
-
* Collector endpoint URL for the exporter.
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Defaults to the signal-specific endpoint, such as
|
|
30
|
-
* `http://localhost:4318/v1/traces`, `http://localhost:4318/v1/metrics`,
|
|
31
|
-
* or `http://localhost:4318/v1/logs`.
|
|
32
|
-
*/
|
|
33
|
-
url?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Maximum number of in-flight export requests.
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue 30
|
|
38
|
-
*/
|
|
39
|
-
concurrencyLimit?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Maximum time, in milliseconds, the OTLP exporter will wait for each batch export.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue 10000
|
|
44
|
-
*/
|
|
45
|
-
timeoutMillis?: number;
|
|
46
|
-
/**
|
|
47
|
-
* MeterProvider to record metrics for the exporter itself.
|
|
48
|
-
* @experimental This option is experimental and is subject to breaking changes in minor releases.
|
|
49
|
-
*/
|
|
50
|
-
selfObsMeterProvider?: MeterProvider;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=legacy-base-configuration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-base-configuration.js","sourceRoot":"","sources":["../../../src/configuration/legacy-base-configuration.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { MeterProvider } from '@opentelemetry/api';\nimport type { HeadersFactory } from './otlp-http-configuration';\n\nexport interface OTLPExporterConfigBase {\n /**\n * Custom headers that will be attached to the HTTP request that's sent to the endpoint.\n *\n * @remarks\n * Prefer using a plain object over a factory function wherever possible.\n * A factory function may be async and MUST NOT throw errors.\n * It should return a string map containing the headers to add to the request.\n *\n * @example <caption> Using headers options directly: </caption>\n * headers: {\n * Authorization: \"Api-Token my-secret-token\",\n * }\n *\n * @example <caption> Using a custom factory function </caption>\n * headers: async () => {\n * return {\n * Authorization: `Bearer ${token}`,\n * };\n * };\n */\n headers?: Record<string, string> | HeadersFactory;\n /**\n * Collector endpoint URL for the exporter.\n *\n * @remarks\n * Defaults to the signal-specific endpoint, such as\n * `http://localhost:4318/v1/traces`, `http://localhost:4318/v1/metrics`,\n * or `http://localhost:4318/v1/logs`.\n */\n url?: string;\n /**\n * Maximum number of in-flight export requests.\n *\n * @defaultValue 30\n */\n concurrencyLimit?: number;\n /**\n * Maximum time, in milliseconds, the OTLP exporter will wait for each batch export.\n *\n * @defaultValue 10000\n */\n timeoutMillis?: number;\n\n /**\n * MeterProvider to record metrics for the exporter itself.\n * @experimental This option is experimental and is subject to breaking changes in minor releases.\n */\n selfObsMeterProvider?: MeterProvider;\n}\n"]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import type * as http from 'http';
|
|
4
|
-
import type * as https from 'https';
|
|
5
|
-
import type { OTLPExporterConfigBase } from './legacy-base-configuration';
|
|
6
|
-
import type { HttpAgentFactory } from './otlp-node-http-configuration';
|
|
7
|
-
/**
|
|
8
|
-
* Node.js HTTP exporter configuration.
|
|
9
|
-
*/
|
|
10
|
-
export interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase {
|
|
11
|
-
/**
|
|
12
|
-
* Sets `keepAlive` on the Node.js HTTP or HTTPS agent created by the exporter.
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* If `httpAgentOptions` is an object with its own `keepAlive` value, the
|
|
16
|
-
* value in `httpAgentOptions` takes precedence.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue true
|
|
19
|
-
*/
|
|
20
|
-
keepAlive?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Compression algorithm for outgoing OTLP HTTP requests.
|
|
23
|
-
*
|
|
24
|
-
* @defaultValue CompressionAlgorithm.NONE
|
|
25
|
-
*/
|
|
26
|
-
compression?: CompressionAlgorithm;
|
|
27
|
-
/**
|
|
28
|
-
* Custom HTTP agent options or a factory function for creating agents.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Prefer using `http.AgentOptions` or `https.AgentOptions` over a factory function wherever possible.
|
|
32
|
-
* If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`
|
|
33
|
-
* statically at the top of the file**.
|
|
34
|
-
* Instead, use dynamic `import()` or `require()` to load the module. This lets
|
|
35
|
-
* `@opentelemetry/instrumentation-http` instrument the module first.
|
|
36
|
-
*
|
|
37
|
-
* @example <caption> Using agent options directly: </caption>
|
|
38
|
-
* httpAgentOptions: {
|
|
39
|
-
* keepAlive: true,
|
|
40
|
-
* maxSockets: 10
|
|
41
|
-
* }
|
|
42
|
-
*
|
|
43
|
-
* @example <caption> Using a factory with dynamic import: </caption>
|
|
44
|
-
* httpAgentOptions: async (protocol) => {
|
|
45
|
-
* const module = protocol === 'http:' ? await import('http') : await import('https');
|
|
46
|
-
* return new module.Agent({ keepAlive: true });
|
|
47
|
-
* }
|
|
48
|
-
*/
|
|
49
|
-
httpAgentOptions?: http.AgentOptions | https.AgentOptions | HttpAgentFactory;
|
|
50
|
-
/**
|
|
51
|
-
* User agent header string to be prepended to the exporter's default value.
|
|
52
|
-
* Available since v1.49.0 of the spec.
|
|
53
|
-
* Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent
|
|
54
|
-
*/
|
|
55
|
-
userAgent?: string;
|
|
56
|
-
}
|
|
57
|
-
export declare enum CompressionAlgorithm {
|
|
58
|
-
NONE = "none",
|
|
59
|
-
GZIP = "gzip"
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=legacy-node-configuration.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright The OpenTelemetry Authors
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.CompressionAlgorithm = void 0;
|
|
8
|
-
var CompressionAlgorithm;
|
|
9
|
-
(function (CompressionAlgorithm) {
|
|
10
|
-
CompressionAlgorithm["NONE"] = "none";
|
|
11
|
-
CompressionAlgorithm["GZIP"] = "gzip";
|
|
12
|
-
})(CompressionAlgorithm || (exports.CompressionAlgorithm = CompressionAlgorithm = {}));
|
|
13
|
-
//# sourceMappingURL=legacy-node-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-node-configuration.js","sourceRoot":"","sources":["../../../src/configuration/legacy-node-configuration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4DH,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,qCAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// NOTE: do not change these imports to be actual imports, otherwise they WILL break `@opentelemetry/instrumentation-http`\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nimport type { OTLPExporterConfigBase } from './legacy-base-configuration';\nimport type { HttpAgentFactory } from './otlp-node-http-configuration';\n\n/**\n * Node.js HTTP exporter configuration.\n */\nexport interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase {\n /**\n * Sets `keepAlive` on the Node.js HTTP or HTTPS agent created by the exporter.\n *\n * @remarks\n * If `httpAgentOptions` is an object with its own `keepAlive` value, the\n * value in `httpAgentOptions` takes precedence.\n *\n * @defaultValue true\n */\n keepAlive?: boolean;\n /**\n * Compression algorithm for outgoing OTLP HTTP requests.\n *\n * @defaultValue CompressionAlgorithm.NONE\n */\n compression?: CompressionAlgorithm;\n /**\n * Custom HTTP agent options or a factory function for creating agents.\n *\n * @remarks\n * Prefer using `http.AgentOptions` or `https.AgentOptions` over a factory function wherever possible.\n * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`\n * statically at the top of the file**.\n * Instead, use dynamic `import()` or `require()` to load the module. This lets\n * `@opentelemetry/instrumentation-http` instrument the module first.\n *\n * @example <caption> Using agent options directly: </caption>\n * httpAgentOptions: {\n * keepAlive: true,\n * maxSockets: 10\n * }\n *\n * @example <caption> Using a factory with dynamic import: </caption>\n * httpAgentOptions: async (protocol) => {\n * const module = protocol === 'http:' ? await import('http') : await import('https');\n * return new module.Agent({ keepAlive: true });\n * }\n */\n httpAgentOptions?: http.AgentOptions | https.AgentOptions | HttpAgentFactory;\n /**\n * User agent header string to be prepended to the exporter's default value.\n * Available since v1.49.0 of the spec.\n * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent\n */\n userAgent?: string;\n}\n\nexport enum CompressionAlgorithm {\n NONE = 'none',\n GZIP = 'gzip',\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { OtlpSharedConfiguration } from './shared-configuration';
|
|
2
|
-
export type HeadersFactory = () => Promise<Record<string, string>>;
|
|
3
|
-
export interface OtlpHttpConfiguration extends OtlpSharedConfiguration {
|
|
4
|
-
url: string;
|
|
5
|
-
headers: HeadersFactory;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
9
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
10
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
11
|
-
*/
|
|
12
|
-
export declare function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpHttpConfiguration>, fallbackConfiguration: Partial<OtlpHttpConfiguration>, defaultConfiguration: OtlpHttpConfiguration): OtlpHttpConfiguration;
|
|
13
|
-
export declare function getHttpConfigurationDefaults(requiredHeaders: Record<string, string>, signalResourcePath: string): OtlpHttpConfiguration;
|
|
14
|
-
//# sourceMappingURL=otlp-http-configuration.d.ts.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright The OpenTelemetry Authors
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getHttpConfigurationDefaults = exports.mergeOtlpHttpConfigurationWithDefaults = void 0;
|
|
8
|
-
const shared_configuration_1 = require("./shared-configuration");
|
|
9
|
-
const util_1 = require("../util");
|
|
10
|
-
function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {
|
|
11
|
-
return async () => {
|
|
12
|
-
const requiredHeaders = {
|
|
13
|
-
...(await defaultHeaders()),
|
|
14
|
-
};
|
|
15
|
-
const headers = {};
|
|
16
|
-
// add fallback ones first
|
|
17
|
-
if (fallbackHeaders != null) {
|
|
18
|
-
Object.assign(headers, await fallbackHeaders());
|
|
19
|
-
}
|
|
20
|
-
// override with user-provided ones
|
|
21
|
-
if (userProvidedHeaders != null) {
|
|
22
|
-
Object.assign(headers, (0, util_1.validateAndNormalizeHeaders)(await userProvidedHeaders()));
|
|
23
|
-
}
|
|
24
|
-
// override required ones.
|
|
25
|
-
return Object.assign(headers, requiredHeaders);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function validateUserProvidedUrl(url) {
|
|
29
|
-
if (url == null) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
// NOTE: In non-browser environments, `globalThis.location` will be `undefined`.
|
|
34
|
-
const base = globalThis.location?.href;
|
|
35
|
-
return new URL(url, base).href;
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
43
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
44
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
45
|
-
*/
|
|
46
|
-
function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
47
|
-
return {
|
|
48
|
-
...(0, shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
49
|
-
headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),
|
|
50
|
-
url: validateUserProvidedUrl(userProvidedConfiguration.url) ??
|
|
51
|
-
fallbackConfiguration.url ??
|
|
52
|
-
defaultConfiguration.url,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.mergeOtlpHttpConfigurationWithDefaults = mergeOtlpHttpConfigurationWithDefaults;
|
|
56
|
-
function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
57
|
-
return {
|
|
58
|
-
...(0, shared_configuration_1.getSharedConfigurationDefaults)(),
|
|
59
|
-
headers: async () => requiredHeaders,
|
|
60
|
-
url: 'http://localhost:4318/' + signalResourcePath,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports.getHttpConfigurationDefaults = getHttpConfigurationDefaults;
|
|
64
|
-
//# sourceMappingURL=otlp-http-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-http-configuration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAGgC;AAChC,kCAAsD;AAStD,SAAS,YAAY,CACnB,mBAAsD,EACtD,eAAkD,EAClD,cAA8B;IAE9B,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,eAAe,GAAG;YACtB,GAAG,CAAC,MAAM,cAAc,EAAE,CAAC;SAC5B,CAAC;QACF,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,0BAA0B;QAC1B,IAAI,eAAe,IAAI,IAAI,EAAE;YAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,eAAe,EAAE,CAAC,CAAC;SACjD;QAED,mCAAmC;QACnC,IAAI,mBAAmB,IAAI,IAAI,EAAE;YAC/B,MAAM,CAAC,MAAM,CACX,OAAO,EACP,IAAA,kCAA2B,EAAC,MAAM,mBAAmB,EAAE,CAAC,CACzD,CAAC;SACH;QAED,0BAA0B;QAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAuB;IACtD,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IACD,IAAI;QACF,gFAAgF;QAChF,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC;QACvC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;KAChC;IAAC,MAAM;QACN,MAAM,IAAI,KAAK,CACb,6DAA6D,GAAG,GAAG,CACpE,CAAC;KACH;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,sCAAsC,CACpD,yBAAyD,EACzD,qBAAqD,EACrD,oBAA2C;IAE3C,OAAO;QACL,GAAG,IAAA,+DAAwC,EACzC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,CACrB;QACD,OAAO,EAAE,YAAY,CACnB,yBAAyB,CAAC,OAAO,EACjC,qBAAqB,CAAC,OAAO,EAC7B,oBAAoB,CAAC,OAAO,CAC7B;QACD,GAAG,EACD,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,CAAC;YACtD,qBAAqB,CAAC,GAAG;YACzB,oBAAoB,CAAC,GAAG;KAC3B,CAAC;AACJ,CAAC;AArBD,wFAqBC;AAED,SAAgB,4BAA4B,CAC1C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,IAAA,qDAA8B,GAAE;QACnC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe;QACpC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB;KACnD,CAAC;AACJ,CAAC;AATD,oEASC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { OtlpSharedConfiguration } from './shared-configuration';\nimport {\n getSharedConfigurationDefaults,\n mergeOtlpSharedConfigurationWithDefaults,\n} from './shared-configuration';\nimport { validateAndNormalizeHeaders } from '../util';\n\nexport type HeadersFactory = () => Promise<Record<string, string>>;\n\nexport interface OtlpHttpConfiguration extends OtlpSharedConfiguration {\n url: string;\n headers: HeadersFactory;\n}\n\nfunction mergeHeaders(\n userProvidedHeaders: HeadersFactory | undefined | null,\n fallbackHeaders: HeadersFactory | undefined | null,\n defaultHeaders: HeadersFactory\n): HeadersFactory {\n return async () => {\n const requiredHeaders = {\n ...(await defaultHeaders()),\n };\n const headers = {};\n\n // add fallback ones first\n if (fallbackHeaders != null) {\n Object.assign(headers, await fallbackHeaders());\n }\n\n // override with user-provided ones\n if (userProvidedHeaders != null) {\n Object.assign(\n headers,\n validateAndNormalizeHeaders(await userProvidedHeaders())\n );\n }\n\n // override required ones.\n return Object.assign(headers, requiredHeaders);\n };\n}\n\nfunction validateUserProvidedUrl(url: string | undefined): string | undefined {\n if (url == null) {\n return undefined;\n }\n try {\n // NOTE: In non-browser environments, `globalThis.location` will be `undefined`.\n const base = globalThis.location?.href;\n return new URL(url, base).href;\n } catch {\n throw new Error(\n `Configuration: Could not parse user-provided export URL: '${url}'`\n );\n }\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpHttpConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpHttpConfiguration>,\n fallbackConfiguration: Partial<OtlpHttpConfiguration>,\n defaultConfiguration: OtlpHttpConfiguration\n): OtlpHttpConfiguration {\n return {\n ...mergeOtlpSharedConfigurationWithDefaults(\n userProvidedConfiguration,\n fallbackConfiguration,\n defaultConfiguration\n ),\n headers: mergeHeaders(\n userProvidedConfiguration.headers,\n fallbackConfiguration.headers,\n defaultConfiguration.headers\n ),\n url:\n validateUserProvidedUrl(userProvidedConfiguration.url) ??\n fallbackConfiguration.url ??\n defaultConfiguration.url,\n };\n}\n\nexport function getHttpConfigurationDefaults(\n requiredHeaders: Record<string, string>,\n signalResourcePath: string\n): OtlpHttpConfiguration {\n return {\n ...getSharedConfigurationDefaults(),\n headers: async () => requiredHeaders,\n url: 'http://localhost:4318/' + signalResourcePath,\n };\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import type { OtlpHttpConfiguration } from './otlp-http-configuration';
|
|
4
|
-
import type * as http from 'http';
|
|
5
|
-
import type * as https from 'https';
|
|
6
|
-
export type HttpAgentFactory = (protocol: string) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;
|
|
7
|
-
export interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
8
|
-
/**
|
|
9
|
-
* Factory function for creating agents.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* Prefer using {@link httpAgentFactoryFromOptions} over manually writing a factory function wherever possible.
|
|
13
|
-
* If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`
|
|
14
|
-
* statically at the top of the file**.
|
|
15
|
-
* Instead, use dynamic `import()` or `require()` to load the module. This ensures that the `http` or `https`
|
|
16
|
-
* module is not loaded before `@opentelemetry/instrumentation-http` can instrument it.
|
|
17
|
-
*/
|
|
18
|
-
agentFactory: HttpAgentFactory;
|
|
19
|
-
/**
|
|
20
|
-
* User agent header string to be appended to the exporter's value as a prefix.
|
|
21
|
-
* Availablie since v1.49.0 of the spec.
|
|
22
|
-
* Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent
|
|
23
|
-
*/
|
|
24
|
-
userAgent?: string;
|
|
25
|
-
}
|
|
26
|
-
export declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
|
|
27
|
-
/**
|
|
28
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
29
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
30
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
31
|
-
*/
|
|
32
|
-
export declare function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpNodeHttpConfiguration>, fallbackConfiguration: Partial<OtlpNodeHttpConfiguration>, defaultConfiguration: OtlpNodeHttpConfiguration): OtlpNodeHttpConfiguration;
|
|
33
|
-
export declare function getNodeHttpConfigurationDefaults(requiredHeaders: Record<string, string>, signalResourcePath: string): OtlpNodeHttpConfiguration;
|
|
34
|
-
//# sourceMappingURL=otlp-node-http-configuration.d.ts.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNodeHttpConfigurationDefaults = exports.mergeOtlpNodeHttpConfigurationWithDefaults = exports.httpAgentFactoryFromOptions = void 0;
|
|
4
|
-
const otlp_http_configuration_1 = require("./otlp-http-configuration");
|
|
5
|
-
function httpAgentFactoryFromOptions(options) {
|
|
6
|
-
return async (protocol) => {
|
|
7
|
-
const isInsecure = protocol === 'http:';
|
|
8
|
-
const module = isInsecure ? import('http') : import('https');
|
|
9
|
-
const { Agent } = await module;
|
|
10
|
-
if (isInsecure) {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- these props should not be used in agent options
|
|
12
|
-
const { ca, cert, key, ...insecureOptions } = options;
|
|
13
|
-
return new Agent(insecureOptions);
|
|
14
|
-
}
|
|
15
|
-
return new Agent(options);
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
exports.httpAgentFactoryFromOptions = httpAgentFactoryFromOptions;
|
|
19
|
-
/**
|
|
20
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
21
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
22
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
23
|
-
*/
|
|
24
|
-
function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
25
|
-
return {
|
|
26
|
-
...(0, otlp_http_configuration_1.mergeOtlpHttpConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
27
|
-
agentFactory: userProvidedConfiguration.agentFactory ??
|
|
28
|
-
fallbackConfiguration.agentFactory ??
|
|
29
|
-
defaultConfiguration.agentFactory,
|
|
30
|
-
userAgent: userProvidedConfiguration.userAgent,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
exports.mergeOtlpNodeHttpConfigurationWithDefaults = mergeOtlpNodeHttpConfigurationWithDefaults;
|
|
34
|
-
function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
35
|
-
return {
|
|
36
|
-
...(0, otlp_http_configuration_1.getHttpConfigurationDefaults)(requiredHeaders, signalResourcePath),
|
|
37
|
-
agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
exports.getNodeHttpConfigurationDefaults = getNodeHttpConfigurationDefaults;
|
|
41
|
-
//# sourceMappingURL=otlp-node-http-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-node-http-configuration.ts"],"names":[],"mappings":";;;AAKA,uEAGmC;AA8BnC,SAAgB,2BAA2B,CACzC,OAA+C;IAE/C,OAAO,KAAK,EAAC,QAAQ,EAAC,EAAE;QACtB,MAAM,UAAU,GAAG,QAAQ,KAAK,OAAO,CAAC;QACxC,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC;QAE/B,IAAI,UAAU,EAAE;YACd,gHAAgH;YAChH,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,eAAe,EAAE,GACzC,OAA6B,CAAC;YAChC,OAAO,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SACnC;QACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AAhBD,kEAgBC;AAED;;;;GAIG;AACH,SAAgB,0CAA0C,CACxD,yBAA6D,EAC7D,qBAAyD,EACzD,oBAA+C;IAE/C,OAAO;QACL,GAAG,IAAA,gEAAsC,EACvC,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,CACrB;QACD,YAAY,EACV,yBAAyB,CAAC,YAAY;YACtC,qBAAqB,CAAC,YAAY;YAClC,oBAAoB,CAAC,YAAY;QACnC,SAAS,EAAE,yBAAyB,CAAC,SAAS;KAC/C,CAAC;AACJ,CAAC;AAjBD,gGAiBC;AAED,SAAgB,gCAAgC,CAC9C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,IAAA,sDAA4B,EAAC,eAAe,EAAE,kBAAkB,CAAC;QACpE,YAAY,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AARD,4EAQC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from './otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from './otlp-http-configuration';\n\n// NOTE: do not change these imports to be actual imports, otherwise they WILL break `@opentelemetry/instrumentation-http`\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nexport type HttpAgentFactory = (\n protocol: string\n) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;\n\nexport interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {\n /**\n * Factory function for creating agents.\n *\n * @remarks\n * Prefer using {@link httpAgentFactoryFromOptions} over manually writing a factory function wherever possible.\n * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent`\n * statically at the top of the file**.\n * Instead, use dynamic `import()` or `require()` to load the module. This ensures that the `http` or `https`\n * module is not loaded before `@opentelemetry/instrumentation-http` can instrument it.\n */\n agentFactory: HttpAgentFactory;\n /**\n * User agent header string to be appended to the exporter's value as a prefix.\n * Availablie since v1.49.0 of the spec.\n * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent\n */\n userAgent?: string;\n}\n\nexport function httpAgentFactoryFromOptions(\n options: http.AgentOptions | https.AgentOptions\n): HttpAgentFactory {\n return async protocol => {\n const isInsecure = protocol === 'http:';\n const module = isInsecure ? import('http') : import('https');\n const { Agent } = await module;\n\n if (isInsecure) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- these props should not be used in agent options\n const { ca, cert, key, ...insecureOptions } =\n options as https.AgentOptions;\n return new Agent(insecureOptions);\n }\n return new Agent(options);\n };\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpNodeHttpConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpNodeHttpConfiguration>,\n fallbackConfiguration: Partial<OtlpNodeHttpConfiguration>,\n defaultConfiguration: OtlpNodeHttpConfiguration\n): OtlpNodeHttpConfiguration {\n return {\n ...mergeOtlpHttpConfigurationWithDefaults(\n userProvidedConfiguration,\n fallbackConfiguration,\n defaultConfiguration\n ),\n agentFactory:\n userProvidedConfiguration.agentFactory ??\n fallbackConfiguration.agentFactory ??\n defaultConfiguration.agentFactory,\n userAgent: userProvidedConfiguration.userAgent,\n };\n}\n\nexport function getNodeHttpConfigurationDefaults(\n requiredHeaders: Record<string, string>,\n signalResourcePath: string\n): OtlpNodeHttpConfiguration {\n return {\n ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath),\n agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }),\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OtlpNodeHttpConfiguration } from './otlp-node-http-configuration';
|
|
2
|
-
/**
|
|
3
|
-
* Reads and returns configuration from the environment
|
|
4
|
-
*
|
|
5
|
-
* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)
|
|
6
|
-
* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)
|
|
7
|
-
*/
|
|
8
|
-
export declare function getNodeHttpConfigurationFromEnvironment(signalIdentifier: string, signalResourcePath: string): Partial<OtlpNodeHttpConfiguration>;
|
|
9
|
-
//# sourceMappingURL=otlp-node-http-env-configuration.d.ts.map
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNodeHttpConfigurationFromEnvironment = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright The OpenTelemetry Authors
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
const fs = require("fs");
|
|
9
|
-
const path = require("path");
|
|
10
|
-
const core_1 = require("@opentelemetry/core");
|
|
11
|
-
const api_1 = require("@opentelemetry/api");
|
|
12
|
-
const shared_env_configuration_1 = require("./shared-env-configuration");
|
|
13
|
-
const shared_configuration_1 = require("./shared-configuration");
|
|
14
|
-
const otlp_node_http_configuration_1 = require("./otlp-node-http-configuration");
|
|
15
|
-
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
16
|
-
const signalSpecificRawHeaders = (0, core_1.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`);
|
|
17
|
-
const nonSignalSpecificRawHeaders = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_HEADERS');
|
|
18
|
-
const signalSpecificHeaders = (0, core_1.parseKeyPairsIntoRecord)(signalSpecificRawHeaders);
|
|
19
|
-
const nonSignalSpecificHeaders = (0, core_1.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders);
|
|
20
|
-
if (Object.keys(signalSpecificHeaders).length === 0 &&
|
|
21
|
-
Object.keys(nonSignalSpecificHeaders).length === 0) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
// headers are combined instead of overwritten, with the specific headers taking precedence over
|
|
25
|
-
// the non-specific ones.
|
|
26
|
-
return Object.assign({}, (0, core_1.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, core_1.parseKeyPairsIntoRecord)(signalSpecificRawHeaders));
|
|
27
|
-
}
|
|
28
|
-
function appendRootPathToUrlIfNeeded(url) {
|
|
29
|
-
try {
|
|
30
|
-
const parsedUrl = new URL(url);
|
|
31
|
-
// This will automatically append '/' if there's no root path.
|
|
32
|
-
return parsedUrl.toString();
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function appendResourcePathToUrl(url, path) {
|
|
40
|
-
try {
|
|
41
|
-
// just try to parse, if it fails we catch and warn.
|
|
42
|
-
new URL(url);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
if (!url.endsWith('/')) {
|
|
49
|
-
url = url + '/';
|
|
50
|
-
}
|
|
51
|
-
url += path;
|
|
52
|
-
try {
|
|
53
|
-
// just try to parse, if it fails we catch and warn.
|
|
54
|
-
new URL(url);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
api_1.diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return url;
|
|
61
|
-
}
|
|
62
|
-
function getNonSpecificUrlFromEnv(signalResourcePath) {
|
|
63
|
-
const envUrl = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT');
|
|
64
|
-
if (envUrl === undefined) {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
return appendResourcePathToUrl(envUrl, signalResourcePath);
|
|
68
|
-
}
|
|
69
|
-
function getSpecificUrlFromEnv(signalIdentifier) {
|
|
70
|
-
const envUrl = (0, core_1.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`);
|
|
71
|
-
if (envUrl === undefined) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
return appendRootPathToUrlIfNeeded(envUrl);
|
|
75
|
-
}
|
|
76
|
-
function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningMessage) {
|
|
77
|
-
const signalSpecificPath = (0, core_1.getStringFromEnv)(signalSpecificEnvVar);
|
|
78
|
-
const nonSignalSpecificPath = (0, core_1.getStringFromEnv)(nonSignalSpecificEnvVar);
|
|
79
|
-
const filePath = signalSpecificPath ?? nonSignalSpecificPath;
|
|
80
|
-
if (filePath != null) {
|
|
81
|
-
try {
|
|
82
|
-
return fs.readFileSync(path.resolve(process.cwd(), filePath));
|
|
83
|
-
}
|
|
84
|
-
catch {
|
|
85
|
-
api_1.diag.warn(warningMessage);
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
return undefined;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function getClientCertificateFromEnv(signalIdentifier) {
|
|
94
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE', 'Failed to read client certificate chain file');
|
|
95
|
-
}
|
|
96
|
-
function getClientKeyFromEnv(signalIdentifier) {
|
|
97
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`, 'OTEL_EXPORTER_OTLP_CLIENT_KEY', 'Failed to read client certificate private key file');
|
|
98
|
-
}
|
|
99
|
-
function getRootCertificateFromEnv(signalIdentifier) {
|
|
100
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CERTIFICATE', 'Failed to read root certificate file');
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Reads and returns configuration from the environment
|
|
104
|
-
*
|
|
105
|
-
* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)
|
|
106
|
-
* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)
|
|
107
|
-
*/
|
|
108
|
-
function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) {
|
|
109
|
-
return {
|
|
110
|
-
...(0, shared_env_configuration_1.getSharedConfigurationFromEnvironment)(signalIdentifier),
|
|
111
|
-
url: getSpecificUrlFromEnv(signalIdentifier) ??
|
|
112
|
-
getNonSpecificUrlFromEnv(signalResourcePath),
|
|
113
|
-
headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(getStaticHeadersFromEnv(signalIdentifier)),
|
|
114
|
-
agentFactory: (0, otlp_node_http_configuration_1.httpAgentFactoryFromOptions)({
|
|
115
|
-
keepAlive: true,
|
|
116
|
-
ca: getRootCertificateFromEnv(signalIdentifier),
|
|
117
|
-
cert: getClientCertificateFromEnv(signalIdentifier),
|
|
118
|
-
key: getClientKeyFromEnv(signalIdentifier),
|
|
119
|
-
}),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
exports.getNodeHttpConfigurationFromEnvironment = getNodeHttpConfigurationFromEnvironment;
|
|
123
|
-
//# sourceMappingURL=otlp-node-http-env-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-env-configuration.js","sourceRoot":"","sources":["../../../src/configuration/otlp-node-http-env-configuration.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,8CAAgF;AAChF,4CAA0C;AAC1C,yEAAmF;AACnF,iEAAqE;AAErE,iFAA6E;AAE7E,SAAS,uBAAuB,CAC9B,gBAAwB;IAExB,MAAM,wBAAwB,GAAG,IAAA,uBAAgB,EAC/C,sBAAsB,gBAAgB,UAAU,CACjD,CAAC;IACF,MAAM,2BAA2B,GAAG,IAAA,uBAAgB,EAClD,4BAA4B,CAC7B,CAAC;IAEF,MAAM,qBAAqB,GAAG,IAAA,8BAAuB,EACnD,wBAAwB,CACzB,CAAC;IACF,MAAM,wBAAwB,GAAG,IAAA,8BAAuB,EACtD,2BAA2B,CAC5B,CAAC;IAEF,IACE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,KAAK,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,KAAK,CAAC,EAClD;QACA,OAAO,SAAS,CAAC;KAClB;IAED,gGAAgG;IAChG,yBAAyB;IACzB,OAAO,MAAM,CAAC,MAAM,CAClB,EAAE,EACF,IAAA,8BAAuB,EAAC,2BAA2B,CAAC,EACpD,IAAA,8BAAuB,EAAC,wBAAwB,CAAC,CAClD,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,GAAW;IAC9C,IAAI;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,8DAA8D;QAC9D,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC7B;IAAC,MAAM;QACN,UAAI,CAAC,IAAI,CACP,oEAAoE,GAAG,8BAA8B,CACtG,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,uBAAuB,CAC9B,GAAW,EACX,IAAY;IAEZ,IAAI;QACF,oDAAoD;QACpD,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;KACd;IAAC,MAAM;QACN,UAAI,CAAC,IAAI,CACP,oEAAoE,GAAG,8BAA8B,CACtG,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACtB,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KACjB;IACD,GAAG,IAAI,IAAI,CAAC;IAEZ,IAAI;QACF,oDAAoD;QACpD,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;KACd;IAAC,MAAM;QACN,UAAI,CAAC,IAAI,CACP,8CAA8C,IAAI,uDAAuD,GAAG,GAAG,CAChH,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,wBAAwB,CAC/B,kBAA0B;IAE1B,MAAM,MAAM,GAAG,IAAA,uBAAgB,EAAC,6BAA6B,CAAC,CAAC;IAC/D,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,qBAAqB,CAAC,gBAAwB;IACrD,MAAM,MAAM,GAAG,IAAA,uBAAgB,EAC7B,sBAAsB,gBAAgB,WAAW,CAClD,CAAC;IACF,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,eAAe,CACtB,oBAA4B,EAC5B,uBAA+B,EAC/B,cAAsB;IAEtB,MAAM,kBAAkB,GAAG,IAAA,uBAAgB,EAAC,oBAAoB,CAAC,CAAC;IAClE,MAAM,qBAAqB,GAAG,IAAA,uBAAgB,EAAC,uBAAuB,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG,kBAAkB,IAAI,qBAAqB,CAAC;IAE7D,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,IAAI;YACF,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC/D;QAAC,MAAM;YACN,UAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC1B,OAAO,SAAS,CAAC;SAClB;KACF;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,2BAA2B,CAClC,gBAAwB;IAExB,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,qBAAqB,EAC3D,uCAAuC,EACvC,8CAA8C,CAC/C,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,gBAAwB;IACnD,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,aAAa,EACnD,+BAA+B,EAC/B,oDAAoD,CACrD,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,gBAAwB;IAExB,OAAO,eAAe,CACpB,sBAAsB,gBAAgB,cAAc,EACpD,gCAAgC,EAChC,sCAAsC,CACvC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uCAAuC,CACrD,gBAAwB,EACxB,kBAA0B;IAE1B,OAAO;QACL,GAAG,IAAA,gEAAqC,EAAC,gBAAgB,CAAC;QAC1D,GAAG,EACD,qBAAqB,CAAC,gBAAgB,CAAC;YACvC,wBAAwB,CAAC,kBAAkB,CAAC;QAC9C,OAAO,EAAE,IAAA,kDAA2B,EAClC,uBAAuB,CAAC,gBAAgB,CAAC,CAC1C;QACD,YAAY,EAAE,IAAA,0DAA2B,EAAC;YACxC,SAAS,EAAE,IAAI;YACf,EAAE,EAAE,yBAAyB,CAAC,gBAAgB,CAAC;YAC/C,IAAI,EAAE,2BAA2B,CAAC,gBAAgB,CAAC;YACnD,GAAG,EAAE,mBAAmB,CAAC,gBAAgB,CAAC;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC;AAnBD,0FAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { getStringFromEnv, parseKeyPairsIntoRecord } from '@opentelemetry/core';\nimport { diag } from '@opentelemetry/api';\nimport { getSharedConfigurationFromEnvironment } from './shared-env-configuration';\nimport { wrapStaticHeadersInFunction } from './shared-configuration';\nimport type { OtlpNodeHttpConfiguration } from './otlp-node-http-configuration';\nimport { httpAgentFactoryFromOptions } from './otlp-node-http-configuration';\n\nfunction getStaticHeadersFromEnv(\n signalIdentifier: string\n): Record<string, string> | undefined {\n const signalSpecificRawHeaders = getStringFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`\n );\n const nonSignalSpecificRawHeaders = getStringFromEnv(\n 'OTEL_EXPORTER_OTLP_HEADERS'\n );\n\n const signalSpecificHeaders = parseKeyPairsIntoRecord(\n signalSpecificRawHeaders\n );\n const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(\n nonSignalSpecificRawHeaders\n );\n\n if (\n Object.keys(signalSpecificHeaders).length === 0 &&\n Object.keys(nonSignalSpecificHeaders).length === 0\n ) {\n return undefined;\n }\n\n // headers are combined instead of overwritten, with the specific headers taking precedence over\n // the non-specific ones.\n return Object.assign(\n {},\n parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),\n parseKeyPairsIntoRecord(signalSpecificRawHeaders)\n );\n}\n\nfunction appendRootPathToUrlIfNeeded(url: string): string | undefined {\n try {\n const parsedUrl = new URL(url);\n // This will automatically append '/' if there's no root path.\n return parsedUrl.toString();\n } catch {\n diag.warn(\n `Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`\n );\n return undefined;\n }\n}\n\nfunction appendResourcePathToUrl(\n url: string,\n path: string\n): string | undefined {\n try {\n // just try to parse, if it fails we catch and warn.\n new URL(url);\n } catch {\n diag.warn(\n `Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`\n );\n return undefined;\n }\n\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n url += path;\n\n try {\n // just try to parse, if it fails we catch and warn.\n new URL(url);\n } catch {\n diag.warn(\n `Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`\n );\n return undefined;\n }\n\n return url;\n}\n\nfunction getNonSpecificUrlFromEnv(\n signalResourcePath: string\n): string | undefined {\n const envUrl = getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT');\n if (envUrl === undefined) {\n return undefined;\n }\n return appendResourcePathToUrl(envUrl, signalResourcePath);\n}\n\nfunction getSpecificUrlFromEnv(signalIdentifier: string): string | undefined {\n const envUrl = getStringFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`\n );\n if (envUrl === undefined) {\n return undefined;\n }\n return appendRootPathToUrlIfNeeded(envUrl);\n}\n\nfunction readFileFromEnv(\n signalSpecificEnvVar: string,\n nonSignalSpecificEnvVar: string,\n warningMessage: string\n): Buffer | undefined {\n const signalSpecificPath = getStringFromEnv(signalSpecificEnvVar);\n const nonSignalSpecificPath = getStringFromEnv(nonSignalSpecificEnvVar);\n const filePath = signalSpecificPath ?? nonSignalSpecificPath;\n\n if (filePath != null) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), filePath));\n } catch {\n diag.warn(warningMessage);\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction getClientCertificateFromEnv(\n signalIdentifier: string\n): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`,\n 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE',\n 'Failed to read client certificate chain file'\n );\n}\n\nfunction getClientKeyFromEnv(signalIdentifier: string): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`,\n 'OTEL_EXPORTER_OTLP_CLIENT_KEY',\n 'Failed to read client certificate private key file'\n );\n}\n\nfunction getRootCertificateFromEnv(\n signalIdentifier: string\n): Buffer | undefined {\n return readFileFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`,\n 'OTEL_EXPORTER_OTLP_CERTIFICATE',\n 'Failed to read root certificate file'\n );\n}\n\n/**\n * Reads and returns configuration from the environment\n *\n * @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)\n * @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)\n */\nexport function getNodeHttpConfigurationFromEnvironment(\n signalIdentifier: string,\n signalResourcePath: string\n): Partial<OtlpNodeHttpConfiguration> {\n return {\n ...getSharedConfigurationFromEnvironment(signalIdentifier),\n url:\n getSpecificUrlFromEnv(signalIdentifier) ??\n getNonSpecificUrlFromEnv(signalResourcePath),\n headers: wrapStaticHeadersInFunction(\n getStaticHeadersFromEnv(signalIdentifier)\n ),\n agentFactory: httpAgentFactoryFromOptions({\n keepAlive: true,\n ca: getRootCertificateFromEnv(signalIdentifier),\n cert: getClientCertificateFromEnv(signalIdentifier),\n key: getClientKeyFromEnv(signalIdentifier),\n }),\n };\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { HeadersFactory } from './otlp-http-configuration';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration shared across all OTLP exporters
|
|
4
|
-
*
|
|
5
|
-
* Implementation note: anything added here MUST be
|
|
6
|
-
* - platform-agnostic
|
|
7
|
-
* - signal-agnostic
|
|
8
|
-
* - transport-agnostic
|
|
9
|
-
*/
|
|
10
|
-
export interface OtlpSharedConfiguration {
|
|
11
|
-
timeoutMillis: number;
|
|
12
|
-
concurrencyLimit: number;
|
|
13
|
-
compression: 'gzip' | 'none';
|
|
14
|
-
}
|
|
15
|
-
export declare function validateTimeoutMillis(timeoutMillis: number): number;
|
|
16
|
-
export declare function wrapStaticHeadersInFunction(headers: Record<string, string> | undefined): HeadersFactory | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
19
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
20
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
21
|
-
*/
|
|
22
|
-
export declare function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration: Partial<OtlpSharedConfiguration>, fallbackConfiguration: Partial<OtlpSharedConfiguration>, defaultConfiguration: OtlpSharedConfiguration): OtlpSharedConfiguration;
|
|
23
|
-
export declare function getSharedConfigurationDefaults(): OtlpSharedConfiguration;
|
|
24
|
-
//# sourceMappingURL=shared-configuration.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright The OpenTelemetry Authors
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.wrapStaticHeadersInFunction = exports.validateTimeoutMillis = void 0;
|
|
8
|
-
function validateTimeoutMillis(timeoutMillis) {
|
|
9
|
-
if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
|
|
10
|
-
return timeoutMillis;
|
|
11
|
-
}
|
|
12
|
-
throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);
|
|
13
|
-
}
|
|
14
|
-
exports.validateTimeoutMillis = validateTimeoutMillis;
|
|
15
|
-
function wrapStaticHeadersInFunction(headers) {
|
|
16
|
-
if (headers == null) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return async () => headers;
|
|
20
|
-
}
|
|
21
|
-
exports.wrapStaticHeadersInFunction = wrapStaticHeadersInFunction;
|
|
22
|
-
/**
|
|
23
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
24
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
25
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
26
|
-
*/
|
|
27
|
-
function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
28
|
-
return {
|
|
29
|
-
timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ??
|
|
30
|
-
fallbackConfiguration.timeoutMillis ??
|
|
31
|
-
defaultConfiguration.timeoutMillis),
|
|
32
|
-
concurrencyLimit: userProvidedConfiguration.concurrencyLimit ??
|
|
33
|
-
fallbackConfiguration.concurrencyLimit ??
|
|
34
|
-
defaultConfiguration.concurrencyLimit,
|
|
35
|
-
compression: userProvidedConfiguration.compression ??
|
|
36
|
-
fallbackConfiguration.compression ??
|
|
37
|
-
defaultConfiguration.compression,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
exports.mergeOtlpSharedConfigurationWithDefaults = mergeOtlpSharedConfigurationWithDefaults;
|
|
41
|
-
function getSharedConfigurationDefaults() {
|
|
42
|
-
return {
|
|
43
|
-
timeoutMillis: 10000,
|
|
44
|
-
concurrencyLimit: 30,
|
|
45
|
-
compression: 'none',
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.getSharedConfigurationDefaults = getSharedConfigurationDefaults;
|
|
49
|
-
//# sourceMappingURL=shared-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-configuration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkBH,SAAgB,qBAAqB,CAAC,aAAqB;IACzD,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE;QACvD,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CACb,qFAAqF,aAAa,IAAI,CACvG,CAAC;AACJ,CAAC;AAPD,sDAOC;AAED,SAAgB,2BAA2B,CACzC,OAA2C;IAE3C,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC;AAC7B,CAAC;AARD,kEAQC;AAED;;;;GAIG;AACH,SAAgB,wCAAwC,CACtD,yBAA2D,EAC3D,qBAAuD,EACvD,oBAA6C;IAE7C,OAAO;QACL,aAAa,EAAE,qBAAqB,CAClC,yBAAyB,CAAC,aAAa;YACrC,qBAAqB,CAAC,aAAa;YACnC,oBAAoB,CAAC,aAAa,CACrC;QACD,gBAAgB,EACd,yBAAyB,CAAC,gBAAgB;YAC1C,qBAAqB,CAAC,gBAAgB;YACtC,oBAAoB,CAAC,gBAAgB;QACvC,WAAW,EACT,yBAAyB,CAAC,WAAW;YACrC,qBAAqB,CAAC,WAAW;YACjC,oBAAoB,CAAC,WAAW;KACnC,CAAC;AACJ,CAAC;AApBD,4FAoBC;AAED,SAAgB,8BAA8B;IAC5C,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC;AAND,wEAMC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { HeadersFactory } from './otlp-http-configuration';\n\n/**\n * Configuration shared across all OTLP exporters\n *\n * Implementation note: anything added here MUST be\n * - platform-agnostic\n * - signal-agnostic\n * - transport-agnostic\n */\nexport interface OtlpSharedConfiguration {\n timeoutMillis: number;\n concurrencyLimit: number;\n compression: 'gzip' | 'none';\n}\n\nexport function validateTimeoutMillis(timeoutMillis: number) {\n if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {\n return timeoutMillis;\n }\n throw new Error(\n `Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`\n );\n}\n\nexport function wrapStaticHeadersInFunction(\n headers: Record<string, string> | undefined\n): HeadersFactory | undefined {\n if (headers == null) {\n return undefined;\n }\n\n return async () => headers;\n}\n\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpSharedConfigurationWithDefaults(\n userProvidedConfiguration: Partial<OtlpSharedConfiguration>,\n fallbackConfiguration: Partial<OtlpSharedConfiguration>,\n defaultConfiguration: OtlpSharedConfiguration\n): OtlpSharedConfiguration {\n return {\n timeoutMillis: validateTimeoutMillis(\n userProvidedConfiguration.timeoutMillis ??\n fallbackConfiguration.timeoutMillis ??\n defaultConfiguration.timeoutMillis\n ),\n concurrencyLimit:\n userProvidedConfiguration.concurrencyLimit ??\n fallbackConfiguration.concurrencyLimit ??\n defaultConfiguration.concurrencyLimit,\n compression:\n userProvidedConfiguration.compression ??\n fallbackConfiguration.compression ??\n defaultConfiguration.compression,\n };\n}\n\nexport function getSharedConfigurationDefaults(): OtlpSharedConfiguration {\n return {\n timeoutMillis: 10000,\n concurrencyLimit: 30,\n compression: 'none',\n };\n}\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSharedConfigurationFromEnvironment = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright The OpenTelemetry Authors
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
const core_1 = require("@opentelemetry/core");
|
|
9
|
-
const api_1 = require("@opentelemetry/api");
|
|
10
|
-
function parseAndValidateTimeoutFromEnv(timeoutEnvVar) {
|
|
11
|
-
const envTimeout = (0, core_1.getNumberFromEnv)(timeoutEnvVar);
|
|
12
|
-
if (envTimeout != null) {
|
|
13
|
-
if (Number.isFinite(envTimeout) && envTimeout > 0) {
|
|
14
|
-
return envTimeout;
|
|
15
|
-
}
|
|
16
|
-
api_1.diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`);
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
function getTimeoutFromEnv(signalIdentifier) {
|
|
21
|
-
const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`);
|
|
22
|
-
const nonSpecificTimeout = parseAndValidateTimeoutFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT');
|
|
23
|
-
return specificTimeout ?? nonSpecificTimeout;
|
|
24
|
-
}
|
|
25
|
-
function parseAndValidateCompressionFromEnv(compressionEnvVar) {
|
|
26
|
-
const compression = (0, core_1.getStringFromEnv)(compressionEnvVar)?.trim();
|
|
27
|
-
if (compression == null || compression === 'none' || compression === 'gzip') {
|
|
28
|
-
return compression;
|
|
29
|
-
}
|
|
30
|
-
api_1.diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`);
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
function getCompressionFromEnv(signalIdentifier) {
|
|
34
|
-
const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`);
|
|
35
|
-
const nonSpecificCompression = parseAndValidateCompressionFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');
|
|
36
|
-
return specificCompression ?? nonSpecificCompression;
|
|
37
|
-
}
|
|
38
|
-
function getSharedConfigurationFromEnvironment(signalIdentifier) {
|
|
39
|
-
return {
|
|
40
|
-
timeoutMillis: getTimeoutFromEnv(signalIdentifier),
|
|
41
|
-
compression: getCompressionFromEnv(signalIdentifier),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
exports.getSharedConfigurationFromEnvironment = getSharedConfigurationFromEnvironment;
|
|
45
|
-
//# sourceMappingURL=shared-env-configuration.js.map
|