@opentelemetry/otlp-exporter-base 0.222.0-development.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,9 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';
|
|
6
|
-
export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, } from './otlp-http-export-delegate';
|
|
7
|
-
export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
|
|
8
|
-
export { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';
|
|
9
|
-
//# sourceMappingURL=index-node-http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';\nexport {\n createOtlpHttpExportDelegate,\n createOtlpHttpExporterMetrics,\n} from './otlp-http-export-delegate';\nexport { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';\nexport { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';\n"]}
|
package/build/esnext/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { OTLPExporterBase } from './OTLPExporterBase';
|
|
2
|
-
export { OTLPExporterError } from './types';
|
|
3
|
-
export type { ExportResponse, ExportResponseFailure, ExportResponseSuccess, ExportResponseRetryable, } from './export-response';
|
|
4
|
-
export type { IExporterTransport } from './exporter-transport';
|
|
5
|
-
export { mergeOtlpSharedConfigurationWithDefaults, getSharedConfigurationDefaults, } from './configuration/shared-configuration';
|
|
6
|
-
export type { OtlpSharedConfiguration } from './configuration/shared-configuration';
|
|
7
|
-
export { CompressionAlgorithm } from './configuration/legacy-node-configuration';
|
|
8
|
-
export type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';
|
|
9
|
-
export type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';
|
|
10
|
-
export type { IOtlpExportDelegate } from './otlp-export-delegate';
|
|
11
|
-
export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
|
|
12
|
-
export { ExporterMetrics } from './ExporterMetrics';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
package/build/esnext/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export { OTLPExporterBase } from './OTLPExporterBase';
|
|
6
|
-
export { OTLPExporterError } from './types';
|
|
7
|
-
export { mergeOtlpSharedConfigurationWithDefaults, getSharedConfigurationDefaults, } from './configuration/shared-configuration';
|
|
8
|
-
export { CompressionAlgorithm } from './configuration/legacy-node-configuration';
|
|
9
|
-
export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
|
|
10
|
-
export { ExporterMetrics } from './ExporterMetrics';
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,OAAO,EACL,wCAAwC,EACxC,8BAA8B,GAC/B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAIjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport { OTLPExporterError } from './types';\n\nexport type {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport type { IExporterTransport } from './exporter-transport';\n\nexport {\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\nexport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\n\nexport { CompressionAlgorithm } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport type { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n\nexport { ExporterMetrics } from './ExporterMetrics';\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export function isExportHTTPErrorRetryable(statusCode) {
|
|
6
|
-
return (statusCode === 429 ||
|
|
7
|
-
statusCode === 502 ||
|
|
8
|
-
statusCode === 503 ||
|
|
9
|
-
statusCode === 504);
|
|
10
|
-
}
|
|
11
|
-
export function parseRetryAfterToMills(retryAfter) {
|
|
12
|
-
if (retryAfter == null) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
const seconds = Number.parseInt(retryAfter, 10);
|
|
16
|
-
if (Number.isInteger(seconds)) {
|
|
17
|
-
return seconds > 0 ? seconds * 1000 : -1;
|
|
18
|
-
}
|
|
19
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives
|
|
20
|
-
const delay = new Date(retryAfter).getTime() - Date.now();
|
|
21
|
-
if (delay >= 0) {
|
|
22
|
-
return delay;
|
|
23
|
-
}
|
|
24
|
-
return 0;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=is-export-retryable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-export-retryable.js","sourceRoot":"","sources":["../../src/is-export-retryable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,0BAA0B,CAAC,UAAkB;IAC3D,OAAO,CACL,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG;QAClB,UAAU,KAAK,GAAG,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,UAAsC;IAEtC,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,mFAAmF;IACnF,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE1D,IAAI,KAAK,IAAI,CAAC,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport function isExportHTTPErrorRetryable(statusCode: number): boolean {\n return (\n statusCode === 429 ||\n statusCode === 502 ||\n statusCode === 503 ||\n statusCode === 504\n );\n}\n\nexport function parseRetryAfterToMills(\n retryAfter?: string | undefined | null\n): number | undefined {\n if (retryAfter == null) {\n return undefined;\n }\n\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IOtlpResponseHandler } from './response-handler';
|
|
2
|
-
/**
|
|
3
|
-
* Default response handler that logs a partial success to the console.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createLoggingPartialSuccessResponseHandler<T>(): IOtlpResponseHandler<T>;
|
|
6
|
-
//# sourceMappingURL=logging-response-handler.d.ts.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { diag } from '@opentelemetry/api';
|
|
6
|
-
function isPartialSuccessResponse(response) {
|
|
7
|
-
return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Default response handler that logs a partial success to the console.
|
|
11
|
-
*/
|
|
12
|
-
export function createLoggingPartialSuccessResponseHandler() {
|
|
13
|
-
return {
|
|
14
|
-
handleResponse(response) {
|
|
15
|
-
// Partial success MUST never be an empty object according the specification
|
|
16
|
-
// see https://opentelemetry.io/docs/specs/otlp/#partial-success
|
|
17
|
-
if (response == null ||
|
|
18
|
-
!isPartialSuccessResponse(response) ||
|
|
19
|
-
response.partialSuccess == null ||
|
|
20
|
-
Object.keys(response.partialSuccess).length === 0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
diag.warn('Received Partial Success response:', JSON.stringify(response.partialSuccess));
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=logging-response-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logging-response-handler.js","sourceRoot":"","sources":["../../src/logging-response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,SAAS,wBAAwB,CAC/B,QAAiB;IAEjB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0CAA0C;IAGxD,OAAO;QACL,cAAc,CAAC,QAAW;YACxB,4EAA4E;YAC5E,gEAAgE;YAChE,IACE,QAAQ,IAAI,IAAI;gBAChB,CAAC,wBAAwB,CAAC,QAAQ,CAAC;gBACnC,QAAQ,CAAC,cAAc,IAAI,IAAI;gBAC/B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,EACjD;gBACA,OAAO;aACR;YACD,IAAI,CAAC,IAAI,CACP,oCAAoC,EACpC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CACxC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport type { IOtlpResponseHandler } from './response-handler';\n\nfunction isPartialSuccessResponse(\n response: unknown\n): response is { partialSuccess: never } {\n return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');\n}\n\n/**\n * Default response handler that logs a partial success to the console.\n */\nexport function createLoggingPartialSuccessResponseHandler<\n T,\n>(): IOtlpResponseHandler<T> {\n return {\n handleResponse(response: T) {\n // Partial success MUST never be an empty object according the specification\n // see https://opentelemetry.io/docs/specs/otlp/#partial-success\n if (\n response == null ||\n !isPartialSuccessResponse(response) ||\n response.partialSuccess == null ||\n Object.keys(response.partialSuccess).length === 0\n ) {\n return;\n }\n diag.warn(\n 'Received Partial Success response:',\n JSON.stringify(response.partialSuccess)\n );\n },\n };\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
|
|
2
|
-
import type { ISerializer } from '@opentelemetry/otlp-transformer';
|
|
3
|
-
import type { IOtlpExportDelegate } from './otlp-export-delegate';
|
|
4
|
-
import { type ExporterMetrics } from './ExporterMetrics';
|
|
5
|
-
export declare function createOtlpFetchExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>): IOtlpExportDelegate<Internal>;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createOtlpSendBeaconExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>): IOtlpExportDelegate<Internal>;
|
|
10
|
-
//# sourceMappingURL=otlp-browser-http-export-delegate.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { createRetryingTransport } from './retrying-transport';
|
|
6
|
-
import { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
|
|
7
|
-
import { createFetchTransport } from './transport/fetch-transport';
|
|
8
|
-
export function createOtlpFetchExportDelegate(options, serializer, metrics) {
|
|
9
|
-
return createOtlpNetworkExportDelegate(options, serializer, metrics, createRetryingTransport({
|
|
10
|
-
transport: createFetchTransport(options),
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
|
|
15
|
-
*/
|
|
16
|
-
export function createOtlpSendBeaconExportDelegate(options, serializer, metrics) {
|
|
17
|
-
return createOtlpFetchExportDelegate(options, serializer, metrics);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=otlp-browser-http-export-delegate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,MAAM,UAAU,6BAA6B,CAC3C,OAA8B,EAC9B,UAA2C,EAC3C,OAAkC;IAElC,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,OAAO,EACP,uBAAuB,CAAC;QACtB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C,EAC3C,OAAkC;IAElC,OAAO,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpFetchExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n metrics,\n createRetryingTransport({\n transport: createFetchTransport(options),\n })\n );\n}\n\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>\n): IOtlpExportDelegate<Internal> {\n return createOtlpFetchExportDelegate(options, serializer, metrics);\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ExportResult } from '@opentelemetry/core';
|
|
2
|
-
import type { IExporterTransport } from './exporter-transport';
|
|
3
|
-
import type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';
|
|
4
|
-
import type { ISerializer } from '@opentelemetry/otlp-transformer';
|
|
5
|
-
import { type ExporterMetrics } from './ExporterMetrics';
|
|
6
|
-
/**
|
|
7
|
-
* Internally shared export logic for OTLP.
|
|
8
|
-
*/
|
|
9
|
-
export interface IOtlpExportDelegate<Internal> {
|
|
10
|
-
export(internalRepresentation: Internal, resultCallback: (result: ExportResult) => void): void;
|
|
11
|
-
forceFlush(): Promise<void>;
|
|
12
|
-
shutdown(): Promise<void>;
|
|
13
|
-
setMetrics(metrics: ExporterMetrics<Internal>): void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all
|
|
17
|
-
* signals.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createOtlpExportDelegate<Internal, Response>(components: {
|
|
20
|
-
transport: IExporterTransport;
|
|
21
|
-
serializer: ISerializer<Internal, Response>;
|
|
22
|
-
promiseHandler: IExportPromiseHandler;
|
|
23
|
-
metrics: ExporterMetrics<Internal>;
|
|
24
|
-
}, settings: {
|
|
25
|
-
timeout: number;
|
|
26
|
-
}): IOtlpExportDelegate<Internal>;
|
|
27
|
-
//# sourceMappingURL=otlp-export-delegate.d.ts.map
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { ExportResultCode } from '@opentelemetry/core';
|
|
6
|
-
import { OTLPExporterError } from './types';
|
|
7
|
-
import { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';
|
|
8
|
-
import { diag } from '@opentelemetry/api';
|
|
9
|
-
class OTLPExportDelegate {
|
|
10
|
-
_metrics;
|
|
11
|
-
_diagLogger;
|
|
12
|
-
_transport;
|
|
13
|
-
_serializer;
|
|
14
|
-
_responseHandler;
|
|
15
|
-
_promiseQueue;
|
|
16
|
-
_timeout;
|
|
17
|
-
constructor(transport, serializer, responseHandler, promiseQueue, metrics, timeout) {
|
|
18
|
-
this._transport = transport;
|
|
19
|
-
this._serializer = serializer;
|
|
20
|
-
this._responseHandler = responseHandler;
|
|
21
|
-
this._promiseQueue = promiseQueue;
|
|
22
|
-
this._timeout = timeout;
|
|
23
|
-
this._diagLogger = diag.createComponentLogger({
|
|
24
|
-
namespace: 'OTLPExportDelegate',
|
|
25
|
-
});
|
|
26
|
-
this._metrics = metrics;
|
|
27
|
-
}
|
|
28
|
-
export(internalRepresentation, resultCallback) {
|
|
29
|
-
this._diagLogger.debug('items to be sent', internalRepresentation);
|
|
30
|
-
// don't do any work if too many exports are in progress.
|
|
31
|
-
if (this._promiseQueue.hasReachedLimit()) {
|
|
32
|
-
resultCallback({
|
|
33
|
-
code: ExportResultCode.FAILED,
|
|
34
|
-
error: new Error('Concurrent export limit reached'),
|
|
35
|
-
});
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
|
|
39
|
-
if (serializedRequest == null) {
|
|
40
|
-
resultCallback({
|
|
41
|
-
code: ExportResultCode.FAILED,
|
|
42
|
-
error: new Error('Nothing to send'),
|
|
43
|
-
});
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const finishExport = this._metrics.startExport(internalRepresentation);
|
|
47
|
-
this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then(response => {
|
|
48
|
-
if (response.status === 'success') {
|
|
49
|
-
finishExport(undefined);
|
|
50
|
-
if (response.data != null) {
|
|
51
|
-
try {
|
|
52
|
-
this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
this._diagLogger.warn('Export succeeded but could not deserialize response - is the response specification compliant?', e, response.data);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// No matter the response, we can consider the export still successful.
|
|
59
|
-
resultCallback({
|
|
60
|
-
code: ExportResultCode.SUCCESS,
|
|
61
|
-
});
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
else if (response.status === 'failure' && response.error) {
|
|
65
|
-
finishExport(response.error);
|
|
66
|
-
resultCallback({
|
|
67
|
-
code: ExportResultCode.FAILED,
|
|
68
|
-
error: response.error,
|
|
69
|
-
});
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
else if (response.status === 'retryable') {
|
|
73
|
-
finishExport('export_max_retries');
|
|
74
|
-
resultCallback({
|
|
75
|
-
code: ExportResultCode.FAILED,
|
|
76
|
-
error: response.error ??
|
|
77
|
-
new OTLPExporterError('Export failed with retryable status'),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
finishExport('export_failed');
|
|
82
|
-
resultCallback({
|
|
83
|
-
code: ExportResultCode.FAILED,
|
|
84
|
-
error: new OTLPExporterError('Export failed with unknown error'),
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}, reason => {
|
|
88
|
-
finishExport(reason);
|
|
89
|
-
resultCallback({
|
|
90
|
-
code: ExportResultCode.FAILED,
|
|
91
|
-
error: reason,
|
|
92
|
-
});
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
forceFlush() {
|
|
96
|
-
return this._promiseQueue.awaitAll();
|
|
97
|
-
}
|
|
98
|
-
setMetrics(metrics) {
|
|
99
|
-
this._metrics = metrics;
|
|
100
|
-
}
|
|
101
|
-
async shutdown() {
|
|
102
|
-
this._diagLogger.debug('shutdown started');
|
|
103
|
-
await this.forceFlush();
|
|
104
|
-
this._transport.shutdown();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all
|
|
109
|
-
* signals.
|
|
110
|
-
*/
|
|
111
|
-
export function createOtlpExportDelegate(components, settings) {
|
|
112
|
-
return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, components.metrics, settings.timeout);
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=otlp-export-delegate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResult } from '@opentelemetry/core';\nimport { ExportResultCode } from '@opentelemetry/core';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterError } from './types';\nimport type { IOtlpResponseHandler } from './response-handler';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\n/**\n * Internally shared export logic for OTLP.\n */\nexport interface IOtlpExportDelegate<Internal> {\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void;\n forceFlush(): Promise<void>;\n shutdown(): Promise<void>;\n setMetrics(metrics: ExporterMetrics<Internal>): void;\n}\n\nclass OTLPExportDelegate<Internal, Response>\n implements IOtlpExportDelegate<Internal>\n{\n private _metrics: ExporterMetrics<Internal>;\n private _diagLogger: DiagLogger;\n private _transport: IExporterTransport;\n private _serializer: ISerializer<Internal, Response>;\n private _responseHandler: IOtlpResponseHandler<Response>;\n private _promiseQueue: IExportPromiseHandler;\n private _timeout: number;\n\n constructor(\n transport: IExporterTransport,\n serializer: ISerializer<Internal, Response>,\n responseHandler: IOtlpResponseHandler<Response>,\n promiseQueue: IExportPromiseHandler,\n metrics: ExporterMetrics<Internal>,\n timeout: number\n ) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n this._metrics = metrics;\n }\n\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n\n const serializedRequest = this._serializer.serializeRequest(\n internalRepresentation\n );\n\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n\n const finishExport = this._metrics.startExport(internalRepresentation);\n this._promiseQueue.pushPromise(\n this._transport.send(serializedRequest, this._timeout).then(\n response => {\n if (response.status === 'success') {\n finishExport(undefined);\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(\n this._serializer.deserializeResponse(response.data)\n );\n } catch (e) {\n this._diagLogger.warn(\n 'Export succeeded but could not deserialize response - is the response specification compliant?',\n e,\n response.data\n );\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n } else if (response.status === 'failure' && response.error) {\n finishExport(response.error);\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n } else if (response.status === 'retryable') {\n finishExport('export_max_retries');\n resultCallback({\n code: ExportResultCode.FAILED,\n error:\n response.error ??\n new OTLPExporterError('Export failed with retryable status'),\n });\n } else {\n finishExport('export_failed');\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n },\n reason => {\n finishExport(reason);\n resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n });\n }\n )\n );\n }\n\n forceFlush(): Promise<void> {\n return this._promiseQueue.awaitAll();\n }\n\n setMetrics(metrics: ExporterMetrics<Internal>) {\n this._metrics = metrics;\n }\n\n async shutdown(): Promise<void> {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate<Internal, Response>(\n components: {\n transport: IExporterTransport;\n serializer: ISerializer<Internal, Response>;\n promiseHandler: IExportPromiseHandler;\n metrics: ExporterMetrics<Internal>;\n },\n settings: { timeout: number }\n): IOtlpExportDelegate<Internal> {\n return new OTLPExportDelegate(\n components.transport,\n components.serializer,\n createLoggingPartialSuccessResponseHandler(),\n components.promiseHandler,\n components.metrics,\n settings.timeout\n );\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MeterProvider } from '@opentelemetry/api';
|
|
2
|
-
import type { IOtlpExportDelegate } from './otlp-export-delegate';
|
|
3
|
-
import type { IExporterMetricsHelper, ISerializer } from '@opentelemetry/otlp-transformer';
|
|
4
|
-
import type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';
|
|
5
|
-
import { ExporterMetrics } from './ExporterMetrics';
|
|
6
|
-
export declare function createOtlpHttpExporterMetrics<Internal>(metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, url: string | undefined, meterProvider: MeterProvider | undefined): ExporterMetrics<Internal>;
|
|
7
|
-
export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
|
|
8
|
-
//# sourceMappingURL=otlp-http-export-delegate.d.ts.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { createOtlpExportDelegate } from './otlp-export-delegate';
|
|
6
|
-
import { createHttpExporterTransport } from './transport/http-exporter-transport';
|
|
7
|
-
import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
|
|
8
|
-
import { createRetryingTransport } from './retrying-transport';
|
|
9
|
-
import { OTLPExporterError } from './types';
|
|
10
|
-
import { ATTR_HTTP_RESPONSE_STATUS_CODE } from './semconv';
|
|
11
|
-
import { ExporterMetrics } from './ExporterMetrics';
|
|
12
|
-
export function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) {
|
|
13
|
-
return new ExporterMetrics({
|
|
14
|
-
componentType: metricsComponentType,
|
|
15
|
-
metricsHelper: exporterMetricsHelper,
|
|
16
|
-
url,
|
|
17
|
-
meterProvider,
|
|
18
|
-
responseAttributesFromError: (error) => {
|
|
19
|
-
if (!error) {
|
|
20
|
-
return {
|
|
21
|
-
[ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
if (!(error instanceof OTLPExporterError)) {
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
[ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export function createOtlpHttpExportDelegate(options, serializer, metricsComponentType, exporterMetricsHelper, meterProvider) {
|
|
34
|
-
return createOtlpExportDelegate({
|
|
35
|
-
transport: createRetryingTransport({
|
|
36
|
-
transport: createHttpExporterTransport(options),
|
|
37
|
-
}),
|
|
38
|
-
serializer: serializer,
|
|
39
|
-
promiseHandler: createBoundedQueueExportPromiseHandler(options),
|
|
40
|
-
metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider),
|
|
41
|
-
}, { timeout: options.timeoutMillis });
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=otlp-http-export-delegate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAKlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,6BAA6B,CAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,GAAuB,EACvB,aAAwC;IAExC,OAAO,IAAI,eAAe,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,8BAA8B,CAAC,EAAE,GAAG;iBACtC,CAAC;aACH;YACD,IAAI,CAAC,CAAC,KAAK,YAAY,iBAAiB,CAAC,EAAE;gBACzC,OAAO,EAAE,CAAC;aACX;YACD,OAAO;gBACL,CAAC,8BAA8B,CAAC,EAAE,KAAK,CAAC,IAAI;aAC7C,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C,EAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,aAAwC;IAExC,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,uBAAuB,CAAC;YACjC,SAAS,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;QAC/D,OAAO,EAAE,6BAA6B,CACpC,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,CAAC,GAAG,EACX,aAAa,CACd;KACF,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '@opentelemetry/api';\n\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport type {\n IExporterMetricsHelper,\n ISerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { createHttpExporterTransport } from './transport/http-exporter-transport';\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createRetryingTransport } from './retrying-transport';\nimport type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';\nimport { OTLPExporterError } from './types';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from './semconv';\nimport { ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpHttpExporterMetrics<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 OTLPExporterError)) {\n return {};\n }\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code,\n };\n },\n });\n}\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpNodeHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n meterProvider: MeterProvider | undefined\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: createRetryingTransport({\n transport: createHttpExporterTransport(options),\n }),\n serializer: serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n metrics: createOtlpHttpExporterMetrics(\n metricsComponentType,\n exporterMetricsHelper,\n options.url,\n meterProvider\n ),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OtlpSharedConfiguration } from './configuration/shared-configuration';
|
|
2
|
-
import type { ISerializer } from '@opentelemetry/otlp-transformer';
|
|
3
|
-
import type { IExporterTransport } from './exporter-transport';
|
|
4
|
-
import type { IOtlpExportDelegate } from './otlp-export-delegate';
|
|
5
|
-
import { type ExporterMetrics } from './ExporterMetrics';
|
|
6
|
-
export declare function createOtlpNetworkExportDelegate<Internal, Response>(options: OtlpSharedConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>, transport: IExporterTransport): IOtlpExportDelegate<Internal>;
|
|
7
|
-
//# sourceMappingURL=otlp-network-export-delegate.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
|
|
6
|
-
import { createOtlpExportDelegate } from './otlp-export-delegate';
|
|
7
|
-
export function createOtlpNetworkExportDelegate(options, serializer, metrics, transport) {
|
|
8
|
-
return createOtlpExportDelegate({
|
|
9
|
-
transport: transport,
|
|
10
|
-
serializer,
|
|
11
|
-
promiseHandler: createBoundedQueueExportPromiseHandler(options),
|
|
12
|
-
metrics,
|
|
13
|
-
}, { timeout: options.timeoutMillis });
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=otlp-network-export-delegate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAKhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,MAAM,UAAU,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,OAAkC,EAClC,SAA6B;IAE7B,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;QAC/D,OAAO;KACR,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpNetworkExportDelegate<Internal, Response>(\n options: OtlpSharedConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>,\n transport: IExporterTransport\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n metrics,\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic export response handler. Can be implemented to handle export responses like partial success.
|
|
3
|
-
*/
|
|
4
|
-
export interface IOtlpResponseHandler<Response> {
|
|
5
|
-
/**
|
|
6
|
-
* Handles an OTLP export response.
|
|
7
|
-
* Implementations MUST NOT throw.
|
|
8
|
-
* @param response
|
|
9
|
-
*/
|
|
10
|
-
handleResponse(response: Response): void;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=response-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-handler.js","sourceRoot":"","sources":["../../src/response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Generic export response handler. Can be implemented to handle export responses like partial success.\n */\nexport interface IOtlpResponseHandler<Response> {\n /**\n * Handles an OTLP export response.\n * Implementations MUST NOT throw.\n * @param response\n */\n handleResponse(response: Response): void;\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { IExporterTransport } from './exporter-transport';
|
|
2
|
-
/**
|
|
3
|
-
* Creates an Exporter Transport that retries on 'retryable' response.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createRetryingTransport(options: {
|
|
6
|
-
transport: IExporterTransport;
|
|
7
|
-
}): IExporterTransport;
|
|
8
|
-
//# sourceMappingURL=retrying-transport.d.ts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { diag } from '@opentelemetry/api';
|
|
6
|
-
const MAX_ATTEMPTS = 5;
|
|
7
|
-
const INITIAL_BACKOFF = 1000;
|
|
8
|
-
const MAX_BACKOFF = 5000;
|
|
9
|
-
const BACKOFF_MULTIPLIER = 1.5;
|
|
10
|
-
const JITTER = 0.2;
|
|
11
|
-
/**
|
|
12
|
-
* Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]
|
|
13
|
-
*/
|
|
14
|
-
function getJitter() {
|
|
15
|
-
return Math.random() * (2 * JITTER) - JITTER;
|
|
16
|
-
}
|
|
17
|
-
class RetryingTransport {
|
|
18
|
-
_transport;
|
|
19
|
-
constructor(transport) {
|
|
20
|
-
this._transport = transport;
|
|
21
|
-
}
|
|
22
|
-
retry(data, timeoutMillis, inMillis) {
|
|
23
|
-
return new Promise((resolve, reject) => {
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
this._transport.send(data, timeoutMillis).then(resolve, reject);
|
|
26
|
-
}, inMillis);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
async send(data, timeoutMillis) {
|
|
30
|
-
let attempts = MAX_ATTEMPTS;
|
|
31
|
-
let nextBackoff = INITIAL_BACKOFF;
|
|
32
|
-
const deadline = Date.now() + timeoutMillis;
|
|
33
|
-
let result = await this._transport.send(data, timeoutMillis);
|
|
34
|
-
while (result.status === 'retryable' && attempts > 0) {
|
|
35
|
-
attempts--;
|
|
36
|
-
// use maximum of computed backoff and 0 to avoid negative timeouts
|
|
37
|
-
const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF), 0);
|
|
38
|
-
nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;
|
|
39
|
-
const retryInMillis = result.retryInMillis ?? backoff;
|
|
40
|
-
// return when expected retry time is after the export deadline.
|
|
41
|
-
const remainingTimeoutMillis = deadline - Date.now();
|
|
42
|
-
if (retryInMillis > remainingTimeoutMillis) {
|
|
43
|
-
diag.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`);
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);
|
|
47
|
-
result = await this.retry(data, remainingTimeoutMillis, retryInMillis);
|
|
48
|
-
}
|
|
49
|
-
if (result.status === 'success') {
|
|
50
|
-
diag.verbose(`Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`);
|
|
51
|
-
}
|
|
52
|
-
else if (result.status === 'retryable') {
|
|
53
|
-
diag.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
diag.info(`Export failed with non-retryable error: ${result.error}`);
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
shutdown() {
|
|
61
|
-
return this._transport.shutdown();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Creates an Exporter Transport that retries on 'retryable' response.
|
|
66
|
-
*/
|
|
67
|
-
export function createRetryingTransport(options) {
|
|
68
|
-
return new RetryingTransport(options.transport);
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=retrying-transport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retrying-transport.js","sourceRoot":"","sources":["../../src/retrying-transport.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IExporterTransport } from './exporter-transport';\nimport type { ExportResponse } from './export-response';\nimport { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"]}
|