@opentelemetry/otlp-exporter-base 0.300.0-development.1 → 0.300.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/README.md +1 -1
- package/dist/configuration/{legacy-node-configuration.cjs → compression.cjs} +2 -2
- package/dist/configuration/compression.cjs.map +1 -0
- package/dist/configuration/compression.d.cts +8 -0
- package/dist/configuration/compression.d.cts.map +1 -0
- package/dist/configuration/compression.d.mts +8 -0
- package/dist/configuration/compression.d.mts.map +1 -0
- package/dist/configuration/{legacy-node-configuration.mjs → compression.mjs} +2 -2
- package/dist/configuration/compression.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/otlp-export-delegate.d.cts +1 -1
- package/dist/otlp-network-export-delegate.d.cts +1 -1
- package/dist/otlp-network-export-delegate.d.mts +1 -1
- package/dist/{configuration → platform/browser/configuration}/convert-legacy-browser-http-options.cjs +3 -3
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.cjs.map +1 -0
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.cts +14 -0
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.cts.map +1 -0
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.mts +14 -0
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.mts.map +1 -0
- package/dist/{configuration → platform/browser/configuration}/convert-legacy-browser-http-options.mjs +3 -3
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.mjs.map +1 -0
- package/dist/{configuration → platform/browser/configuration}/create-legacy-browser-delegate.cjs +3 -3
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.cjs.map +1 -0
- package/dist/{configuration → platform/browser/configuration}/create-legacy-browser-delegate.d.cts +4 -4
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.cts.map +1 -0
- package/dist/{configuration → platform/browser/configuration}/create-legacy-browser-delegate.d.mts +4 -4
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.mts.map +1 -0
- package/dist/{configuration → platform/browser/configuration}/create-legacy-browser-delegate.mjs +3 -3
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.mjs.map +1 -0
- package/dist/{otlp-browser-http-export-delegate.cjs → platform/browser/otlp-browser-http-export-delegate.cjs} +3 -3
- package/dist/platform/browser/otlp-browser-http-export-delegate.cjs.map +1 -0
- package/dist/{otlp-browser-http-export-delegate.d.cts → platform/browser/otlp-browser-http-export-delegate.d.cts} +4 -4
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.cts.map +1 -0
- package/dist/{otlp-browser-http-export-delegate.d.mts → platform/browser/otlp-browser-http-export-delegate.d.mts} +4 -4
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.mts.map +1 -0
- package/dist/{otlp-browser-http-export-delegate.mjs → platform/browser/otlp-browser-http-export-delegate.mjs} +3 -3
- package/dist/platform/browser/otlp-browser-http-export-delegate.mjs.map +1 -0
- package/dist/{transport → platform/browser/transport}/fetch-transport.cjs +3 -3
- package/dist/platform/browser/transport/fetch-transport.cjs.map +1 -0
- package/dist/{transport → platform/browser/transport}/fetch-transport.mjs +3 -3
- package/dist/platform/browser/transport/fetch-transport.mjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/convert-legacy-node-http-options.cjs +2 -2
- package/dist/platform/node/configuration/convert-legacy-node-http-options.cjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/convert-legacy-node-http-options.d.cts +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.cts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/convert-legacy-node-http-options.d.mts +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.mts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/convert-legacy-node-http-options.mjs +2 -2
- package/dist/platform/node/configuration/convert-legacy-node-http-options.mjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/legacy-node-configuration.d.cts +4 -7
- package/dist/platform/node/configuration/legacy-node-configuration.d.cts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/legacy-node-configuration.d.mts +4 -7
- package/dist/platform/node/configuration/legacy-node-configuration.d.mts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-configuration.cjs +2 -2
- package/dist/platform/node/configuration/otlp-node-http-configuration.cjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-configuration.d.cts +2 -2
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.cts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-configuration.d.mts +2 -2
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.mts.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-configuration.mjs +2 -2
- package/dist/platform/node/configuration/otlp-node-http-configuration.mjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-env-configuration.cjs +4 -4
- package/dist/platform/node/configuration/otlp-node-http-env-configuration.cjs.map +1 -0
- package/dist/{configuration → platform/node/configuration}/otlp-node-http-env-configuration.mjs +3 -3
- package/dist/platform/node/configuration/otlp-node-http-env-configuration.mjs.map +1 -0
- package/dist/{index-node-http.cjs → platform/node/index.cjs} +1 -1
- package/dist/platform/node/index.d.cts +6 -0
- package/dist/platform/node/index.d.mts +6 -0
- package/dist/{index-node-http.mjs → platform/node/index.mjs} +1 -1
- package/dist/{otlp-http-export-delegate.cjs → platform/node/otlp-http-export-delegate.cjs} +7 -7
- package/dist/platform/node/otlp-http-export-delegate.cjs.map +1 -0
- package/dist/{otlp-http-export-delegate.d.cts → platform/node/otlp-http-export-delegate.d.cts} +3 -3
- package/dist/platform/node/otlp-http-export-delegate.d.cts.map +1 -0
- package/dist/{otlp-http-export-delegate.d.mts → platform/node/otlp-http-export-delegate.d.mts} +3 -3
- package/dist/platform/node/otlp-http-export-delegate.d.mts.map +1 -0
- package/dist/{otlp-http-export-delegate.mjs → platform/node/otlp-http-export-delegate.mjs} +7 -7
- package/dist/platform/node/otlp-http-export-delegate.mjs.map +1 -0
- package/dist/{transport → platform/node/transport}/http-exporter-transport.cjs +1 -1
- package/dist/platform/node/transport/http-exporter-transport.cjs.map +1 -0
- package/dist/{transport → platform/node/transport}/http-exporter-transport.mjs +1 -1
- package/dist/platform/node/transport/http-exporter-transport.mjs.map +1 -0
- package/dist/{transport → platform/node/transport}/http-transport-utils.cjs +5 -5
- package/dist/platform/node/transport/http-transport-utils.cjs.map +1 -0
- package/dist/{transport → platform/node/transport}/http-transport-utils.mjs +4 -4
- package/dist/platform/node/transport/http-transport-utils.mjs.map +1 -0
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +26 -16
- package/dist/configuration/convert-legacy-browser-http-options.cjs.map +0 -1
- package/dist/configuration/convert-legacy-browser-http-options.d.cts +0 -14
- package/dist/configuration/convert-legacy-browser-http-options.d.cts.map +0 -1
- package/dist/configuration/convert-legacy-browser-http-options.d.mts +0 -14
- package/dist/configuration/convert-legacy-browser-http-options.d.mts.map +0 -1
- package/dist/configuration/convert-legacy-browser-http-options.mjs.map +0 -1
- package/dist/configuration/convert-legacy-node-http-options.cjs.map +0 -1
- package/dist/configuration/convert-legacy-node-http-options.d.cts.map +0 -1
- package/dist/configuration/convert-legacy-node-http-options.d.mts.map +0 -1
- package/dist/configuration/convert-legacy-node-http-options.mjs.map +0 -1
- package/dist/configuration/create-legacy-browser-delegate.cjs.map +0 -1
- package/dist/configuration/create-legacy-browser-delegate.d.cts.map +0 -1
- package/dist/configuration/create-legacy-browser-delegate.d.mts.map +0 -1
- package/dist/configuration/create-legacy-browser-delegate.mjs.map +0 -1
- package/dist/configuration/legacy-node-configuration.cjs.map +0 -1
- package/dist/configuration/legacy-node-configuration.d.cts.map +0 -1
- package/dist/configuration/legacy-node-configuration.d.mts.map +0 -1
- package/dist/configuration/legacy-node-configuration.mjs.map +0 -1
- package/dist/configuration/otlp-node-http-configuration.cjs.map +0 -1
- package/dist/configuration/otlp-node-http-configuration.d.cts.map +0 -1
- package/dist/configuration/otlp-node-http-configuration.d.mts.map +0 -1
- package/dist/configuration/otlp-node-http-configuration.mjs.map +0 -1
- package/dist/configuration/otlp-node-http-env-configuration.cjs.map +0 -1
- package/dist/configuration/otlp-node-http-env-configuration.mjs.map +0 -1
- package/dist/index-node-http.d.cts +0 -5
- package/dist/index-node-http.d.mts +0 -5
- package/dist/otlp-browser-http-export-delegate.cjs.map +0 -1
- package/dist/otlp-browser-http-export-delegate.d.cts.map +0 -1
- package/dist/otlp-browser-http-export-delegate.d.mts.map +0 -1
- package/dist/otlp-browser-http-export-delegate.mjs.map +0 -1
- package/dist/otlp-http-export-delegate.cjs.map +0 -1
- package/dist/otlp-http-export-delegate.d.cts.map +0 -1
- package/dist/otlp-http-export-delegate.d.mts.map +0 -1
- package/dist/otlp-http-export-delegate.mjs.map +0 -1
- package/dist/transport/fetch-transport.cjs.map +0 -1
- package/dist/transport/fetch-transport.mjs.map +0 -1
- package/dist/transport/http-exporter-transport.cjs.map +0 -1
- package/dist/transport/http-exporter-transport.mjs.map +0 -1
- package/dist/transport/http-transport-utils.cjs.map +0 -1
- package/dist/transport/http-transport-utils.mjs.map +0 -1
- /package/dist/{index-browser-http.cjs → platform/browser/index.cjs} +0 -0
- /package/dist/{index-browser-http.d.cts → platform/browser/index.d.cts} +0 -0
- /package/dist/{index-browser-http.d.mts → platform/browser/index.d.mts} +0 -0
- /package/dist/{index-browser-http.mjs → platform/browser/index.mjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-browser-http-options.cjs","names":["mergeOtlpHttpConfigurationWithDefaults","convertLegacyHeaders","getHttpConfigurationDefaults"],"sources":["../../src/configuration/convert-legacy-browser-http-options.ts"],"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';\nimport type { OTLPExporterNodeConfigBase } from './legacy-node-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n\n/**\n * @deprecated this will be removed in 2.0\n *\n * @param config\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyBrowserHttpOptions(\n config: OTLPExporterNodeConfigBase,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): OtlpHttpConfiguration {\n return mergeOtlpHttpConfigurationWithDefaults(\n {\n url: config.url,\n timeoutMillis: config.timeoutMillis,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n },\n {}, // no fallback for browser case\n getHttpConfigurationDefaults(requiredHeaders, signalResourcePath)\n );\n}\n"],"mappings":";;;;;;;;;;AAmBA,SAAgB,gCACd,QACA,oBACA,iBACuB;CACvB,OAAOA,gCAAAA,uCACL;EACE,KAAK,OAAO;EACZ,eAAe,OAAO;EACtB,SAASC,oCAAAA,qBAAqB,MAAM;EACpC,kBAAkB,OAAO;CAC3B,GACA,CAAC,GACDC,gCAAAA,6BAA6B,iBAAiB,kBAAkB,CAClE;AACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OtlpHttpConfiguration } from "./otlp-http-configuration.cjs";
|
|
2
|
-
import { OTLPExporterNodeConfigBase } from "./legacy-node-configuration.cjs";
|
|
3
|
-
//#region src/configuration/convert-legacy-browser-http-options.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated this will be removed in 2.0
|
|
6
|
-
*
|
|
7
|
-
* @param config
|
|
8
|
-
* @param signalResourcePath
|
|
9
|
-
* @param requiredHeaders
|
|
10
|
-
*/
|
|
11
|
-
declare function convertLegacyBrowserHttpOptions(config: OTLPExporterNodeConfigBase, signalResourcePath: string, requiredHeaders: Record<string, string>): OtlpHttpConfiguration;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { convertLegacyBrowserHttpOptions };
|
|
14
|
-
//# sourceMappingURL=convert-legacy-browser-http-options.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-browser-http-options.d.cts","names":[],"sources":["../../src/configuration/convert-legacy-browser-http-options.d.ts"],"mappings":";;;;;;;;;;iBASwB,gCAAgC,QAAQ,4BAA4B,4BAA4B,iBAAiB,yBAAyB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OtlpHttpConfiguration } from "./otlp-http-configuration.mjs";
|
|
2
|
-
import { OTLPExporterNodeConfigBase } from "./legacy-node-configuration.mjs";
|
|
3
|
-
//#region src/configuration/convert-legacy-browser-http-options.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated this will be removed in 2.0
|
|
6
|
-
*
|
|
7
|
-
* @param config
|
|
8
|
-
* @param signalResourcePath
|
|
9
|
-
* @param requiredHeaders
|
|
10
|
-
*/
|
|
11
|
-
declare function convertLegacyBrowserHttpOptions(config: OTLPExporterNodeConfigBase, signalResourcePath: string, requiredHeaders: Record<string, string>): OtlpHttpConfiguration;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { convertLegacyBrowserHttpOptions };
|
|
14
|
-
//# sourceMappingURL=convert-legacy-browser-http-options.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-browser-http-options.d.mts","names":[],"sources":["../../src/configuration/convert-legacy-browser-http-options.d.ts"],"mappings":";;;;;;;;;;iBASwB,gCAAgC,QAAQ,4BAA4B,4BAA4B,iBAAiB,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-browser-http-options.mjs","names":[],"sources":["../../src/configuration/convert-legacy-browser-http-options.ts"],"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';\nimport type { OTLPExporterNodeConfigBase } from './legacy-node-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n\n/**\n * @deprecated this will be removed in 2.0\n *\n * @param config\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyBrowserHttpOptions(\n config: OTLPExporterNodeConfigBase,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): OtlpHttpConfiguration {\n return mergeOtlpHttpConfigurationWithDefaults(\n {\n url: config.url,\n timeoutMillis: config.timeoutMillis,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n },\n {}, // no fallback for browser case\n getHttpConfigurationDefaults(requiredHeaders, signalResourcePath)\n );\n}\n"],"mappings":";;;;;;;;;;AAmBA,SAAgB,gCACd,QACA,oBACA,iBACuB;CACvB,OAAO,uCACL;EACE,KAAK,OAAO;EACZ,eAAe,OAAO;EACtB,SAAS,qBAAqB,MAAM;EACpC,kBAAkB,OAAO;CAC3B,GACA,CAAC,GACD,6BAA6B,iBAAiB,kBAAkB,CAClE;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-node-http-options.cjs","names":["httpAgentFactoryFromOptions","mergeOtlpNodeHttpConfigurationWithDefaults","convertLegacyHeaders","getNodeHttpConfigurationFromEnvironment","getNodeHttpConfigurationDefaults"],"sources":["../../src/configuration/convert-legacy-node-http-options.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OTLPExporterNodeConfigBase } from './legacy-node-configuration';\nimport { diag } from '@opentelemetry/api';\nimport type {\n HttpAgentFactory,\n OtlpNodeHttpConfiguration,\n} from './otlp-node-http-configuration';\nimport {\n getNodeHttpConfigurationDefaults,\n mergeOtlpNodeHttpConfigurationWithDefaults,\n} from './otlp-node-http-configuration';\nimport { httpAgentFactoryFromOptions } from '../index-node-http';\nimport { getNodeHttpConfigurationFromEnvironment } from './otlp-node-http-env-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n\nfunction convertLegacyAgentOptions(\n config: OTLPExporterNodeConfigBase\n): HttpAgentFactory | undefined {\n if (typeof config.httpAgentOptions === 'function') {\n return config.httpAgentOptions;\n }\n\n let legacy = config.httpAgentOptions;\n if (config.keepAlive != null) {\n legacy = { keepAlive: config.keepAlive, ...legacy };\n }\n\n if (legacy != null) {\n return httpAgentFactoryFromOptions(legacy);\n } else {\n return undefined;\n }\n}\n\n/**\n * @deprecated this will be removed in 2.0\n * @param config\n * @param signalIdentifier\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyHttpOptions(\n config: OTLPExporterNodeConfigBase,\n signalIdentifier: string,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): OtlpNodeHttpConfiguration {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((config as any).metadata) {\n diag.warn('Metadata cannot be set when using http');\n }\n\n return mergeOtlpNodeHttpConfigurationWithDefaults(\n {\n url: config.url,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n timeoutMillis: config.timeoutMillis,\n compression: config.compression,\n agentFactory: convertLegacyAgentOptions(config),\n userAgent: config.userAgent,\n },\n getNodeHttpConfigurationFromEnvironment(\n signalIdentifier,\n signalResourcePath\n ),\n getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)\n );\n}\n"],"mappings":";;;;;AAkBA,SAAS,0BACP,QAC8B;CAC9B,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,OAAO;CAGhB,IAAI,SAAS,OAAO;CACpB,IAAI,OAAO,aAAa,MACtB,SAAS;EAAE,WAAW,OAAO;EAAW,GAAG;CAAO;CAGpD,IAAI,UAAU,MACZ,OAAOA,qCAAAA,4BAA4B,MAAM;MAEzC;AAEJ;;;;;;;;AASA,SAAgB,yBACd,QACA,kBACA,oBACA,iBAC2B;CAE3B,IAAK,OAAe,UAClB,mBAAA,KAAK,KAAK,wCAAwC;CAGpD,OAAOC,qCAAAA,2CACL;EACE,KAAK,OAAO;EACZ,SAASC,oCAAAA,qBAAqB,MAAM;EACpC,kBAAkB,OAAO;EACzB,eAAe,OAAO;EACtB,aAAa,OAAO;EACpB,cAAc,0BAA0B,MAAM;EAC9C,WAAW,OAAO;CACpB,GACAC,yCAAAA,wCACE,kBACA,kBACF,GACAC,qCAAAA,iCAAiC,iBAAiB,kBAAkB,CACtE;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-node-http-options.d.cts","names":[],"sources":["../../src/configuration/convert-legacy-node-http-options.d.ts"],"mappings":";;;;;;;;;;iBASwB,yBAAyB,QAAQ,4BAA4B,0BAA0B,4BAA4B,iBAAiB,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-node-http-options.d.mts","names":[],"sources":["../../src/configuration/convert-legacy-node-http-options.d.ts"],"mappings":";;;;;;;;;;iBASwB,yBAAyB,QAAQ,4BAA4B,0BAA0B,4BAA4B,iBAAiB,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-legacy-node-http-options.mjs","names":[],"sources":["../../src/configuration/convert-legacy-node-http-options.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OTLPExporterNodeConfigBase } from './legacy-node-configuration';\nimport { diag } from '@opentelemetry/api';\nimport type {\n HttpAgentFactory,\n OtlpNodeHttpConfiguration,\n} from './otlp-node-http-configuration';\nimport {\n getNodeHttpConfigurationDefaults,\n mergeOtlpNodeHttpConfigurationWithDefaults,\n} from './otlp-node-http-configuration';\nimport { httpAgentFactoryFromOptions } from '../index-node-http';\nimport { getNodeHttpConfigurationFromEnvironment } from './otlp-node-http-env-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n\nfunction convertLegacyAgentOptions(\n config: OTLPExporterNodeConfigBase\n): HttpAgentFactory | undefined {\n if (typeof config.httpAgentOptions === 'function') {\n return config.httpAgentOptions;\n }\n\n let legacy = config.httpAgentOptions;\n if (config.keepAlive != null) {\n legacy = { keepAlive: config.keepAlive, ...legacy };\n }\n\n if (legacy != null) {\n return httpAgentFactoryFromOptions(legacy);\n } else {\n return undefined;\n }\n}\n\n/**\n * @deprecated this will be removed in 2.0\n * @param config\n * @param signalIdentifier\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyHttpOptions(\n config: OTLPExporterNodeConfigBase,\n signalIdentifier: string,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): OtlpNodeHttpConfiguration {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((config as any).metadata) {\n diag.warn('Metadata cannot be set when using http');\n }\n\n return mergeOtlpNodeHttpConfigurationWithDefaults(\n {\n url: config.url,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n timeoutMillis: config.timeoutMillis,\n compression: config.compression,\n agentFactory: convertLegacyAgentOptions(config),\n userAgent: config.userAgent,\n },\n getNodeHttpConfigurationFromEnvironment(\n signalIdentifier,\n signalResourcePath\n ),\n getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)\n );\n}\n"],"mappings":";;;;;AAkBA,SAAS,0BACP,QAC8B;CAC9B,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,OAAO;CAGhB,IAAI,SAAS,OAAO;CACpB,IAAI,OAAO,aAAa,MACtB,SAAS;EAAE,WAAW,OAAO;EAAW,GAAG;CAAO;CAGpD,IAAI,UAAU,MACZ,OAAO,4BAA4B,MAAM;MAEzC;AAEJ;;;;;;;;AASA,SAAgB,yBACd,QACA,kBACA,oBACA,iBAC2B;CAE3B,IAAK,OAAe,UAClB,KAAK,KAAK,wCAAwC;CAGpD,OAAO,2CACL;EACE,KAAK,OAAO;EACZ,SAAS,qBAAqB,MAAM;EACpC,kBAAkB,OAAO;EACzB,eAAe,OAAO;EACtB,aAAa,OAAO;EACpB,cAAc,0BAA0B,MAAM;EAC9C,WAAW,OAAO;CACpB,GACA,wCACE,kBACA,kBACF,GACA,iCAAiC,iBAAiB,kBAAkB,CACtE;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-browser-delegate.cjs","names":["ExporterMetrics","ATTR_HTTP_RESPONSE_STATUS_CODE","convertLegacyBrowserHttpOptions","createOtlpFetchExportDelegate"],"sources":["../../src/configuration/create-legacy-browser-delegate.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '@opentelemetry/api';\nimport type {\n IExporterMetricsHelper,\n ISerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { createOtlpFetchExportDelegate } from '../otlp-browser-http-export-delegate';\nimport { convertLegacyBrowserHttpOptions } from './convert-legacy-browser-http-options';\nimport type { IOtlpExportDelegate } from '../otlp-export-delegate';\nimport type { OTLPExporterConfigBase } from './legacy-base-configuration';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from '../semconv';\nimport { ExporterMetrics } from '../ExporterMetrics';\n\n/**\n * @deprecated\n */\nexport function createLegacyOtlpBrowserExporterMetrics<Internal>(\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n url: string | undefined,\n meterProvider: MeterProvider | undefined\n): ExporterMetrics<Internal> {\n return new ExporterMetrics({\n componentType: metricsComponentType,\n metricsHelper: exporterMetricsHelper,\n url,\n meterProvider,\n responseAttributesFromError: (error: Error | string | undefined) => {\n if (!error) {\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,\n };\n }\n if (!(error instanceof Error)) {\n return {};\n }\n if (\n error.message.startsWith(\n 'Fetch request failed with non-retryable status '\n )\n ) {\n const statusStr = error.message.substring(\n 'Fetch request failed with non-retryable status '.length\n );\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: Number(statusStr),\n };\n }\n return {};\n },\n });\n}\n\n/**\n * @deprecated\n * @param config\n * @param serializer\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function createLegacyOtlpBrowserExportDelegate<Internal, Response>(\n config: OTLPExporterConfigBase,\n serializer: ISerializer<Internal, Response>,\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n meterProvider: MeterProvider | undefined,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): IOtlpExportDelegate<Internal> {\n const options = convertLegacyBrowserHttpOptions(\n config,\n signalResourcePath,\n requiredHeaders\n );\n\n return createOtlpFetchExportDelegate(\n options,\n serializer,\n createLegacyOtlpBrowserExporterMetrics(\n metricsComponentType,\n exporterMetricsHelper,\n options.url,\n config.selfObsMeterProvider\n )\n );\n}\n"],"mappings":";;;;;;;;AAoBA,SAAgB,uCACd,sBACA,uBACA,KACA,eAC2B;CAC3B,OAAO,IAAIA,wBAAAA,gBAAgB;EACzB,eAAe;EACf,eAAe;EACf;EACA;EACA,8BAA8B,UAAsC;GAClE,IAAI,CAAC,OACH,OAAO,GACJC,gBAAAA,iCAAiC,IACpC;GAEF,IAAI,EAAE,iBAAiB,QACrB,OAAO,CAAC;GAEV,IACE,MAAM,QAAQ,WACZ,iDACF,GACA;IACA,MAAM,YAAY,MAAM,QAAQ,UAC9B,EACF;IACA,OAAO,GACJA,gBAAAA,iCAAiC,OAAO,SAAS,EACpD;GACF;GACA,OAAO,CAAC;EACV;CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,sCACd,QACA,YACA,sBACA,uBACA,eACA,oBACA,iBAC+B;CAC/B,MAAM,UAAUC,4CAAAA,gCACd,QACA,oBACA,eACF;CAEA,OAAOC,0CAAAA,8BACL,SACA,YACA,uCACE,sBACA,uBACA,QAAQ,KACR,OAAO,oBACT,CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-browser-delegate.d.cts","names":[],"sources":["../../src/configuration/create-legacy-browser-delegate.d.ts"],"mappings":";;;;;;;;;iBAQwB,uCAAuC,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;;;;;;;;iBAQ5N,sCAAsC,UAAU,UAAU,QAAQ,wBAAwB,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,2BAA2B,4BAA4B,iBAAiB,yBAAyB,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-browser-delegate.d.mts","names":[],"sources":["../../src/configuration/create-legacy-browser-delegate.d.ts"],"mappings":";;;;;;;;;iBAQwB,uCAAuC,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;;;;;;;;iBAQ5N,sCAAsC,UAAU,UAAU,QAAQ,wBAAwB,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,2BAA2B,4BAA4B,iBAAiB,yBAAyB,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-browser-delegate.mjs","names":[],"sources":["../../src/configuration/create-legacy-browser-delegate.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '@opentelemetry/api';\nimport type {\n IExporterMetricsHelper,\n ISerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { createOtlpFetchExportDelegate } from '../otlp-browser-http-export-delegate';\nimport { convertLegacyBrowserHttpOptions } from './convert-legacy-browser-http-options';\nimport type { IOtlpExportDelegate } from '../otlp-export-delegate';\nimport type { OTLPExporterConfigBase } from './legacy-base-configuration';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from '../semconv';\nimport { ExporterMetrics } from '../ExporterMetrics';\n\n/**\n * @deprecated\n */\nexport function createLegacyOtlpBrowserExporterMetrics<Internal>(\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n url: string | undefined,\n meterProvider: MeterProvider | undefined\n): ExporterMetrics<Internal> {\n return new ExporterMetrics({\n componentType: metricsComponentType,\n metricsHelper: exporterMetricsHelper,\n url,\n meterProvider,\n responseAttributesFromError: (error: Error | string | undefined) => {\n if (!error) {\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,\n };\n }\n if (!(error instanceof Error)) {\n return {};\n }\n if (\n error.message.startsWith(\n 'Fetch request failed with non-retryable status '\n )\n ) {\n const statusStr = error.message.substring(\n 'Fetch request failed with non-retryable status '.length\n );\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: Number(statusStr),\n };\n }\n return {};\n },\n });\n}\n\n/**\n * @deprecated\n * @param config\n * @param serializer\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function createLegacyOtlpBrowserExportDelegate<Internal, Response>(\n config: OTLPExporterConfigBase,\n serializer: ISerializer<Internal, Response>,\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n meterProvider: MeterProvider | undefined,\n signalResourcePath: string,\n requiredHeaders: Record<string, string>\n): IOtlpExportDelegate<Internal> {\n const options = convertLegacyBrowserHttpOptions(\n config,\n signalResourcePath,\n requiredHeaders\n );\n\n return createOtlpFetchExportDelegate(\n options,\n serializer,\n createLegacyOtlpBrowserExporterMetrics(\n metricsComponentType,\n exporterMetricsHelper,\n options.url,\n config.selfObsMeterProvider\n )\n );\n}\n"],"mappings":";;;;;;;;AAoBA,SAAgB,uCACd,sBACA,uBACA,KACA,eAC2B;CAC3B,OAAO,IAAI,gBAAgB;EACzB,eAAe;EACf,eAAe;EACf;EACA;EACA,8BAA8B,UAAsC;GAClE,IAAI,CAAC,OACH,OAAO,GACJ,iCAAiC,IACpC;GAEF,IAAI,EAAE,iBAAiB,QACrB,OAAO,CAAC;GAEV,IACE,MAAM,QAAQ,WACZ,iDACF,GACA;IACA,MAAM,YAAY,MAAM,QAAQ,UAC9B,EACF;IACA,OAAO,GACJ,iCAAiC,OAAO,SAAS,EACpD;GACF;GACA,OAAO,CAAC;EACV;CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,sCACd,QACA,YACA,sBACA,uBACA,eACA,oBACA,iBAC+B;CAC/B,MAAM,UAAU,gCACd,QACA,oBACA,eACF;CAEA,OAAO,8BACL,SACA,YACA,uCACE,sBACA,uBACA,QAAQ,KACR,OAAO,oBACT,CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-node-configuration.cjs","names":[],"sources":["../../src/configuration/legacy-node-configuration.ts"],"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"],"mappings":";AA+DA,IAAY,uBAAL,yBAAA,sBAAA;CACL,qBAAA,UAAA;CACA,qBAAA,UAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-node-configuration.d.cts","names":[],"sources":["../../src/configuration/legacy-node-configuration.d.ts"],"mappings":";;;;;;;;;UASiB,mCAAmC;;;;;;;;;;EAUhD;;;;;;EAMA,cAAc;;;;;;;;;;;;;;;;;;;;;;;EAuBd,mBAAmB,KAAK,eAAe,MAAM,eAAe;;;;;;EAM5D;;aAEgB;EAChB;EACA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-node-configuration.d.mts","names":[],"sources":["../../src/configuration/legacy-node-configuration.d.ts"],"mappings":";;;;;;;;;UASiB,mCAAmC;;;;;;;;;;EAUhD;;;;;;EAMA,cAAc;;;;;;;;;;;;;;;;;;;;;;;EAuBd,mBAAmB,KAAK,eAAe,MAAM,eAAe;;;;;;EAM5D;;aAEgB;EAChB;EACA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-node-configuration.mjs","names":[],"sources":["../../src/configuration/legacy-node-configuration.ts"],"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"],"mappings":";AA+DA,IAAY,uBAAL,yBAAA,sBAAA;CACL,qBAAA,UAAA;CACA,qBAAA,UAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.cjs","names":["mergeOtlpHttpConfigurationWithDefaults","getHttpConfigurationDefaults"],"sources":["../../src/configuration/otlp-node-http-configuration.ts"],"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"],"mappings":";;AAsCA,SAAgB,4BACd,SACkB;CAClB,OAAO,OAAM,aAAY;EACvB,MAAM,aAAa,aAAa;EAEhC,MAAM,EAAE,UAAU,OADH,aAAa,OAAO,UAAU,OAAO;EAGpD,IAAI,YAAY;GAEd,MAAM,EAAE,IAAI,MAAM,KAAK,GAAG,oBACxB;GACF,OAAO,IAAI,MAAM,eAAe;EAClC;EACA,OAAO,IAAI,MAAM,OAAO;CAC1B;AACF;;;;;;AAOA,SAAgB,2CACd,2BACA,uBACA,sBAC2B;CAC3B,OAAO;EACL,GAAGA,gCAAAA,uCACD,2BACA,uBACA,oBACF;EACA,cACE,0BAA0B,gBAC1B,sBAAsB,gBACtB,qBAAqB;EACvB,WAAW,0BAA0B;CACvC;AACF;AAEA,SAAgB,iCACd,iBACA,oBAC2B;CAC3B,OAAO;EACL,GAAGC,gCAAAA,6BAA6B,iBAAiB,kBAAkB;EACnE,cAAc,4BAA4B,EAAE,WAAW,KAAK,CAAC;CAC/D;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.d.cts","names":[],"sources":["../../src/configuration/otlp-node-http-configuration.d.ts"],"mappings":";;;;;KAKY,oBAAoB,qBAAqB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,KAAK,SAAS,QAAQ,MAAM;UACnG,kCAAkC;;;;;;;;;;;EAW/C,cAAc;;;;;;EAMd;;iBAEoB,4BAA4B,SAAS,KAAK,eAAe,MAAM,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.d.mts","names":[],"sources":["../../src/configuration/otlp-node-http-configuration.d.ts"],"mappings":";;;;;KAKY,oBAAoB,qBAAqB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,KAAK,SAAS,QAAQ,MAAM;UACnG,kCAAkC;;;;;;;;;;;EAW/C,cAAc;;;;;;EAMd;;iBAEoB,4BAA4B,SAAS,KAAK,eAAe,MAAM,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.mjs","names":[],"sources":["../../src/configuration/otlp-node-http-configuration.ts"],"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"],"mappings":";;AAsCA,SAAgB,4BACd,SACkB;CAClB,OAAO,OAAM,aAAY;EACvB,MAAM,aAAa,aAAa;EAEhC,MAAM,EAAE,UAAU,OADH,aAAa,OAAO,UAAU,OAAO;EAGpD,IAAI,YAAY;GAEd,MAAM,EAAE,IAAI,MAAM,KAAK,GAAG,oBACxB;GACF,OAAO,IAAI,MAAM,eAAe;EAClC;EACA,OAAO,IAAI,MAAM,OAAO;CAC1B;AACF;;;;;;AAOA,SAAgB,2CACd,2BACA,uBACA,sBAC2B;CAC3B,OAAO;EACL,GAAG,uCACD,2BACA,uBACA,oBACF;EACA,cACE,0BAA0B,gBAC1B,sBAAsB,gBACtB,qBAAqB;EACvB,WAAW,0BAA0B;CACvC;AACF;AAEA,SAAgB,iCACd,iBACA,oBAC2B;CAC3B,OAAO;EACL,GAAG,6BAA6B,iBAAiB,kBAAkB;EACnE,cAAc,4BAA4B,EAAE,WAAW,KAAK,CAAC;CAC/D;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-env-configuration.cjs","names":["getStringFromEnv","parseKeyPairsIntoRecord","path","getSharedConfigurationFromEnvironment","wrapStaticHeadersInFunction","httpAgentFactoryFromOptions"],"sources":["../../src/configuration/otlp-node-http-env-configuration.ts"],"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"],"mappings":";;;;;;;;;;;AAaA,SAAS,wBACP,kBACoC;CACpC,MAAM,4BAAA,GAA2BA,oBAAAA,iBAAAA,CAC/B,sBAAsB,iBAAiB,SACzC;CACA,MAAM,+BAAA,GAA8BA,oBAAAA,iBAAAA,CAClC,4BACF;CAEA,MAAM,yBAAA,GAAwBC,oBAAAA,wBAAAA,CAC5B,wBACF;CACA,MAAM,4BAAA,GAA2BA,oBAAAA,wBAAAA,CAC/B,2BACF;CAEA,IACE,OAAO,KAAK,qBAAqB,CAAC,CAAC,WAAW,KAC9C,OAAO,KAAK,wBAAwB,CAAC,CAAC,WAAW,GAEjD;CAKF,OAAO,OAAO,OACZ,CAAC,IAAA,GACDA,oBAAAA,wBAAAA,CAAwB,2BAA2B,IAAA,GACnDA,oBAAAA,wBAAAA,CAAwB,wBAAwB,CAClD;AACF;AAEA,SAAS,4BAA4B,KAAiC;CACpE,IAAI;EAGF,OAAO,IAFe,IAAI,GAEX,CAAC,CAAC,SAAS;CAC5B,QAAQ;EACN,mBAAA,KAAK,KACH,oEAAoE,IAAI,6BAC1E;EACA;CACF;AACF;AAEA,SAAS,wBACP,KACA,QACoB;CACpB,IAAI;EAEF,IAAI,IAAI,GAAG;CACb,QAAQ;EACN,mBAAA,KAAK,KACH,oEAAoE,IAAI,6BAC1E;EACA;CACF;CAEA,IAAI,CAAC,IAAI,SAAS,GAAG,GACnB,MAAM,MAAM;CAEd,OAAOC;CAEP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B,CAC1C;EACA,cAAcC,qCAAAA,4BAA4B;GACxC,WAAW;GACX,IAAI,0BAA0B,gBAAgB;GAC9C,MAAM,4BAA4B,gBAAgB;GAClD,KAAK,oBAAoB,gBAAgB;EAC3C,CAAC;CACH;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-env-configuration.mjs","names":[],"sources":["../../src/configuration/otlp-node-http-env-configuration.ts"],"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"],"mappings":";;;;;;;;AAaA,SAAS,wBACP,kBACoC;CACpC,MAAM,2BAA2B,iBAC/B,sBAAsB,iBAAiB,SACzC;CACA,MAAM,8BAA8B,iBAClC,4BACF;CAEA,MAAM,wBAAwB,wBAC5B,wBACF;CACA,MAAM,2BAA2B,wBAC/B,2BACF;CAEA,IACE,OAAO,KAAK,qBAAqB,CAAC,CAAC,WAAW,KAC9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AiB,sBACvC,yCACA,8CACF;AACF;AAEA,SAAS,oBAAoB,kBAA8C;CACzE,OAAO,gBACL,sBAAsB,iBAAiB,cACvC,iCACA,oDACF;AACF;AAEA,SAAS,0BACP,kBACoB;CACpB,OAAO,gBACL,sBAAsB,iBAAiB,eACvC,kCACA,sCACF;AACF;;;;;;;AAQA,SAAgB,wCACd,kBACA,oBACoC;CACpC,OAAO;EACL,GAAG,sCAAsC,gBAAgB;EACzD,KACE,sBAAsB,gBAAgB,KACtC,yBAAyB,kBAAkB;EAC7C,SAAS,4BACP,wBAAwB,gBAAgB,CAC1C;EACA,cAAc,4BAA4B;GACxC,WAAW;GACX,IAAI,0BAA0B,gBAAgB;GAC9C,MAAM,4BAA4B,gBAAgB;GAClD,KAAK,oBAAoB,gBAAgB;EAC3C,CAAC;CACH;AACF"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { httpAgentFactoryFromOptions } from "./configuration/otlp-node-http-configuration.cjs";
|
|
2
|
-
import { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics } from "./otlp-http-export-delegate.cjs";
|
|
3
|
-
import { getSharedConfigurationFromEnvironment } from "./configuration/shared-env-configuration.cjs";
|
|
4
|
-
import { convertLegacyHttpOptions } from "./configuration/convert-legacy-node-http-options.cjs";
|
|
5
|
-
export { convertLegacyHttpOptions, createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, getSharedConfigurationFromEnvironment, httpAgentFactoryFromOptions };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { httpAgentFactoryFromOptions } from "./configuration/otlp-node-http-configuration.mjs";
|
|
2
|
-
import { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics } from "./otlp-http-export-delegate.mjs";
|
|
3
|
-
import { getSharedConfigurationFromEnvironment } from "./configuration/shared-env-configuration.mjs";
|
|
4
|
-
import { convertLegacyHttpOptions } from "./configuration/convert-legacy-node-http-options.mjs";
|
|
5
|
-
export { convertLegacyHttpOptions, createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, getSharedConfigurationFromEnvironment, httpAgentFactoryFromOptions };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-browser-http-export-delegate.cjs","names":["createOtlpNetworkExportDelegate","createRetryingTransport","createFetchTransport"],"sources":["../src/otlp-browser-http-export-delegate.ts"],"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"],"mappings":";;;;AAaA,SAAgB,8BACd,SACA,YACA,SAC+B;CAC/B,OAAOA,qCAAAA,gCACL,SACA,YACA,SACAC,2BAAAA,wBAAwB,EACtB,WAAWC,wBAAAA,qBAAqB,OAAO,EACzC,CAAC,CACH;AACF;;;;AAKA,SAAgB,mCACd,SACA,YACA,SAC+B;CAC/B,OAAO,8BAA8B,SAAS,YAAY,OAAO;AACnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-browser-http-export-delegate.d.cts","names":[],"sources":["../src/otlp-browser-http-export-delegate.d.ts"],"mappings":";;;;;;;;iBAQwB,mCAAmC,UAAU,UAAU,SAAS,uBAAuB,YAAY,YAAY,UAAU,WAAW,SAAS,gBAAgB,YAAY,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-browser-http-export-delegate.d.mts","names":[],"sources":["../src/otlp-browser-http-export-delegate.d.ts"],"mappings":";;;;;;;;iBAQwB,mCAAmC,UAAU,UAAU,SAAS,uBAAuB,YAAY,YAAY,UAAU,WAAW,SAAS,gBAAgB,YAAY,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-browser-http-export-delegate.mjs","names":[],"sources":["../src/otlp-browser-http-export-delegate.ts"],"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"],"mappings":";;;;AAaA,SAAgB,8BACd,SACA,YACA,SAC+B;CAC/B,OAAO,gCACL,SACA,YACA,SACA,wBAAwB,EACtB,WAAW,qBAAqB,OAAO,EACzC,CAAC,CACH;AACF;;;;AAKA,SAAgB,mCACd,SACA,YACA,SAC+B;CAC/B,OAAO,8BAA8B,SAAS,YAAY,OAAO;AACnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.cjs","names":["ExporterMetrics","ATTR_HTTP_RESPONSE_STATUS_CODE","OTLPExporterError","createOtlpExportDelegate","createRetryingTransport","createHttpExporterTransport","createBoundedQueueExportPromiseHandler"],"sources":["../src/otlp-http-export-delegate.ts"],"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"],"mappings":";;;;;;;;AAqBA,SAAgB,8BACd,sBACA,uBACA,KACA,eAC2B;CAC3B,OAAO,IAAIA,wBAAAA,gBAAgB;EACzB,eAAe;EACf,eAAe;EACf;EACA;EACA,8BAA8B,UAAsC;GAClE,IAAI,CAAC,OACH,OAAO,GACJC,gBAAAA,iCAAiC,IACpC;GAEF,IAAI,EAAE,iBAAiBC,cAAAA,oBACrB,OAAO,CAAC;GAEV,OAAO,GACJD,gBAAAA,iCAAiC,MAAM,KAC1C;EACF;CACF,CAAC;AACH;AAEA,SAAgB,6BACd,SACA,YACA,sBACA,uBACA,eAC+B;CAC/B,OAAOE,6BAAAA,yBACL;EACE,WAAWC,2BAAAA,wBAAwB,EACjC,WAAWC,gCAAAA,4BAA4B,OAAO,EAChD,CAAC;EACW;EACZ,gBAAgBC,6CAAAA,uCAAuC,OAAO;EAC9D,SAAS,8BACP,sBACA,uBACA,QAAQ,KACR,aACF;CACF,GACA,EAAE,SAAS,QAAQ,cAAc,CACnC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.d.cts","names":[],"sources":["../src/otlp-http-export-delegate.d.ts"],"mappings":";;;;;;iBAKwB,8BAA8B,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;iBACnN,6BAA6B,UAAU,UAAU,SAAS,2BAA2B,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,4BAA4B,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.d.mts","names":[],"sources":["../src/otlp-http-export-delegate.d.ts"],"mappings":";;;;;;iBAKwB,8BAA8B,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;iBACnN,6BAA6B,UAAU,UAAU,SAAS,2BAA2B,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,4BAA4B,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.mjs","names":[],"sources":["../src/otlp-http-export-delegate.ts"],"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"],"mappings":";;;;;;;;AAqBA,SAAgB,8BACd,sBACA,uBACA,KACA,eAC2B;CAC3B,OAAO,IAAI,gBAAgB;EACzB,eAAe;EACf,eAAe;EACf;EACA;EACA,8BAA8B,UAAsC;GAClE,IAAI,CAAC,OACH,OAAO,GACJ,iCAAiC,IACpC;GAEF,IAAI,EAAE,iBAAiB,oBACrB,OAAO,CAAC;GAEV,OAAO,GACJ,iCAAiC,MAAM,KAC1C;EACF;CACF,CAAC;AACH;AAEA,SAAgB,6BACd,SACA,YACA,sBACA,uBACA,eAC+B;CAC/B,OAAO,yBACL;EACE,WAAW,wBAAwB,EACjC,WAAW,4BAA4B,OAAO,EAChD,CAAC;EACW;EACZ,gBAAgB,uCAAuC,OAAO;EAC9D,SAAS,8BACP,sBACA,uBACA,QAAQ,KACR,aACF;CACF,GACA,EAAE,SAAS,QAAQ,cAAc,CACnC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-transport.cjs","names":["suppressTracing","context","isExportHTTPErrorRetryable","parseRetryAfterToMills"],"sources":["../../src/transport/fetch-transport.ts"],"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 { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport type { HeadersFactory } from '../configuration/otlp-http-configuration';\n\n/**\n * Maximum total body size for concurrent keepalive requests.\n * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.\n * We use 60KB to leave headroom for headers.\n * @see https://github.com/whatwg/fetch/issues/679\n * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/\n */\nconst MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;\n\n/**\n * Maximum concurrent keepalive requests.\n * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.\n * @see https://github.com/whatwg/fetch/issues/679\n * Quote: \"If the renderer process is processing more than 9 requests with keepalive set, we reject a new request\"\n */\nconst MAX_KEEPALIVE_REQUESTS = 9;\n\n/**\n * Track cumulative body size charged against the keepalive budget.\n * This is necessary because the 64KiB limit is cumulative, not per-request.\n * Charged from request start until the response body drains, which is later\n * than the request completing: that is when the browser gives the quota back.\n */\nlet pendingBodySize = 0;\n\n/**\n * Track number of requests holding keepalive budget, on the same terms as\n * {@link pendingBodySize}.\n */\nlet pendingKeepaliveCount = 0;\n\nexport interface FetchTransportParameters {\n url: string;\n headers: HeadersFactory;\n}\n\nclass FetchTransport implements IExporterTransport {\n private _parameters: FetchTransportParameters;\n\n constructor(parameters: FetchTransportParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const abortController = new AbortController();\n const timeout = setTimeout(() => abortController.abort(), timeoutMillis);\n // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.\n // In that case the instrumentation would create a new Span for this request,\n // creating an indirect endless loop Export -> Span -> Export.\n // `__original` lets the call bypass one wrapper; the suppressed context\n // below covers a `fetch` that was wrapped more than once.\n let fetchApi = globalThis.fetch;\n // @ts-expect-error -- fetch could be wrapped\n if (typeof fetchApi.__original === 'function') {\n // @ts-expect-error -- fetch could be wrapped\n fetchApi = fetchApi.__original;\n }\n\n const requestSize = data.byteLength;\n\n // Determine if we can use keepalive based on cumulative browser limits.\n // We must check BEFORE adding to pending totals to avoid exceeding limits.\n const wouldExceedSize =\n pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;\n const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;\n const useKeepalive = !wouldExceedSize && !wouldExceedCount;\n\n if (useKeepalive) {\n pendingBodySize += requestSize;\n pendingKeepaliveCount++;\n } else {\n const reason = wouldExceedSize ? 'size limit' : 'count limit';\n diag.debug(\n `keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`\n );\n }\n\n // Captured before the first `await`, which a synchronous context manager\n // would not survive.\n const suppressedContext = suppressTracing(context.active());\n\n // Idempotent so that a double call cannot drive the counters negative,\n // which would defeat the cap check above for every later request.\n let released = false;\n const release = () => {\n if (released) {\n return;\n }\n released = true;\n if (useKeepalive) {\n pendingBodySize -= requestSize;\n pendingKeepaliveCount--;\n }\n clearTimeout(timeout);\n };\n let drainOwnsCleanup = false;\n\n try {\n const url = new URL(this._parameters.url);\n // Resolve headers before entering the suppressed fetch context.\n const headers = await this._parameters.headers();\n const response = await context.with(suppressedContext, () =>\n fetchApi(url.href, {\n method: 'POST',\n headers,\n body: data,\n signal: abortController.signal,\n keepalive: useKeepalive,\n mode: globalThis.location\n ? globalThis.location.origin === url.origin\n ? 'same-origin'\n : 'cors'\n : 'no-cors',\n })\n );\n\n // Not awaited: the status already decides the export outcome, and a\n // collector that stalls mid-body must not hold up the caller.\n const drained = drainResponseBody(response);\n // Timer stays armed through the drain: an abort errors the body, so a\n // stalled drain still settles rather than holding the budget forever.\n // Released on rejection too, though the drain swallows its errors today:\n // a missed release would hold the keepalive budget for the page's life.\n void drained.then(release, release);\n // Set before any return, or `finally` frees the budget before it drains.\n drainOwnsCleanup = true;\n\n if (response.status >= 200 && response.status <= 299) {\n diag.debug(`export response success (status: ${response.status})`);\n return { status: 'success' };\n } else if (isExportHTTPErrorRetryable(response.status)) {\n diag.warn(`export response retryable (status: ${response.status})`);\n const retryAfter = response.headers.get('Retry-After');\n const retryInMillis = parseRetryAfterToMills(retryAfter);\n return { status: 'retryable', retryInMillis };\n }\n diag.error(`export response failure (status: ${response.status})`);\n return {\n status: 'failure',\n error: new Error(\n `Fetch request failed with non-retryable status ${response.status}`\n ),\n };\n } catch (error) {\n if (isFetchNetworkErrorRetryable(error)) {\n diag.warn(`export request retryable (network error: ${error})`);\n return {\n status: 'retryable',\n error: new Error('Fetch request encountered a network error', {\n cause: error,\n }),\n };\n }\n diag.error(`export request failure (error: ${error})`);\n return {\n status: 'failure',\n error: new Error('Fetch request errored', { cause: error }),\n };\n } finally {\n // Cleanup here only for a failure before the response arrived; past that\n // point the drain owns it.\n if (!drainOwnsCleanup) {\n release();\n }\n }\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * Creates an exporter transport that uses `fetch` to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createFetchTransport(\n parameters: FetchTransportParameters\n): IExporterTransport {\n return new FetchTransport(parameters);\n}\n\nfunction isFetchNetworkErrorRetryable(error: unknown): boolean {\n return error instanceof TypeError && !error.cause;\n}\n\n/**\n * Reads the response body to its end and discards it.\n *\n * Chromium gives the request's share of the keepalive quota back only once the\n * response body has been read to the end, and it skips the buffering consumer\n * that would otherwise drain the body on its own when the response carries a\n * `Cache-Control: no-store` header, which collectors commonly send. Leaving the\n * body unread then leaks the quota until the document goes away and every\n * following keepalive export stays pending forever. Cancelling the body is the\n * client-abort path and releases the quota far more slowly than reading it to\n * the end, so the body is read rather than cancelled.\n *\n * Never rejects. Its settlement, not its outcome, is what releases the\n * request's keepalive budget, so a caller that ignores it leaks that budget\n * for the life of the document.\n *\n * @see https://fetch.spec.whatwg.org/#fetch-processresponseendofbody\n * @see https://issues.chromium.org/issues/546438373\n */\nasync function drainResponseBody(response: Response): Promise<void> {\n try {\n // Empty and opaque responses have no body to read.\n const body = response.body;\n if (body == null) {\n return;\n }\n\n // Throws when the body is already locked to another reader, which happens\n // when the same response is handed to more than one export.\n const reader = body.getReader();\n try {\n // Chunks are dropped as they arrive: the payload is not used, and\n // buffering it - with `response.arrayBuffer()` for instance - would keep\n // a response of arbitrary size in memory.\n let chunk = await reader.read();\n while (!chunk.done) {\n chunk = await reader.read();\n }\n } finally {\n // The reader keeps the body locked until it is released, which would\n // make a later export handed the same response fail to acquire a reader\n // and skip the drain.\n reader.releaseLock();\n }\n } catch (error) {\n // The export outcome is decided by the response status, a body that cannot\n // be read must not change it.\n diag.debug(`error reading export response body: ${error}`);\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,MAAM,0BAA0B;;;;;;;AAQhC,MAAM,yBAAyB;;;;;;;AAQ/B,IAAI,kBAAkB;;;;;AAMtB,IAAI,wBAAwB;AAO5B,IAAM,iBAAN,MAAmD;CACjD;CAEA,YAAY,YAAsC;EAChD,KAAK,cAAc;CACrB;CAEA,MAAM,KAAK,MAAkB,eAAgD;EAC3E,MAAM,kBAAkB,IAAI,gB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ch-transport.mjs","names":[],"sources":["../../src/transport/fetch-transport.ts"],"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 { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport type { HeadersFactory } from '../configuration/otlp-http-configuration';\n\n/**\n * Maximum total body size for concurrent keepalive requests.\n * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.\n * We use 60KB to leave headroom for headers.\n * @see https://github.com/whatwg/fetch/issues/679\n * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/\n */\nconst MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;\n\n/**\n * Maximum concurrent keepalive requests.\n * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.\n * @see https://github.com/whatwg/fetch/issues/679\n * Quote: \"If the renderer process is processing more than 9 requests with keepalive set, we reject a new request\"\n */\nconst MAX_KEEPALIVE_REQUESTS = 9;\n\n/**\n * Track cumulative body size charged against the keepalive budget.\n * This is necessary because the 64KiB limit is cumulative, not per-request.\n * Charged from request start until the response body drains, which is later\n * than the request completing: that is when the browser gives the quota back.\n */\nlet pendingBodySize = 0;\n\n/**\n * Track number of requests holding keepalive budget, on the same terms as\n * {@link pendingBodySize}.\n */\nlet pendingKeepaliveCount = 0;\n\nexport interface FetchTransportParameters {\n url: string;\n headers: HeadersFactory;\n}\n\nclass FetchTransport implements IExporterTransport {\n private _parameters: FetchTransportParameters;\n\n constructor(parameters: FetchTransportParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const abortController = new AbortController();\n const timeout = setTimeout(() => abortController.abort(), timeoutMillis);\n // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.\n // In that case the instrumentation would create a new Span for this request,\n // creating an indirect endless loop Export -> Span -> Export.\n // `__original` lets the call bypass one wrapper; the suppressed context\n // below covers a `fetch` that was wrapped more than once.\n let fetchApi = globalThis.fetch;\n // @ts-expect-error -- fetch could be wrapped\n if (typeof fetchApi.__original === 'function') {\n // @ts-expect-error -- fetch could be wrapped\n fetchApi = fetchApi.__original;\n }\n\n const requestSize = data.byteLength;\n\n // Determine if we can use keepalive based on cumulative browser limits.\n // We must check BEFORE adding to pending totals to avoid exceeding limits.\n const wouldExceedSize =\n pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;\n const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;\n const useKeepalive = !wouldExceedSize && !wouldExceedCount;\n\n if (useKeepalive) {\n pendingBodySize += requestSize;\n pendingKeepaliveCount++;\n } else {\n const reason = wouldExceedSize ? 'size limit' : 'count limit';\n diag.debug(\n `keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`\n );\n }\n\n // Captured before the first `await`, which a synchronous context manager\n // would not survive.\n const suppressedContext = suppressTracing(context.active());\n\n // Idempotent so that a double call cannot drive the counters negative,\n // which would defeat the cap check above for every later request.\n let released = false;\n const release = () => {\n if (released) {\n return;\n }\n released = true;\n if (useKeepalive) {\n pendingBodySize -= requestSize;\n pendingKeepaliveCount--;\n }\n clearTimeout(timeout);\n };\n let drainOwnsCleanup = false;\n\n try {\n const url = new URL(this._parameters.url);\n // Resolve headers before entering the suppressed fetch context.\n const headers = await this._parameters.headers();\n const response = await context.with(suppressedContext, () =>\n fetchApi(url.href, {\n method: 'POST',\n headers,\n body: data,\n signal: abortController.signal,\n keepalive: useKeepalive,\n mode: globalThis.location\n ? globalThis.location.origin === url.origin\n ? 'same-origin'\n : 'cors'\n : 'no-cors',\n })\n );\n\n // Not awaited: the status already decides the export outcome, and a\n // collector that stalls mid-body must not hold up the caller.\n const drained = drainResponseBody(response);\n // Timer stays armed through the drain: an abort errors the body, so a\n // stalled drain still settles rather than holding the budget forever.\n // Released on rejection too, though the drain swallows its errors today:\n // a missed release would hold the keepalive budget for the page's life.\n void drained.then(release, release);\n // Set before any return, or `finally` frees the budget before it drains.\n drainOwnsCleanup = true;\n\n if (response.status >= 200 && response.status <= 299) {\n diag.debug(`export response success (status: ${response.status})`);\n return { status: 'success' };\n } else if (isExportHTTPErrorRetryable(response.status)) {\n diag.warn(`export response retryable (status: ${response.status})`);\n const retryAfter = response.headers.get('Retry-After');\n const retryInMillis = parseRetryAfterToMills(retryAfter);\n return { status: 'retryable', retryInMillis };\n }\n diag.error(`export response failure (status: ${response.status})`);\n return {\n status: 'failure',\n error: new Error(\n `Fetch request failed with non-retryable status ${response.status}`\n ),\n };\n } catch (error) {\n if (isFetchNetworkErrorRetryable(error)) {\n diag.warn(`export request retryable (network error: ${error})`);\n return {\n status: 'retryable',\n error: new Error('Fetch request encountered a network error', {\n cause: error,\n }),\n };\n }\n diag.error(`export request failure (error: ${error})`);\n return {\n status: 'failure',\n error: new Error('Fetch request errored', { cause: error }),\n };\n } finally {\n // Cleanup here only for a failure before the response arrived; past that\n // point the drain owns it.\n if (!drainOwnsCleanup) {\n release();\n }\n }\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * Creates an exporter transport that uses `fetch` to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createFetchTransport(\n parameters: FetchTransportParameters\n): IExporterTransport {\n return new FetchTransport(parameters);\n}\n\nfunction isFetchNetworkErrorRetryable(error: unknown): boolean {\n return error instanceof TypeError && !error.cause;\n}\n\n/**\n * Reads the response body to its end and discards it.\n *\n * Chromium gives the request's share of the keepalive quota back only once the\n * response body has been read to the end, and it skips the buffering consumer\n * that would otherwise drain the body on its own when the response carries a\n * `Cache-Control: no-store` header, which collectors commonly send. Leaving the\n * body unread then leaks the quota until the document goes away and every\n * following keepalive export stays pending forever. Cancelling the body is the\n * client-abort path and releases the quota far more slowly than reading it to\n * the end, so the body is read rather than cancelled.\n *\n * Never rejects. Its settlement, not its outcome, is what releases the\n * request's keepalive budget, so a caller that ignores it leaks that budget\n * for the life of the document.\n *\n * @see https://fetch.spec.whatwg.org/#fetch-processresponseendofbody\n * @see https://issues.chromium.org/issues/546438373\n */\nasync function drainResponseBody(response: Response): Promise<void> {\n try {\n // Empty and opaque responses have no body to read.\n const body = response.body;\n if (body == null) {\n return;\n }\n\n // Throws when the body is already locked to another reader, which happens\n // when the same response is handed to more than one export.\n const reader = body.getReader();\n try {\n // Chunks are dropped as they arrive: the payload is not used, and\n // buffering it - with `response.arrayBuffer()` for instance - would keep\n // a response of arbitrary size in memory.\n let chunk = await reader.read();\n while (!chunk.done) {\n chunk = await reader.read();\n }\n } finally {\n // The reader keeps the body locked until it is released, which would\n // make a later export handed the same response fail to acquire a reader\n // and skip the drain.\n reader.releaseLock();\n }\n } catch (error) {\n // The export outcome is decided by the response status, a body that cannot\n // be read must not change it.\n diag.debug(`error reading export response body: ${error}`);\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,MAAM,0BAA0B;;;;;;;AAQhC,MAAM,yBAAyB;;;;;;;AAQ/B,IAAI,kBAAkB;;;;;AAMtB,IAAI,wBAAwB;AAO5B,IAAM,iBAAN,MAAmD;CACjD;CAEA,YAAY,YAAsC;EAChD,KAAK,cAAc;CACrB;CAEA,MAAM,KAAK,MAAkB,eAAgD;EAC3E,MAAM,kBAAkB,IAAI,gBAAgB;EAC5C,MAAM,UAAU,iBAAiB,gBAAgB,MAAM,GAAG,aAAa;EAMvE,IAAI,WAAW,WAAW;EAE1B,IAAI,OAAO,SAAS,eAAe,YAEjC,WAAW,SAAS;EAGtB,MAAM,cAAc,KAAK;EAIzB,MAAM,kBACJ,kBAAkB,cAAc;EAElC,MAAM,eAAe,CAAC,mBAAmB,EADhB,yBAAyB;EAGlD,IAAI,cAAc;GAChB,mBAAmB;GACnB;EACF,OAAO;GACL,MAAM,SAAS,kBAAkB,eAAe;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AAI,MAAM,6CAA6C,EAC5D,OAAO,MACT,CAAC;IACH;GACF;GACA,KAAK,MAAM,kCAAkC,MAAM,EAAE;GACrD,OAAO;IACL,QAAQ;IACR,OAAO,IAAI,MAAM,yBAAyB,EAAE,OAAO,MAAM,CAAC;GAC5D;EACF,UAAU;GAGR,IAAI,CAAC,kBACH,QAAQ;EAEZ;CACF;CAEA,WAAW,CAEX;AACF;;;;;AAMA,SAAgB,qBACd,YACoB;CACpB,OAAO,IAAI,eAAe,UAAU;AACtC;AAEA,SAAS,6BAA6B,OAAyB;CAC7D,OAAO,iBAAiB,aAAa,CAAC,MAAM;AAC9C;;;;;;;;;;;;;;;;;;;;AAqBA,eAAe,kBAAkB,UAAmC;CAClE,IAAI;EAEF,MAAM,OAAO,SAAS;EACtB,IAAI,QAAQ,MACV;EAKF,MAAM,SAAS,KAAK,UAAU;EAC9B,IAAI;GAIF,IAAI,QAAQ,MAAM,OAAO,KAAK;GAC9B,OAAO,CAAC,MAAM,MACZ,QAAQ,MAAM,OAAO,KAAK;EAE9B,UAAU;GAIR,OAAO,YAAY;EACrB;CACF,SAAS,OAAO;EAGd,KAAK,MAAM,uCAAuC,OAAO;CAC3D;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-exporter-transport.cjs","names":["sendWithHttp"],"sources":["../../src/transport/http-exporter-transport.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// NOTE: do not change these type imports to actual imports. Doing so WILL break `@opentelemetry/instrumentation-http`,\n// as they'd be imported before the http/https modules can be wrapped.\nimport type * as https from 'https';\nimport type * as http from 'http';\nimport type { ExportResponse } from '../export-response';\nimport type { IExporterTransport } from '../exporter-transport';\nimport { sendWithHttp } from './http-transport-utils';\nimport type { NodeHttpRequestParameters } from './node-http-transport-types';\n\ninterface Utils {\n agent: http.Agent | https.Agent;\n request: typeof http.request | typeof https.request;\n}\n\nclass HttpExporterTransport implements IExporterTransport {\n private _utils: Utils | null = null;\n private _parameters: NodeHttpRequestParameters;\n\n constructor(parameters: NodeHttpRequestParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const { agent, request } = await this._loadUtils();\n const headers = await this._parameters.headers();\n\n return sendWithHttp(\n request,\n this._parameters.url,\n headers,\n this._parameters.compression,\n this._parameters.userAgent,\n agent,\n data,\n timeoutMillis\n );\n }\n\n shutdown() {\n // intentionally left empty, nothing to do.\n }\n\n private async _loadUtils(): Promise<Utils> {\n let utils = this._utils;\n\n if (utils === null) {\n const protocol = new URL(this._parameters.url).protocol;\n const [agent, request] = await Promise.all([\n this._parameters.agentFactory(protocol),\n requestFunctionFactory(protocol),\n ]);\n utils = this._utils = { agent, request };\n }\n\n return utils;\n }\n}\n\nasync function requestFunctionFactory(\n protocol: string\n): Promise<typeof http.request | typeof https.request> {\n const module = protocol === 'http:' ? import('http') : import('https');\n const { request } = await module;\n return request;\n}\n\nexport function createHttpExporterTransport(\n parameters: NodeHttpRequestParameters\n): IExporterTransport {\n return new HttpExporterTransport(parameters);\n}\n"],"mappings":";;AAmBA,IAAM,wBAAN,MAA0D;CACxD,SAA+B;CAC/B;CAEA,YAAY,YAAuC;EACjD,KAAK,cAAc;CACrB;CAEA,MAAM,KAAK,MAAkB,eAAgD;EAC3E,MAAM,EAAE,OAAO,YAAY,MAAM,KAAK,WAAW;EACjD,MAAM,UAAU,MAAM,KAAK,YAAY,QAAQ;EAE/C,OAAOA,6BAAAA,aACL,SACA,KAAK,YAAY,KACjB,SACA,KAAK,YAAY,aACjB,KAAK,YAAY,WACjB,OACA,MACA,aACF;CACF;CAEA,WAAW,CAEX;CAEA,MAAc,aAA6B;EACzC,IAAI,QAAQ,KAAK;EAEjB,IAAI,UAAU,MAAM;GAClB,MAAM,WAAW,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC,CAAC;GAC/C,MAAM,CAAC,OAAO,WAAW,MAAM,QAAQ,IAAI,CACzC,KAAK,YAAY,aAAa,QAAQ,GACtC,uBAAuB,QAAQ,CACjC,CAAC;GACD,QAAQ,KAAK,SAAS;IAAE;IAAO;GAAQ;EACzC;EAEA,OAAO;CACT;AACF;AAEA,eAAe,uBACb,UACqD;CAErD,MAAM,EAAE,YAAY,OADL,aAAa,UAAU,OAAO,UAAU,OAAO;CAE9D,OAAO;AACT;AAEA,SAAgB,4BACd,YACoB;CACpB,OAAO,IAAI,sBAAsB,UAAU;AAC7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-exporter-transport.mjs","names":[],"sources":["../../src/transport/http-exporter-transport.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// NOTE: do not change these type imports to actual imports. Doing so WILL break `@opentelemetry/instrumentation-http`,\n// as they'd be imported before the http/https modules can be wrapped.\nimport type * as https from 'https';\nimport type * as http from 'http';\nimport type { ExportResponse } from '../export-response';\nimport type { IExporterTransport } from '../exporter-transport';\nimport { sendWithHttp } from './http-transport-utils';\nimport type { NodeHttpRequestParameters } from './node-http-transport-types';\n\ninterface Utils {\n agent: http.Agent | https.Agent;\n request: typeof http.request | typeof https.request;\n}\n\nclass HttpExporterTransport implements IExporterTransport {\n private _utils: Utils | null = null;\n private _parameters: NodeHttpRequestParameters;\n\n constructor(parameters: NodeHttpRequestParameters) {\n this._parameters = parameters;\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n const { agent, request } = await this._loadUtils();\n const headers = await this._parameters.headers();\n\n return sendWithHttp(\n request,\n this._parameters.url,\n headers,\n this._parameters.compression,\n this._parameters.userAgent,\n agent,\n data,\n timeoutMillis\n );\n }\n\n shutdown() {\n // intentionally left empty, nothing to do.\n }\n\n private async _loadUtils(): Promise<Utils> {\n let utils = this._utils;\n\n if (utils === null) {\n const protocol = new URL(this._parameters.url).protocol;\n const [agent, request] = await Promise.all([\n this._parameters.agentFactory(protocol),\n requestFunctionFactory(protocol),\n ]);\n utils = this._utils = { agent, request };\n }\n\n return utils;\n }\n}\n\nasync function requestFunctionFactory(\n protocol: string\n): Promise<typeof http.request | typeof https.request> {\n const module = protocol === 'http:' ? import('http') : import('https');\n const { request } = await module;\n return request;\n}\n\nexport function createHttpExporterTransport(\n parameters: NodeHttpRequestParameters\n): IExporterTransport {\n return new HttpExporterTransport(parameters);\n}\n"],"mappings":";;AAmBA,IAAM,wBAAN,MAA0D;CACxD,SAA+B;CAC/B;CAEA,YAAY,YAAuC;EACjD,KAAK,cAAc;CACrB;CAEA,MAAM,KAAK,MAAkB,eAAgD;EAC3E,MAAM,EAAE,OAAO,YAAY,MAAM,KAAK,WAAW;EACjD,MAAM,UAAU,MAAM,KAAK,YAAY,QAAQ;EAE/C,OAAO,aACL,SACA,KAAK,YAAY,KACjB,SACA,KAAK,YAAY,aACjB,KAAK,YAAY,WACjB,OACA,MACA,aACF;CACF;CAEA,WAAW,CAEX;CAEA,MAAc,aAA6B;EACzC,IAAI,QAAQ,KAAK;EAEjB,IAAI,UAAU,MAAM;GAClB,MAAM,WAAW,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC,CAAC;GAC/C,MAAM,CAAC,OAAO,WAAW,MAAM,QAAQ,IAAI,CACzC,KAAK,YAAY,aAAa,QAAQ,GACtC,uBAAuB,QAAQ,CACjC,CAAC;GACD,QAAQ,KAAK,SAAS;IAAE;IAAO;GAAQ;EACzC;EAEA,OAAO;CACT;AACF;AAEA,eAAe,uBACb,UACqD;CAErD,MAAM,EAAE,YAAY,OADL,aAAa,UAAU,OAAO,UAAU,OAAO;CAE9D,OAAO;AACT;AAEA,SAAgB,4BACd,YACoB;CACpB,OAAO,IAAI,sBAAsB,UAAU;AAC7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-transport-utils.cjs","names":["VERSION","isExportHTTPErrorRetryable","parseRetryAfterToMills","OTLPExporterError","Readable"],"sources":["../../src/transport/http-transport-utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport type { ExportResponse } from '../export-response';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport { OTLPExporterError } from '../types';\nimport { VERSION } from '../version';\n\nconst DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`;\n\n/**\n * Maximum response body size (4 MB) that the HTTP transport will read.\n * If the server sends more data the connection is destroyed and the export\n * is treated as a non-retryable error regardless of status code.\n */\nexport const MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;\n\n/**\n * Sends data using http\n * @param request\n * @param url\n * @param headers\n * @param compression\n * @param userAgent\n * @param agent\n * @param data\n * @param timeoutMillis\n */\nexport function sendWithHttp(\n request: typeof https.request | typeof http.request,\n url: string,\n headers: Record<string, string>,\n compression: 'gzip' | 'none',\n userAgent: string | undefined,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n timeoutMillis: number\n): Promise<ExportResponse> {\n return new Promise<ExportResponse>(resolve => {\n const parsedUrl = new URL(url);\n\n if (userAgent) {\n headers['User-Agent'] = `${userAgent} ${DEFAULT_USER_AGENT}`;\n } else {\n headers['User-Agent'] = DEFAULT_USER_AGENT;\n }\n\n const options: http.RequestOptions | https.RequestOptions = {\n method: 'POST',\n headers,\n agent,\n };\n\n const req = request(parsedUrl, options, (res: http.IncomingMessage) => {\n const responseData: Buffer[] = [];\n let responseSize = 0;\n res.on('data', (chunk: Buffer) => {\n responseSize += chunk.length;\n if (responseSize > MAX_RESPONSE_BODY_SIZE) {\n const sizeError = new Error(\n `OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`\n );\n // Oversized responses are treated as non-retryable errors\n // regardless of status code.\n // Resolve before destroying: res.destroy() tears down the socket which\n // triggers ECONNRESET on req.on('error'), so, resolving first makes that\n // a no-op. res.on('error') does not fire because destroy() is called\n // without an error argument.\n resolve({ status: 'failure', error: sizeError });\n res.destroy();\n return;\n }\n responseData.push(chunk);\n });\n\n res.on('end', () => {\n if (res.statusCode && res.statusCode <= 299) {\n resolve({\n status: 'success',\n data: Buffer.concat(responseData),\n });\n } else if (\n res.statusCode &&\n isExportHTTPErrorRetryable(res.statusCode)\n ) {\n resolve({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n Buffer.concat(responseData).toString()\n );\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n\n res.on('error', (error: Error) => {\n // Note: 'end' may still be emitted after 'error' on the same response object, since we're resolving a promise,\n // the first call to resolve() will determine the final state.\n if (res.statusCode && res.statusCode <= 299) {\n // If the response is successful but an error occurs while reading the response,\n // we consider it a success since the data has been sent successfully.\n resolve({\n status: 'success',\n });\n } else if (\n res.statusCode &&\n isExportHTTPErrorRetryable(res.statusCode)\n ) {\n resolve({\n status: 'retryable',\n error: error,\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n });\n\n req.setTimeout(timeoutMillis, () => {\n req.destroy();\n resolve({\n status: 'retryable',\n error: new Error('Request timed out'),\n });\n });\n\n req.on('error', (error: Error) => {\n if (isHttpTransportNetworkErrorRetryable(error)) {\n resolve({\n status: 'retryable',\n error,\n });\n } else {\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n\n compressAndSend(req, compression, data, (error: Error) => {\n resolve({\n status: 'failure',\n error,\n });\n });\n });\n}\n\nexport function compressAndSend(\n req: http.ClientRequest,\n compression: 'gzip' | 'none',\n data: Uint8Array,\n onError: (error: Error) => void\n) {\n let dataStream = readableFromUint8Array(data);\n\n if (compression === 'gzip') {\n req.setHeader('Content-Encoding', 'gzip');\n dataStream = dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError);\n }\n\n dataStream.pipe(req).on('error', onError);\n}\n\nfunction readableFromUint8Array(buff: string | Uint8Array): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n\nfunction isHttpTransportNetworkErrorRetryable(error: Error): boolean {\n const RETRYABLE_NETWORK_ERROR_CODES = new Set([\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ETIMEDOUT',\n 'EAI_AGAIN',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EHOSTUNREACH',\n ]);\n\n if ('code' in error && typeof error.code === 'string') {\n return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;AAgBA,MAAM,qBAAqB,iCAAiCA,gBAAAA;;;;;;AAO5D,MAAa,yBAAyB;;;;;;;;;;;;AAatC,SAAgB,aACd,SACA,KACA,SACA,aACA,WACA,OACA,MACA,eACyB;CACzB,OAAO,IAAI,SAAwB,YAAW;EAC5C,MAAM,YAAY,IAAI,IAAI,GAAG;EAE7B,IAAI,WACF,QAAQ,gBAAgB,GAAG,UAAU,GAAG;OAExC,QAAQ,gBAAgB;EAS1B,MAAM,MAAM,QAAQ,WAAW;GAL7B,QAAQ;GACR;GACA;EAGmC,IAAI,QAA8B;GACrE,MAAM,eAAyB,CAAC;GAChC,IAAI,eAAe;GACnB,IAAI,GAAG,SAAS,UAAkB;IAChC,gBAAgB,MAAM;IACtB,IAAI,eAAA,SAAuC;KAUzC,QAAQ;MAAE,QAAQ;MAAW,uBAAO,IATd,MACpB,oDAAoD,uBAAuB,OAQjC;KAAE,CAAC;KAC/C,IAAI,QAAQ;KACZ;IACF;IACA,aAAa,KAAK,KAAK;GACzB,CAAC;GAED,IAAI,GAAG,aAAa;IAClB,IAAI,IAAI,cAAc,IAAI,cAAc,KACtC,QAAQ;KACN,QAAQ;KACR,MAAM,OAAO,OAAO,YAAY;IAClC,CAAC;SAC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GAAG,CAAC,CAAC,GAAG,SAAS,OAAO;AAC1C;AAEA,SAAS,uBAAuB,MAAqC;CACnE,MAAM,WAAW,IAAIE,OAAAA,SAAS;CAC9B,SAAS,KAAK,IAAI;CAClB,SAAS,KAAK,IAAI;CAElB,OAAO;AACT;AAEA,SAAS,qCAAqC,OAAuB;CACnE,MAAM,gDAAgC,IAAI,IAAI;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,UAC3C,OAAO,8BAA8B,IAAI,MAAM,IAAI;CAGrD,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-transport-utils.mjs","names":[],"sources":["../../src/transport/http-transport-utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport type { ExportResponse } from '../export-response';\nimport {\n isExportHTTPErrorRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport { OTLPExporterError } from '../types';\nimport { VERSION } from '../version';\n\nconst DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`;\n\n/**\n * Maximum response body size (4 MB) that the HTTP transport will read.\n * If the server sends more data the connection is destroyed and the export\n * is treated as a non-retryable error regardless of status code.\n */\nexport const MAX_RESPONSE_BODY_SIZE = 4 * 1024 * 1024;\n\n/**\n * Sends data using http\n * @param request\n * @param url\n * @param headers\n * @param compression\n * @param userAgent\n * @param agent\n * @param data\n * @param timeoutMillis\n */\nexport function sendWithHttp(\n request: typeof https.request | typeof http.request,\n url: string,\n headers: Record<string, string>,\n compression: 'gzip' | 'none',\n userAgent: string | undefined,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n timeoutMillis: number\n): Promise<ExportResponse> {\n return new Promise<ExportResponse>(resolve => {\n const parsedUrl = new URL(url);\n\n if (userAgent) {\n headers['User-Agent'] = `${userAgent} ${DEFAULT_USER_AGENT}`;\n } else {\n headers['User-Agent'] = DEFAULT_USER_AGENT;\n }\n\n const options: http.RequestOptions | https.RequestOptions = {\n method: 'POST',\n headers,\n agent,\n };\n\n const req = request(parsedUrl, options, (res: http.IncomingMessage) => {\n const responseData: Buffer[] = [];\n let responseSize = 0;\n res.on('data', (chunk: Buffer) => {\n responseSize += chunk.length;\n if (responseSize > MAX_RESPONSE_BODY_SIZE) {\n const sizeError = new Error(\n `OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`\n );\n // Oversized responses are treated as non-retryable errors\n // regardless of status code.\n // Resolve before destroying: res.destroy() tears down the socket which\n // triggers ECONNRESET on req.on('error'), so, resolving first makes that\n // a no-op. res.on('error') does not fire because destroy() is called\n // without an error argument.\n resolve({ status: 'failure', error: sizeError });\n res.destroy();\n return;\n }\n responseData.push(chunk);\n });\n\n res.on('end', () => {\n if (res.statusCode && res.statusCode <= 299) {\n resolve({\n status: 'success',\n data: Buffer.concat(responseData),\n });\n } else if (\n res.statusCode &&\n isExportHTTPErrorRetryable(res.statusCode)\n ) {\n resolve({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n Buffer.concat(responseData).toString()\n );\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n\n res.on('error', (error: Error) => {\n // Note: 'end' may still be emitted after 'error' on the same response object, since we're resolving a promise,\n // the first call to resolve() will determine the final state.\n if (res.statusCode && res.statusCode <= 299) {\n // If the response is successful but an error occurs while reading the response,\n // we consider it a success since the data has been sent successfully.\n resolve({\n status: 'success',\n });\n } else if (\n res.statusCode &&\n isExportHTTPErrorRetryable(res.statusCode)\n ) {\n resolve({\n status: 'retryable',\n error: error,\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n });\n\n req.setTimeout(timeoutMillis, () => {\n req.destroy();\n resolve({\n status: 'retryable',\n error: new Error('Request timed out'),\n });\n });\n\n req.on('error', (error: Error) => {\n if (isHttpTransportNetworkErrorRetryable(error)) {\n resolve({\n status: 'retryable',\n error,\n });\n } else {\n resolve({\n status: 'failure',\n error,\n });\n }\n });\n\n compressAndSend(req, compression, data, (error: Error) => {\n resolve({\n status: 'failure',\n error,\n });\n });\n });\n}\n\nexport function compressAndSend(\n req: http.ClientRequest,\n compression: 'gzip' | 'none',\n data: Uint8Array,\n onError: (error: Error) => void\n) {\n let dataStream = readableFromUint8Array(data);\n\n if (compression === 'gzip') {\n req.setHeader('Content-Encoding', 'gzip');\n dataStream = dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError);\n }\n\n dataStream.pipe(req).on('error', onError);\n}\n\nfunction readableFromUint8Array(buff: string | Uint8Array): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n\nfunction isHttpTransportNetworkErrorRetryable(error: Error): boolean {\n const RETRYABLE_NETWORK_ERROR_CODES = new Set([\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ETIMEDOUT',\n 'EAI_AGAIN',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EHOSTUNREACH',\n ]);\n\n if ('code' in error && typeof error.code === 'string') {\n return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAgBA,MAAM,qBAAqB,iCAAiC;;;;;;AAO5D,MAAa,yBAAyB;;;;;;;;;;;;AAatC,SAAgB,aACd,SACA,KACA,SACA,aACA,WACA,OACA,MACA,eACyB;CACzB,OAAO,IAAI,SAAwB,YAAW;EAC5C,MAAM,YAAY,IAAI,IAAI,GAAG;EAE7B,IAAI,WACF,QAAQ,gBAAgB,GAAG,UAAU,GAAG;OAExC,QAAQ,gBAAgB;EAS1B,MAAM,MAAM,QAA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,QAAQ;IACN,QAAQ;IACR;GACF,CAAC;EAEL,CAAC;EAED,gBAAgB,KAAK,aAAa,OAAO,UAAiB;GACxD,QAAQ;IACN,QAAQ;IACR;GACF,CAAC;EACH,CAAC;CACH,CAAC;AACH;AAEA,SAAgB,gBACd,KACA,aACA,MACA,SACA;CACA,IAAI,aAAa,uBAAuB,IAAI;CAE5C,IAAI,gBAAgB,QAAQ;EAC1B,IAAI,UAAU,oBAAoB,MAAM;EACxC,aAAa,WACV,GAAG,SAAS,OAAO,CAAC,CACpB,KAAK,KAAK,WAAW,CAAC,CAAC,CACvB,GAAG,SAAS,OAAO;CACxB;CAEA,WAAW,KAAK,GAAG,CAAC,CAAC,GAAG,SAAS,OAAO;AAC1C;AAEA,SAAS,uBAAuB,MAAqC;CACnE,MAAM,WAAW,IAAI,SAAS;CAC9B,SAAS,KAAK,IAAI;CAClB,SAAS,KAAK,IAAI;CAElB,OAAO;AACT;AAEA,SAAS,qCAAqC,OAAuB;CACnE,MAAM,gDAAgC,IAAI,IAAI;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,UAC3C,OAAO,8BAA8B,IAAI,MAAM,IAAI;CAGrD,OAAO;AACT"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|