@opentelemetry/otlp-exporter-base 0.222.0 → 0.300.0-development.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +159 -0
- package/dist/transport/fetch-transport.cjs.map +1 -0
- package/dist/transport/fetch-transport.mjs +159 -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 +43 -41
- 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,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,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export var CompressionAlgorithm;
|
|
6
|
-
(function (CompressionAlgorithm) {
|
|
7
|
-
CompressionAlgorithm["NONE"] = "none";
|
|
8
|
-
CompressionAlgorithm["GZIP"] = "gzip";
|
|
9
|
-
})(CompressionAlgorithm || (CompressionAlgorithm = {}));
|
|
10
|
-
//# 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,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,qCAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,KAApB,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,59 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { getSharedConfigurationDefaults, mergeOtlpSharedConfigurationWithDefaults, } from './shared-configuration';
|
|
6
|
-
import { validateAndNormalizeHeaders } from '../util';
|
|
7
|
-
function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {
|
|
8
|
-
return async () => {
|
|
9
|
-
const requiredHeaders = {
|
|
10
|
-
...(await defaultHeaders()),
|
|
11
|
-
};
|
|
12
|
-
const headers = {};
|
|
13
|
-
// add fallback ones first
|
|
14
|
-
if (fallbackHeaders != null) {
|
|
15
|
-
Object.assign(headers, await fallbackHeaders());
|
|
16
|
-
}
|
|
17
|
-
// override with user-provided ones
|
|
18
|
-
if (userProvidedHeaders != null) {
|
|
19
|
-
Object.assign(headers, validateAndNormalizeHeaders(await userProvidedHeaders()));
|
|
20
|
-
}
|
|
21
|
-
// override required ones.
|
|
22
|
-
return Object.assign(headers, requiredHeaders);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function validateUserProvidedUrl(url) {
|
|
26
|
-
if (url == null) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
// NOTE: In non-browser environments, `globalThis.location` will be `undefined`.
|
|
31
|
-
const base = globalThis.location?.href;
|
|
32
|
-
return new URL(url, base).href;
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
40
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
41
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
42
|
-
*/
|
|
43
|
-
export function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
44
|
-
return {
|
|
45
|
-
...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
46
|
-
headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),
|
|
47
|
-
url: validateUserProvidedUrl(userProvidedConfiguration.url) ??
|
|
48
|
-
fallbackConfiguration.url ??
|
|
49
|
-
defaultConfiguration.url,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
53
|
-
return {
|
|
54
|
-
...getSharedConfigurationDefaults(),
|
|
55
|
-
headers: async () => requiredHeaders,
|
|
56
|
-
url: 'http://localhost:4318/' + signalResourcePath,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
//# 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,OAAO,EACL,8BAA8B,EAC9B,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;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,2BAA2B,CAAC,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,MAAM,UAAU,sCAAsC,CACpD,yBAAyD,EACzD,qBAAqD,EACrD,oBAA2C;IAE3C,OAAO;QACL,GAAG,wCAAwC,CACzC,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;AAED,MAAM,UAAU,4BAA4B,CAC1C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,8BAA8B,EAAE;QACnC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe;QACpC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB;KACnD,CAAC;AACJ,CAAC","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,35 +0,0 @@
|
|
|
1
|
-
import { getHttpConfigurationDefaults, mergeOtlpHttpConfigurationWithDefaults, } from './otlp-http-configuration';
|
|
2
|
-
export function httpAgentFactoryFromOptions(options) {
|
|
3
|
-
return async (protocol) => {
|
|
4
|
-
const isInsecure = protocol === 'http:';
|
|
5
|
-
const module = isInsecure ? import('http') : import('https');
|
|
6
|
-
const { Agent } = await module;
|
|
7
|
-
if (isInsecure) {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- these props should not be used in agent options
|
|
9
|
-
const { ca, cert, key, ...insecureOptions } = options;
|
|
10
|
-
return new Agent(insecureOptions);
|
|
11
|
-
}
|
|
12
|
-
return new Agent(options);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param userProvidedConfiguration Configuration options provided by the user in code.
|
|
17
|
-
* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.
|
|
18
|
-
* @param defaultConfiguration The defaults as defined by the exporter specification
|
|
19
|
-
*/
|
|
20
|
-
export function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
21
|
-
return {
|
|
22
|
-
...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
23
|
-
agentFactory: userProvidedConfiguration.agentFactory ??
|
|
24
|
-
fallbackConfiguration.agentFactory ??
|
|
25
|
-
defaultConfiguration.agentFactory,
|
|
26
|
-
userAgent: userProvidedConfiguration.userAgent,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
30
|
-
return {
|
|
31
|
-
...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath),
|
|
32
|
-
agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//# 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,OAAO,EACL,4BAA4B,EAC5B,sCAAsC,GACvC,MAAM,2BAA2B,CAAC;AA8BnC,MAAM,UAAU,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;AAED;;;;GAIG;AACH,MAAM,UAAU,0CAA0C,CACxD,yBAA6D,EAC7D,qBAAyD,EACzD,oBAA+C;IAE/C,OAAO;QACL,GAAG,sCAAsC,CACvC,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;AAED,MAAM,UAAU,gCAAgC,CAC9C,eAAuC,EACvC,kBAA0B;IAE1B,OAAO;QACL,GAAG,4BAA4B,CAAC,eAAe,EAAE,kBAAkB,CAAC;QACpE,YAAY,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC","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,119 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from 'fs';
|
|
6
|
-
import * as path from 'path';
|
|
7
|
-
import { getStringFromEnv, parseKeyPairsIntoRecord } from '@opentelemetry/core';
|
|
8
|
-
import { diag } from '@opentelemetry/api';
|
|
9
|
-
import { getSharedConfigurationFromEnvironment } from './shared-env-configuration';
|
|
10
|
-
import { wrapStaticHeadersInFunction } from './shared-configuration';
|
|
11
|
-
import { httpAgentFactoryFromOptions } from './otlp-node-http-configuration';
|
|
12
|
-
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
13
|
-
const signalSpecificRawHeaders = getStringFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`);
|
|
14
|
-
const nonSignalSpecificRawHeaders = getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');
|
|
15
|
-
const signalSpecificHeaders = parseKeyPairsIntoRecord(signalSpecificRawHeaders);
|
|
16
|
-
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders);
|
|
17
|
-
if (Object.keys(signalSpecificHeaders).length === 0 &&
|
|
18
|
-
Object.keys(nonSignalSpecificHeaders).length === 0) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
// headers are combined instead of overwritten, with the specific headers taking precedence over
|
|
22
|
-
// the non-specific ones.
|
|
23
|
-
return Object.assign({}, parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders), parseKeyPairsIntoRecord(signalSpecificRawHeaders));
|
|
24
|
-
}
|
|
25
|
-
function appendRootPathToUrlIfNeeded(url) {
|
|
26
|
-
try {
|
|
27
|
-
const parsedUrl = new URL(url);
|
|
28
|
-
// This will automatically append '/' if there's no root path.
|
|
29
|
-
return parsedUrl.toString();
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function appendResourcePathToUrl(url, path) {
|
|
37
|
-
try {
|
|
38
|
-
// just try to parse, if it fails we catch and warn.
|
|
39
|
-
new URL(url);
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
if (!url.endsWith('/')) {
|
|
46
|
-
url = url + '/';
|
|
47
|
-
}
|
|
48
|
-
url += path;
|
|
49
|
-
try {
|
|
50
|
-
// just try to parse, if it fails we catch and warn.
|
|
51
|
-
new URL(url);
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
return url;
|
|
58
|
-
}
|
|
59
|
-
function getNonSpecificUrlFromEnv(signalResourcePath) {
|
|
60
|
-
const envUrl = getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT');
|
|
61
|
-
if (envUrl === undefined) {
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
return appendResourcePathToUrl(envUrl, signalResourcePath);
|
|
65
|
-
}
|
|
66
|
-
function getSpecificUrlFromEnv(signalIdentifier) {
|
|
67
|
-
const envUrl = getStringFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`);
|
|
68
|
-
if (envUrl === undefined) {
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
return appendRootPathToUrlIfNeeded(envUrl);
|
|
72
|
-
}
|
|
73
|
-
function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningMessage) {
|
|
74
|
-
const signalSpecificPath = getStringFromEnv(signalSpecificEnvVar);
|
|
75
|
-
const nonSignalSpecificPath = getStringFromEnv(nonSignalSpecificEnvVar);
|
|
76
|
-
const filePath = signalSpecificPath ?? nonSignalSpecificPath;
|
|
77
|
-
if (filePath != null) {
|
|
78
|
-
try {
|
|
79
|
-
return fs.readFileSync(path.resolve(process.cwd(), filePath));
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
diag.warn(warningMessage);
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function getClientCertificateFromEnv(signalIdentifier) {
|
|
91
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE', 'Failed to read client certificate chain file');
|
|
92
|
-
}
|
|
93
|
-
function getClientKeyFromEnv(signalIdentifier) {
|
|
94
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`, 'OTEL_EXPORTER_OTLP_CLIENT_KEY', 'Failed to read client certificate private key file');
|
|
95
|
-
}
|
|
96
|
-
function getRootCertificateFromEnv(signalIdentifier) {
|
|
97
|
-
return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`, 'OTEL_EXPORTER_OTLP_CERTIFICATE', 'Failed to read root certificate file');
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Reads and returns configuration from the environment
|
|
101
|
-
*
|
|
102
|
-
* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS)
|
|
103
|
-
* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs)
|
|
104
|
-
*/
|
|
105
|
-
export function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) {
|
|
106
|
-
return {
|
|
107
|
-
...getSharedConfigurationFromEnvironment(signalIdentifier),
|
|
108
|
-
url: getSpecificUrlFromEnv(signalIdentifier) ??
|
|
109
|
-
getNonSpecificUrlFromEnv(signalResourcePath),
|
|
110
|
-
headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)),
|
|
111
|
-
agentFactory: httpAgentFactoryFromOptions({
|
|
112
|
-
keepAlive: true,
|
|
113
|
-
ca: getRootCertificateFromEnv(signalIdentifier),
|
|
114
|
-
cert: getClientCertificateFromEnv(signalIdentifier),
|
|
115
|
-
key: getClientKeyFromEnv(signalIdentifier),
|
|
116
|
-
}),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
//# 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,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,SAAS,uBAAuB,CAC9B,gBAAwB;IAExB,MAAM,wBAAwB,GAAG,gBAAgB,CAC/C,sBAAsB,gBAAgB,UAAU,CACjD,CAAC;IACF,MAAM,2BAA2B,GAAG,gBAAgB,CAClD,4BAA4B,CAC7B,CAAC;IAEF,MAAM,qBAAqB,GAAG,uBAAuB,CACnD,wBAAwB,CACzB,CAAC;IACF,MAAM,wBAAwB,GAAG,uBAAuB,CACtD,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,uBAAuB,CAAC,2BAA2B,CAAC,EACpD,uBAAuB,CAAC,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,IAAI,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,IAAI,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,IAAI,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,gBAAgB,CAAC,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,gBAAgB,CAC7B,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,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IAClE,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,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,IAAI,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,MAAM,UAAU,uCAAuC,CACrD,gBAAwB,EACxB,kBAA0B;IAE1B,OAAO;QACL,GAAG,qCAAqC,CAAC,gBAAgB,CAAC;QAC1D,GAAG,EACD,qBAAqB,CAAC,gBAAgB,CAAC;YACvC,wBAAwB,CAAC,kBAAkB,CAAC;QAC9C,OAAO,EAAE,2BAA2B,CAClC,uBAAuB,CAAC,gBAAgB,CAAC,CAC1C;QACD,YAAY,EAAE,2BAA2B,CAAC;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","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,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export function validateTimeoutMillis(timeoutMillis) {
|
|
6
|
-
if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
|
|
7
|
-
return timeoutMillis;
|
|
8
|
-
}
|
|
9
|
-
throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);
|
|
10
|
-
}
|
|
11
|
-
export function wrapStaticHeadersInFunction(headers) {
|
|
12
|
-
if (headers == null) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return async () => headers;
|
|
16
|
-
}
|
|
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 function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
23
|
-
return {
|
|
24
|
-
timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ??
|
|
25
|
-
fallbackConfiguration.timeoutMillis ??
|
|
26
|
-
defaultConfiguration.timeoutMillis),
|
|
27
|
-
concurrencyLimit: userProvidedConfiguration.concurrencyLimit ??
|
|
28
|
-
fallbackConfiguration.concurrencyLimit ??
|
|
29
|
-
defaultConfiguration.concurrencyLimit,
|
|
30
|
-
compression: userProvidedConfiguration.compression ??
|
|
31
|
-
fallbackConfiguration.compression ??
|
|
32
|
-
defaultConfiguration.compression,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export function getSharedConfigurationDefaults() {
|
|
36
|
-
return {
|
|
37
|
-
timeoutMillis: 10000,
|
|
38
|
-
concurrencyLimit: 30,
|
|
39
|
-
compression: 'none',
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# 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,MAAM,UAAU,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;AAED,MAAM,UAAU,2BAA2B,CACzC,OAA2C;IAE3C,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,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;AAED,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC","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,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';
|
|
6
|
-
import { diag } from '@opentelemetry/api';
|
|
7
|
-
function parseAndValidateTimeoutFromEnv(timeoutEnvVar) {
|
|
8
|
-
const envTimeout = getNumberFromEnv(timeoutEnvVar);
|
|
9
|
-
if (envTimeout != null) {
|
|
10
|
-
if (Number.isFinite(envTimeout) && envTimeout > 0) {
|
|
11
|
-
return envTimeout;
|
|
12
|
-
}
|
|
13
|
-
diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`);
|
|
14
|
-
}
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
function getTimeoutFromEnv(signalIdentifier) {
|
|
18
|
-
const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`);
|
|
19
|
-
const nonSpecificTimeout = parseAndValidateTimeoutFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT');
|
|
20
|
-
return specificTimeout ?? nonSpecificTimeout;
|
|
21
|
-
}
|
|
22
|
-
function parseAndValidateCompressionFromEnv(compressionEnvVar) {
|
|
23
|
-
const compression = getStringFromEnv(compressionEnvVar)?.trim();
|
|
24
|
-
if (compression == null || compression === 'none' || compression === 'gzip') {
|
|
25
|
-
return compression;
|
|
26
|
-
}
|
|
27
|
-
diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`);
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
function getCompressionFromEnv(signalIdentifier) {
|
|
31
|
-
const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`);
|
|
32
|
-
const nonSpecificCompression = parseAndValidateCompressionFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');
|
|
33
|
-
return specificCompression ?? nonSpecificCompression;
|
|
34
|
-
}
|
|
35
|
-
export function getSharedConfigurationFromEnvironment(signalIdentifier) {
|
|
36
|
-
return {
|
|
37
|
-
timeoutMillis: getTimeoutFromEnv(signalIdentifier),
|
|
38
|
-
compression: getCompressionFromEnv(signalIdentifier),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=shared-env-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-env-configuration.js","sourceRoot":"","sources":["../../../src/configuration/shared-env-configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,SAAS,8BAA8B,CACrC,aAAqB;IAErB,MAAM,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE;YACjD,OAAO,UAAU,CAAC;SACnB;QACD,IAAI,CAAC,IAAI,CACP,kBAAkB,aAAa,wDAAwD,UAAU,GAAG,CACrG,CAAC;KACH;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,gBAAwB;IACjD,MAAM,eAAe,GAAG,8BAA8B,CACpD,sBAAsB,gBAAgB,UAAU,CACjD,CAAC;IACF,MAAM,kBAAkB,GAAG,8BAA8B,CACvD,4BAA4B,CAC7B,CAAC;IAEF,OAAO,eAAe,IAAI,kBAAkB,CAAC;AAC/C,CAAC;AAED,SAAS,kCAAkC,CACzC,iBAAyB;IAEzB,MAAM,WAAW,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC;IAEhE,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,KAAK,MAAM,EAAE;QAC3E,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,CAAC,IAAI,CACP,kBAAkB,iBAAiB,oDAAoD,WAAW,IAAI,CACvG,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qBAAqB,CAC5B,gBAAwB;IAExB,MAAM,mBAAmB,GAAG,kCAAkC,CAC5D,sBAAsB,gBAAgB,cAAc,CACrD,CAAC;IACF,MAAM,sBAAsB,GAAG,kCAAkC,CAC/D,gCAAgC,CACjC,CAAC;IAEF,OAAO,mBAAmB,IAAI,sBAAsB,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,gBAAwB;IAExB,OAAO;QACL,aAAa,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;QAClD,WAAW,EAAE,qBAAqB,CAAC,gBAAgB,CAAC;KACrD,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';\nimport type { OtlpSharedConfiguration } from './shared-configuration';\nimport { diag } from '@opentelemetry/api';\n\nfunction parseAndValidateTimeoutFromEnv(\n timeoutEnvVar: string\n): number | undefined {\n const envTimeout = getNumberFromEnv(timeoutEnvVar);\n if (envTimeout != null) {\n if (Number.isFinite(envTimeout) && envTimeout > 0) {\n return envTimeout;\n }\n diag.warn(\n `Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`\n );\n }\n\n return undefined;\n}\n\nfunction getTimeoutFromEnv(signalIdentifier: string) {\n const specificTimeout = parseAndValidateTimeoutFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`\n );\n const nonSpecificTimeout = parseAndValidateTimeoutFromEnv(\n 'OTEL_EXPORTER_OTLP_TIMEOUT'\n );\n\n return specificTimeout ?? nonSpecificTimeout;\n}\n\nfunction parseAndValidateCompressionFromEnv(\n compressionEnvVar: string\n): 'none' | 'gzip' | undefined {\n const compression = getStringFromEnv(compressionEnvVar)?.trim();\n\n if (compression == null || compression === 'none' || compression === 'gzip') {\n return compression;\n }\n\n diag.warn(\n `Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`\n );\n return undefined;\n}\n\nfunction getCompressionFromEnv(\n signalIdentifier: string\n): 'none' | 'gzip' | undefined {\n const specificCompression = parseAndValidateCompressionFromEnv(\n `OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`\n );\n const nonSpecificCompression = parseAndValidateCompressionFromEnv(\n 'OTEL_EXPORTER_OTLP_COMPRESSION'\n );\n\n return specificCompression ?? nonSpecificCompression;\n}\n\nexport function getSharedConfigurationFromEnvironment(\n signalIdentifier: string\n): Partial<OtlpSharedConfiguration> {\n return {\n timeoutMillis: getTimeoutFromEnv(signalIdentifier),\n compression: getCompressionFromEnv(signalIdentifier),\n };\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface ExportResponseSuccess {
|
|
2
|
-
status: 'success';
|
|
3
|
-
data?: Uint8Array;
|
|
4
|
-
}
|
|
5
|
-
export interface ExportResponseFailure {
|
|
6
|
-
status: 'failure';
|
|
7
|
-
error: Error;
|
|
8
|
-
}
|
|
9
|
-
export interface ExportResponseRetryable {
|
|
10
|
-
status: 'retryable';
|
|
11
|
-
retryInMillis?: number;
|
|
12
|
-
error?: Error;
|
|
13
|
-
}
|
|
14
|
-
export type ExportResponse = ExportResponseSuccess | ExportResponseFailure | ExportResponseRetryable;
|
|
15
|
-
//# sourceMappingURL=export-response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-response.js","sourceRoot":"","sources":["../../src/export-response.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ExportResponseSuccess {\n status: 'success';\n data?: Uint8Array;\n}\n\nexport interface ExportResponseFailure {\n status: 'failure';\n error: Error;\n}\n\nexport interface ExportResponseRetryable {\n status: 'retryable';\n retryInMillis?: number;\n error?: Error;\n}\n\nexport type ExportResponse =\n | ExportResponseSuccess\n | ExportResponseFailure\n | ExportResponseRetryable;\n"]}
|