@opentelemetry/otlp-exporter-base 0.301.1 → 0.302.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExporterMetrics.cjs +1 -2
- package/dist/ExporterMetrics.cjs.map +1 -1
- package/dist/ExporterMetrics.d.cts +2 -5
- package/dist/ExporterMetrics.d.cts.map +1 -1
- package/dist/ExporterMetrics.d.mts +2 -5
- package/dist/ExporterMetrics.d.mts.map +1 -1
- package/dist/ExporterMetrics.mjs +1 -2
- package/dist/ExporterMetrics.mjs.map +1 -1
- package/dist/OTLPExporterBase.cjs +1 -2
- package/dist/OTLPExporterBase.cjs.map +1 -1
- package/dist/OTLPExporterBase.d.cts +2 -5
- package/dist/OTLPExporterBase.d.cts.map +1 -1
- package/dist/OTLPExporterBase.d.mts +2 -5
- package/dist/OTLPExporterBase.d.mts.map +1 -1
- package/dist/OTLPExporterBase.mjs +1 -2
- package/dist/OTLPExporterBase.mjs.map +1 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/bounded-queue-export-promise-handler.cjs +1 -2
- package/dist/bounded-queue-export-promise-handler.cjs.map +1 -1
- package/dist/bounded-queue-export-promise-handler.d.cts +1 -0
- package/dist/bounded-queue-export-promise-handler.mjs +1 -2
- package/dist/bounded-queue-export-promise-handler.mjs.map +1 -1
- package/dist/configuration/compression.cjs +1 -2
- package/dist/configuration/compression.d.cts +1 -4
- package/dist/configuration/compression.d.cts.map +1 -1
- package/dist/configuration/compression.d.mts +1 -4
- package/dist/configuration/compression.d.mts.map +1 -1
- package/dist/configuration/compression.mjs +1 -2
- package/dist/configuration/convert-legacy-http-options.cjs +1 -2
- package/dist/configuration/convert-legacy-http-options.mjs +1 -2
- package/dist/configuration/legacy-base-configuration.d.cts +1 -4
- package/dist/configuration/legacy-base-configuration.d.cts.map +1 -1
- package/dist/configuration/legacy-base-configuration.d.mts +1 -4
- package/dist/configuration/legacy-base-configuration.d.mts.map +1 -1
- package/dist/configuration/otlp-http-configuration.cjs +1 -2
- package/dist/configuration/otlp-http-configuration.d.cts +2 -5
- package/dist/configuration/otlp-http-configuration.d.cts.map +1 -1
- package/dist/configuration/otlp-http-configuration.d.mts +2 -5
- package/dist/configuration/otlp-http-configuration.d.mts.map +1 -1
- package/dist/configuration/otlp-http-configuration.mjs +1 -2
- package/dist/configuration/shared-configuration.cjs +1 -2
- package/dist/configuration/shared-configuration.d.cts +4 -6
- package/dist/configuration/shared-configuration.d.cts.map +1 -1
- package/dist/configuration/shared-configuration.d.mts +3 -6
- package/dist/configuration/shared-configuration.d.mts.map +1 -1
- package/dist/configuration/shared-configuration.mjs +1 -2
- package/dist/configuration/shared-env-configuration.cjs +1 -2
- package/dist/configuration/shared-env-configuration.cjs.map +1 -1
- package/dist/configuration/shared-env-configuration.d.cts +1 -4
- package/dist/configuration/shared-env-configuration.d.cts.map +1 -1
- package/dist/configuration/shared-env-configuration.d.mts +1 -4
- package/dist/configuration/shared-env-configuration.d.mts.map +1 -1
- package/dist/configuration/shared-env-configuration.mjs +1 -2
- package/dist/export-response.d.cts +4 -7
- package/dist/export-response.d.cts.map +1 -1
- package/dist/export-response.d.mts +4 -7
- package/dist/export-response.d.mts.map +1 -1
- package/dist/exporter-transport.d.cts +1 -4
- package/dist/exporter-transport.d.cts.map +1 -1
- package/dist/exporter-transport.d.mts +1 -4
- package/dist/exporter-transport.d.mts.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/is-export-retryable.cjs +1 -2
- package/dist/is-export-retryable.mjs +1 -2
- package/dist/logging-response-handler.cjs +1 -2
- package/dist/logging-response-handler.cjs.map +1 -1
- package/dist/logging-response-handler.mjs +1 -2
- package/dist/otlp-export-delegate.cjs +1 -2
- package/dist/otlp-export-delegate.cjs.map +1 -1
- package/dist/otlp-export-delegate.d.cts +3 -5
- package/dist/otlp-export-delegate.d.cts.map +1 -1
- package/dist/otlp-export-delegate.d.mts +2 -5
- package/dist/otlp-export-delegate.d.mts.map +1 -1
- package/dist/otlp-export-delegate.mjs +1 -2
- package/dist/otlp-export-delegate.mjs.map +1 -1
- package/dist/otlp-network-export-delegate.cjs +1 -2
- package/dist/otlp-network-export-delegate.d.cts +3 -6
- package/dist/otlp-network-export-delegate.d.cts.map +1 -1
- package/dist/otlp-network-export-delegate.d.mts +3 -6
- package/dist/otlp-network-export-delegate.d.mts.map +1 -1
- package/dist/otlp-network-export-delegate.mjs +1 -2
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.cjs +1 -2
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.cts +1 -4
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.cts.map +1 -1
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.mts +1 -4
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.d.mts.map +1 -1
- package/dist/platform/browser/configuration/convert-legacy-browser-http-options.mjs +1 -2
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.cjs +3 -4
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.cts +3 -6
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.cts.map +1 -1
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.mts +3 -6
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.d.mts.map +1 -1
- package/dist/platform/browser/configuration/create-legacy-browser-delegate.mjs +3 -4
- package/dist/platform/browser/index.d.cts +3 -0
- package/dist/platform/browser/index.d.mts +3 -0
- package/dist/platform/browser/otlp-browser-http-export-delegate.cjs +2 -3
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.cts +3 -6
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.cts.map +1 -1
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.mts +3 -6
- package/dist/platform/browser/otlp-browser-http-export-delegate.d.mts.map +1 -1
- package/dist/platform/browser/otlp-browser-http-export-delegate.mjs +2 -3
- package/dist/platform/browser/transport/fetch-transport.cjs +1 -2
- package/dist/platform/browser/transport/fetch-transport.cjs.map +1 -1
- package/dist/platform/browser/transport/fetch-transport.mjs +1 -2
- package/dist/platform/browser/transport/fetch-transport.mjs.map +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.cjs +1 -2
- package/dist/platform/node/configuration/convert-legacy-node-http-options.cjs.map +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.cts +2 -5
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.cts.map +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.mts +2 -5
- package/dist/platform/node/configuration/convert-legacy-node-http-options.d.mts.map +1 -1
- package/dist/platform/node/configuration/convert-legacy-node-http-options.mjs +1 -2
- package/dist/platform/node/configuration/legacy-node-configuration.d.cts +2 -5
- package/dist/platform/node/configuration/legacy-node-configuration.d.cts.map +1 -1
- package/dist/platform/node/configuration/legacy-node-configuration.d.mts +2 -5
- package/dist/platform/node/configuration/legacy-node-configuration.d.mts.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-configuration.cjs +28 -4
- package/dist/platform/node/configuration/otlp-node-http-configuration.cjs.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.cts +3 -6
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.cts.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.mts +3 -6
- package/dist/platform/node/configuration/otlp-node-http-configuration.d.mts.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-configuration.mjs +28 -4
- package/dist/platform/node/configuration/otlp-node-http-configuration.mjs.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-env-configuration.cjs +5 -6
- package/dist/platform/node/configuration/otlp-node-http-env-configuration.cjs.map +1 -1
- package/dist/platform/node/configuration/otlp-node-http-env-configuration.mjs +2 -3
- package/dist/platform/node/index.d.cts +1 -1
- package/dist/platform/node/index.d.mts +1 -1
- package/dist/platform/node/otlp-http-export-delegate.cjs +5 -6
- package/dist/platform/node/otlp-http-export-delegate.d.cts +3 -6
- package/dist/platform/node/otlp-http-export-delegate.d.cts.map +1 -1
- package/dist/platform/node/otlp-http-export-delegate.d.mts +3 -6
- package/dist/platform/node/otlp-http-export-delegate.d.mts.map +1 -1
- package/dist/platform/node/otlp-http-export-delegate.mjs +5 -6
- package/dist/platform/node/transport/http-exporter-transport.cjs +1 -2
- package/dist/platform/node/transport/http-exporter-transport.cjs.map +1 -1
- package/dist/platform/node/transport/http-exporter-transport.mjs +1 -2
- package/dist/platform/node/transport/http-exporter-transport.mjs.map +1 -1
- package/dist/platform/node/transport/http-transport-utils.cjs +2 -3
- package/dist/platform/node/transport/http-transport-utils.mjs +2 -3
- package/dist/retrying-transport.cjs +1 -2
- package/dist/retrying-transport.cjs.map +1 -1
- package/dist/retrying-transport.mjs +1 -2
- package/dist/retrying-transport.mjs.map +1 -1
- package/dist/semconv.cjs +1 -2
- package/dist/semconv.mjs +1 -2
- package/dist/types.cjs +1 -2
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -4
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +1 -4
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +1 -2
- package/dist/types.mjs.map +1 -1
- package/dist/util.cjs +1 -2
- package/dist/util.cjs.map +1 -1
- package/dist/util.mjs +1 -2
- package/dist/version.cjs +2 -3
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +2 -3
- package/dist/version.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
const require_otlp_http_configuration = require("../../../configuration/otlp-http-configuration.cjs");
|
|
2
|
-
|
|
2
|
+
// src/platform/node/configuration/otlp-node-http-configuration.ts
|
|
3
|
+
function getEnvProxyAgentOptions() {
|
|
4
|
+
if (!process.env.HTTP_PROXY && !process.env.http_proxy && !process.env.HTTPS_PROXY && !process.env.https_proxy) return;
|
|
5
|
+
return { proxyEnv: {
|
|
6
|
+
HTTP_PROXY: process.env.HTTP_PROXY,
|
|
7
|
+
HTTPS_PROXY: process.env.HTTPS_PROXY,
|
|
8
|
+
NO_PROXY: process.env.NO_PROXY,
|
|
9
|
+
http_proxy: process.env.http_proxy,
|
|
10
|
+
https_proxy: process.env.https_proxy,
|
|
11
|
+
no_proxy: process.env.no_proxy
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
3
14
|
function httpAgentFactoryFromOptions(options) {
|
|
15
|
+
/**
|
|
16
|
+
* Node's native `proxyEnv` agent option is available from Node.js 22.21.0
|
|
17
|
+
* and 24.5.0. Earlier supported Node.js versions keep the option in the
|
|
18
|
+
* agent configuration but do not apply environment proxies to requests.
|
|
19
|
+
* Applications that need proxying on those versions should provide an
|
|
20
|
+
* agent factory with an explicit proxy implementation.
|
|
21
|
+
*/
|
|
4
22
|
return async (protocol) => {
|
|
5
23
|
const isInsecure = protocol === "http:";
|
|
6
24
|
const { Agent } = await (isInsecure ? import("http") : import("https"));
|
|
25
|
+
const envProxyAgentOptions = getEnvProxyAgentOptions();
|
|
7
26
|
if (isInsecure) {
|
|
8
27
|
const { ca, cert, key, ...insecureOptions } = options;
|
|
9
|
-
return new Agent(
|
|
28
|
+
return new Agent({
|
|
29
|
+
...envProxyAgentOptions,
|
|
30
|
+
...insecureOptions
|
|
31
|
+
});
|
|
10
32
|
}
|
|
11
|
-
return new Agent(
|
|
33
|
+
return new Agent({
|
|
34
|
+
...envProxyAgentOptions,
|
|
35
|
+
...options
|
|
36
|
+
});
|
|
12
37
|
};
|
|
13
38
|
}
|
|
14
39
|
/**
|
|
@@ -29,7 +54,6 @@ function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
|
29
54
|
agentFactory: httpAgentFactoryFromOptions({ keepAlive: true })
|
|
30
55
|
};
|
|
31
56
|
}
|
|
32
|
-
//#endregion
|
|
33
57
|
exports.getNodeHttpConfigurationDefaults = getNodeHttpConfigurationDefaults;
|
|
34
58
|
exports.httpAgentFactoryFromOptions = httpAgentFactoryFromOptions;
|
|
35
59
|
exports.mergeOtlpNodeHttpConfigurationWithDefaults = mergeOtlpNodeHttpConfigurationWithDefaults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.cjs","names":["mergeOtlpHttpConfigurationWithDefaults","getHttpConfigurationDefaults"],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from '../../../configuration/otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from '../../../configuration/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
|
|
1
|
+
{"version":3,"file":"otlp-node-http-configuration.cjs","names":["mergeOtlpHttpConfigurationWithDefaults","getHttpConfigurationDefaults"],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from '../../../configuration/otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from '../../../configuration/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\nfunction getEnvProxyAgentOptions():\n { proxyEnv: NodeJS.ProcessEnv } | undefined {\n if (\n !process.env.HTTP_PROXY &&\n !process.env.http_proxy &&\n !process.env.HTTPS_PROXY &&\n !process.env.https_proxy\n ) {\n return undefined;\n }\n\n return {\n proxyEnv: {\n HTTP_PROXY: process.env.HTTP_PROXY,\n HTTPS_PROXY: process.env.HTTPS_PROXY,\n NO_PROXY: process.env.NO_PROXY,\n http_proxy: process.env.http_proxy,\n https_proxy: process.env.https_proxy,\n no_proxy: process.env.no_proxy,\n },\n };\n}\n\nexport function httpAgentFactoryFromOptions(\n options: http.AgentOptions | https.AgentOptions\n): HttpAgentFactory {\n /**\n * Node's native `proxyEnv` agent option is available from Node.js 22.21.0\n * and 24.5.0. Earlier supported Node.js versions keep the option in the\n * agent configuration but do not apply environment proxies to requests.\n * Applications that need proxying on those versions should provide an\n * agent factory with an explicit proxy implementation.\n */\n return async protocol => {\n const isInsecure = protocol === 'http:';\n const module = isInsecure ? import('http') : import('https');\n const { Agent } = await module;\n const envProxyAgentOptions = getEnvProxyAgentOptions();\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({\n ...envProxyAgentOptions,\n ...insecureOptions,\n } as http.AgentOptions);\n }\n return new Agent({\n ...envProxyAgentOptions,\n ...options,\n } as https.AgentOptions);\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,SAAS,0BACqC;CAC5C,IACE,CAAC,QAAQ,IAAI,cACb,CAAC,QAAQ,IAAI,cACb,CAAC,QAAQ,IAAI,eACb,CAAC,QAAQ,IAAI,aAEb;CAGF,OAAO,EACL,UAAU;EACR,YAAY,QAAQ,IAAI;EACxB,aAAa,QAAQ,IAAI;EACzB,UAAU,QAAQ,IAAI;EACtB,YAAY,QAAQ,IAAI;EACxB,aAAa,QAAQ,IAAI;EACzB,UAAU,QAAQ,IAAI;CACxB,EACF;AACF;AAEA,SAAgB,4BACd,SACkB;;;;;;;;CAQlB,OAAO,OAAM,aAAY;EACvB,MAAM,aAAa,aAAa;EAEhC,MAAM,EAAE,UAAU,OADH,aAAa,OAAO,UAAU,OAAO;EAEpD,MAAM,uBAAuB,wBAAwB;EAErD,IAAI,YAAY;GAEd,MAAM,EAAE,IAAI,MAAM,KAAK,GAAG,oBACxB;GACF,OAAO,IAAI,MAAM;IACf,GAAG;IACH,GAAG;GACL,CAAsB;EACxB;EACA,OAAO,IAAI,MAAM;GACf,GAAG;GACH,GAAG;EACL,CAAuB;CACzB;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"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import { OtlpHttpConfiguration } from "../../../configuration/otlp-http-configuration.cjs";
|
|
3
3
|
import * as http from "http";
|
|
4
4
|
import * as https from "https";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
5
|
+
export type HttpAgentFactory = (protocol: string) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;
|
|
6
|
+
export interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
8
7
|
/**
|
|
9
8
|
* Factory function for creating agents.
|
|
10
9
|
*
|
|
@@ -23,7 +22,5 @@ interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
|
23
22
|
*/
|
|
24
23
|
userAgent?: string;
|
|
25
24
|
}
|
|
26
|
-
declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { HttpAgentFactory, OtlpNodeHttpConfiguration, httpAgentFactoryFromOptions };
|
|
25
|
+
export declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
|
|
29
26
|
//# sourceMappingURL=otlp-node-http-configuration.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.d.cts","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"otlp-node-http-configuration.d.cts","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.d.ts"],"mappings":";;;;YAKY,oBAAoB,qBAAqB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,KAAK,SAAS,QAAQ,MAAM;iBACnG,kCAAkC;;;;;;;;;;;EAW/C,cAAc;;;;;;EAMd;;wBAEoB,4BAA4B,SAAS,KAAK,eAAe,MAAM,eAAe"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import { OtlpHttpConfiguration } from "../../../configuration/otlp-http-configuration.mjs";
|
|
3
3
|
import * as http from "http";
|
|
4
4
|
import * as https from "https";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
5
|
+
export type HttpAgentFactory = (protocol: string) => http.Agent | https.Agent | Promise<http.Agent> | Promise<https.Agent>;
|
|
6
|
+
export interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
8
7
|
/**
|
|
9
8
|
* Factory function for creating agents.
|
|
10
9
|
*
|
|
@@ -23,7 +22,5 @@ interface OtlpNodeHttpConfiguration extends OtlpHttpConfiguration {
|
|
|
23
22
|
*/
|
|
24
23
|
userAgent?: string;
|
|
25
24
|
}
|
|
26
|
-
declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { HttpAgentFactory, OtlpNodeHttpConfiguration, httpAgentFactoryFromOptions };
|
|
25
|
+
export declare function httpAgentFactoryFromOptions(options: http.AgentOptions | https.AgentOptions): HttpAgentFactory;
|
|
29
26
|
//# sourceMappingURL=otlp-node-http-configuration.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.d.mts","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"otlp-node-http-configuration.d.mts","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.d.ts"],"mappings":";;;;YAKY,oBAAoB,qBAAqB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,KAAK,SAAS,QAAQ,MAAM;iBACnG,kCAAkC;;;;;;;;;;;EAW/C,cAAc;;;;;;EAMd;;wBAEoB,4BAA4B,SAAS,KAAK,eAAe,MAAM,eAAe"}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
import { getHttpConfigurationDefaults, mergeOtlpHttpConfigurationWithDefaults } from "../../../configuration/otlp-http-configuration.mjs";
|
|
2
|
-
|
|
2
|
+
// src/platform/node/configuration/otlp-node-http-configuration.ts
|
|
3
|
+
function getEnvProxyAgentOptions() {
|
|
4
|
+
if (!process.env.HTTP_PROXY && !process.env.http_proxy && !process.env.HTTPS_PROXY && !process.env.https_proxy) return;
|
|
5
|
+
return { proxyEnv: {
|
|
6
|
+
HTTP_PROXY: process.env.HTTP_PROXY,
|
|
7
|
+
HTTPS_PROXY: process.env.HTTPS_PROXY,
|
|
8
|
+
NO_PROXY: process.env.NO_PROXY,
|
|
9
|
+
http_proxy: process.env.http_proxy,
|
|
10
|
+
https_proxy: process.env.https_proxy,
|
|
11
|
+
no_proxy: process.env.no_proxy
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
3
14
|
function httpAgentFactoryFromOptions(options) {
|
|
15
|
+
/**
|
|
16
|
+
* Node's native `proxyEnv` agent option is available from Node.js 22.21.0
|
|
17
|
+
* and 24.5.0. Earlier supported Node.js versions keep the option in the
|
|
18
|
+
* agent configuration but do not apply environment proxies to requests.
|
|
19
|
+
* Applications that need proxying on those versions should provide an
|
|
20
|
+
* agent factory with an explicit proxy implementation.
|
|
21
|
+
*/
|
|
4
22
|
return async (protocol) => {
|
|
5
23
|
const isInsecure = protocol === "http:";
|
|
6
24
|
const { Agent } = await (isInsecure ? import("http") : import("https"));
|
|
25
|
+
const envProxyAgentOptions = getEnvProxyAgentOptions();
|
|
7
26
|
if (isInsecure) {
|
|
8
27
|
const { ca, cert, key, ...insecureOptions } = options;
|
|
9
|
-
return new Agent(
|
|
28
|
+
return new Agent({
|
|
29
|
+
...envProxyAgentOptions,
|
|
30
|
+
...insecureOptions
|
|
31
|
+
});
|
|
10
32
|
}
|
|
11
|
-
return new Agent(
|
|
33
|
+
return new Agent({
|
|
34
|
+
...envProxyAgentOptions,
|
|
35
|
+
...options
|
|
36
|
+
});
|
|
12
37
|
};
|
|
13
38
|
}
|
|
14
39
|
/**
|
|
@@ -29,7 +54,6 @@ function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
|
29
54
|
agentFactory: httpAgentFactoryFromOptions({ keepAlive: true })
|
|
30
55
|
};
|
|
31
56
|
}
|
|
32
|
-
//#endregion
|
|
33
57
|
export { getNodeHttpConfigurationDefaults, httpAgentFactoryFromOptions, mergeOtlpNodeHttpConfigurationWithDefaults };
|
|
34
58
|
|
|
35
59
|
//# sourceMappingURL=otlp-node-http-configuration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-configuration.mjs","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from '../../../configuration/otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from '../../../configuration/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
|
|
1
|
+
{"version":3,"file":"otlp-node-http-configuration.mjs","names":[],"sources":["../../../../src/platform/node/configuration/otlp-node-http-configuration.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from '../../../configuration/otlp-http-configuration';\nimport {\n getHttpConfigurationDefaults,\n mergeOtlpHttpConfigurationWithDefaults,\n} from '../../../configuration/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\nfunction getEnvProxyAgentOptions():\n { proxyEnv: NodeJS.ProcessEnv } | undefined {\n if (\n !process.env.HTTP_PROXY &&\n !process.env.http_proxy &&\n !process.env.HTTPS_PROXY &&\n !process.env.https_proxy\n ) {\n return undefined;\n }\n\n return {\n proxyEnv: {\n HTTP_PROXY: process.env.HTTP_PROXY,\n HTTPS_PROXY: process.env.HTTPS_PROXY,\n NO_PROXY: process.env.NO_PROXY,\n http_proxy: process.env.http_proxy,\n https_proxy: process.env.https_proxy,\n no_proxy: process.env.no_proxy,\n },\n };\n}\n\nexport function httpAgentFactoryFromOptions(\n options: http.AgentOptions | https.AgentOptions\n): HttpAgentFactory {\n /**\n * Node's native `proxyEnv` agent option is available from Node.js 22.21.0\n * and 24.5.0. Earlier supported Node.js versions keep the option in the\n * agent configuration but do not apply environment proxies to requests.\n * Applications that need proxying on those versions should provide an\n * agent factory with an explicit proxy implementation.\n */\n return async protocol => {\n const isInsecure = protocol === 'http:';\n const module = isInsecure ? import('http') : import('https');\n const { Agent } = await module;\n const envProxyAgentOptions = getEnvProxyAgentOptions();\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({\n ...envProxyAgentOptions,\n ...insecureOptions,\n } as http.AgentOptions);\n }\n return new Agent({\n ...envProxyAgentOptions,\n ...options,\n } as https.AgentOptions);\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,SAAS,0BACqC;CAC5C,IACE,CAAC,QAAQ,IAAI,cACb,CAAC,QAAQ,IAAI,cACb,CAAC,QAAQ,IAAI,eACb,CAAC,QAAQ,IAAI,aAEb;CAGF,OAAO,EACL,UAAU;EACR,YAAY,QAAQ,IAAI;EACxB,aAAa,QAAQ,IAAI;EACzB,UAAU,QAAQ,IAAI;EACtB,YAAY,QAAQ,IAAI;EACxB,aAAa,QAAQ,IAAI;EACzB,UAAU,QAAQ,IAAI;CACxB,EACF;AACF;AAEA,SAAgB,4BACd,SACkB;;;;;;;;CAQlB,OAAO,OAAM,aAAY;EACvB,MAAM,aAAa,aAAa;EAEhC,MAAM,EAAE,UAAU,OADH,aAAa,OAAO,UAAU,OAAO;EAEpD,MAAM,uBAAuB,wBAAwB;EAErD,IAAI,YAAY;GAEd,MAAM,EAAE,IAAI,MAAM,KAAK,GAAG,oBACxB;GACF,OAAO,IAAI,MAAM;IACf,GAAG;IACH,GAAG;GACL,CAAsB;EACxB;EACA,OAAO,IAAI,MAAM;GACf,GAAG;GACH,GAAG;EACL,CAAuB;CACzB;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,14 +1,14 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_shared_env_configuration = require("../../../configuration/shared-env-configuration.cjs");
|
|
2
3
|
const require_shared_configuration = require("../../../configuration/shared-configuration.cjs");
|
|
3
4
|
const require_otlp_node_http_configuration = require("./otlp-node-http-configuration.cjs");
|
|
4
|
-
const require_shared_env_configuration = require("../../../configuration/shared-env-configuration.cjs");
|
|
5
5
|
let _opentelemetry_core = require("@opentelemetry/core");
|
|
6
6
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
7
7
|
let fs = require("fs");
|
|
8
8
|
fs = require_runtime.__toESM(fs);
|
|
9
9
|
let path = require("path");
|
|
10
10
|
path = require_runtime.__toESM(path);
|
|
11
|
-
|
|
11
|
+
// src/platform/node/configuration/otlp-node-http-env-configuration.ts
|
|
12
12
|
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
13
13
|
const signalSpecificRawHeaders = (0, _opentelemetry_core.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`);
|
|
14
14
|
const nonSignalSpecificRawHeaders = (0, _opentelemetry_core.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS");
|
|
@@ -25,7 +25,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function appendResourcePathToUrl(url, path
|
|
28
|
+
function appendResourcePathToUrl(url, path) {
|
|
29
29
|
try {
|
|
30
30
|
new URL(url);
|
|
31
31
|
} catch {
|
|
@@ -33,11 +33,11 @@ function appendResourcePathToUrl(url, path$1) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!url.endsWith("/")) url = url + "/";
|
|
36
|
-
url += path
|
|
36
|
+
url += path;
|
|
37
37
|
try {
|
|
38
38
|
new URL(url);
|
|
39
39
|
} catch {
|
|
40
|
-
_opentelemetry_api.diag.warn(`Configuration: Provided URL appended with '${path
|
|
40
|
+
_opentelemetry_api.diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
return url;
|
|
@@ -92,7 +92,6 @@ function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourc
|
|
|
92
92
|
})
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
//#endregion
|
|
96
95
|
exports.getNodeHttpConfigurationFromEnvironment = getNodeHttpConfigurationFromEnvironment;
|
|
97
96
|
|
|
98
97
|
//# sourceMappingURL=otlp-node-http-env-configuration.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-node-http-env-configuration.cjs","names":["getStringFromEnv","parseKeyPairsIntoRecord","
|
|
1
|
+
{"version":3,"file":"otlp-node-http-env-configuration.cjs","names":["getStringFromEnv","parseKeyPairsIntoRecord","diag","getSharedConfigurationFromEnvironment","wrapStaticHeadersInFunction","httpAgentFactoryFromOptions"],"sources":["../../../../src/platform/node/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 '../../../configuration/shared-env-configuration';\nimport { wrapStaticHeadersInFunction } from '../../../configuration/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;EACNC,mBAAAA,KAAK,KACH,oEAAoE,IAAI,6BAC1E;EACA;CACF;AACF;AAEA,SAAS,wBACP,KACA,MACoB;CACpB,IAAI;EAEF,IAAI,IAAI,GAAG;CACb,QAAQ;EACNA,mBAAAA,KAAK,KACH,oEAAoE,IAAI,6BAC1E;EACA;CACF;CAEA,IAAI,CAAC,IAAI,SAAS,GAAG,GACnB,MAAM,MAAM;CAEd,OAAO;CAEP,IAAI;EAEF,IAAI,IAAI,GAAG;CACb,QAAQ;EACNA,mBAAAA,KAAK,KACH,8CAA8C,KAAK,sDAAsD,IAAI,EAC/G;EACA;CACF;CAEA,OAAO;AACT;AAEA,SAAS,yBACP,oBACoB;CACpB,MAAM,UAAA,GAASF,oBAAAA,iBAAAA,CAAiB,6BAA6B;CAC7D,IAAI,WAAW,KAAA,GACb;CAEF,OAAO,wBAAwB,QAAQ,kBAAkB;AAC3D;AAEA,SAAS,sBAAsB,kBAA8C;CAC3E,MAAM,UAAA,GAASA,oBAAAA,iBAAAA,CACb,sBAAsB,iBAAiB,UACzC;CACA,IAAI,WAAW,KAAA,GACb;CAEF,OAAO,4BAA4B,MAAM;AAC3C;AAEA,SAAS,gBACP,sBACA,yBACA,gBACoB;CACpB,MAAM,sBAAA,GAAqBA,oBAAAA,iBAAAA,CAAiB,oBAAoB;CAChE,MAAM,yBAAA,GAAwBA,oBAAAA,iBAAAA,CAAiB,uBAAuB;CACtE,MAAM,WAAW,sBAAsB;CAEvC,IAAI,YAAY,MACd,IAAI;EACF,OAAO,GAAG,aAAa,KAAK,QAAQ,QAAQ,IAAI,GAAG,QAAQ,CAAC;CAC9D,QAAQ;EACNE,mBAAAA,KAAK,KAAK,cAAc;EACxB;CACF;MAEA;AAEJ;AAEA,SAAS,4BACP,kBACoB;CACpB,OAAO,gBACL,sBAAsB,iBAAiB,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,GAAGC,iCAAAA,sCAAsC,gBAAgB;EACzD,KACE,sBAAsB,gBAAgB,KACtC,yBAAyB,kBAAkB;EAC7C,SAASC,6BAAAA,4BACP,wBAAwB,gBAAgB,CAC1C;EACA,cAAcC,qCAAAA,4BAA4B;GACxC,WAAW;GACX,IAAI,0BAA0B,gBAAgB;GAC9C,MAAM,4BAA4B,gBAAgB;GAClD,KAAK,oBAAoB,gBAAgB;EAC3C,CAAC;CACH;AACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { getSharedConfigurationFromEnvironment } from "../../../configuration/shared-env-configuration.mjs";
|
|
1
2
|
import { wrapStaticHeadersInFunction } from "../../../configuration/shared-configuration.mjs";
|
|
2
3
|
import { httpAgentFactoryFromOptions } from "./otlp-node-http-configuration.mjs";
|
|
3
|
-
import { getSharedConfigurationFromEnvironment } from "../../../configuration/shared-env-configuration.mjs";
|
|
4
4
|
import { getStringFromEnv, parseKeyPairsIntoRecord } from "@opentelemetry/core";
|
|
5
5
|
import { diag } from "@opentelemetry/api";
|
|
6
6
|
import * as fs from "fs";
|
|
7
7
|
import * as path from "path";
|
|
8
|
-
|
|
8
|
+
// src/platform/node/configuration/otlp-node-http-env-configuration.ts
|
|
9
9
|
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
10
10
|
const signalSpecificRawHeaders = getStringFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`);
|
|
11
11
|
const nonSignalSpecificRawHeaders = getStringFromEnv("OTEL_EXPORTER_OTLP_HEADERS");
|
|
@@ -89,7 +89,6 @@ function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourc
|
|
|
89
89
|
})
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
export { getNodeHttpConfigurationFromEnvironment };
|
|
94
93
|
|
|
95
94
|
//# sourceMappingURL=otlp-node-http-env-configuration.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { httpAgentFactoryFromOptions } from "./configuration/otlp-node-http-configuration.cjs";
|
|
2
2
|
import { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics } from "./otlp-http-export-delegate.cjs";
|
|
3
3
|
import { getSharedConfigurationFromEnvironment } from "../../configuration/shared-env-configuration.cjs";
|
|
4
|
-
import { OTLPExporterNodeConfigBase } from "./configuration/legacy-node-configuration.cjs";
|
|
5
4
|
import { convertLegacyHttpOptions } from "./configuration/convert-legacy-node-http-options.cjs";
|
|
5
|
+
import { OTLPExporterNodeConfigBase } from "./configuration/legacy-node-configuration.cjs";
|
|
6
6
|
export { type OTLPExporterNodeConfigBase, convertLegacyHttpOptions, createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, getSharedConfigurationFromEnvironment, httpAgentFactoryFromOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { httpAgentFactoryFromOptions } from "./configuration/otlp-node-http-configuration.mjs";
|
|
2
2
|
import { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics } from "./otlp-http-export-delegate.mjs";
|
|
3
3
|
import { getSharedConfigurationFromEnvironment } from "../../configuration/shared-env-configuration.mjs";
|
|
4
|
-
import { OTLPExporterNodeConfigBase } from "./configuration/legacy-node-configuration.mjs";
|
|
5
4
|
import { convertLegacyHttpOptions } from "./configuration/convert-legacy-node-http-options.mjs";
|
|
5
|
+
import { OTLPExporterNodeConfigBase } from "./configuration/legacy-node-configuration.mjs";
|
|
6
6
|
export { type OTLPExporterNodeConfigBase, convertLegacyHttpOptions, createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, getSharedConfigurationFromEnvironment, httpAgentFactoryFromOptions };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_types = require("../../types.cjs");
|
|
2
|
-
const require_bounded_queue_export_promise_handler = require("../../bounded-queue-export-promise-handler.cjs");
|
|
3
1
|
const require_otlp_export_delegate = require("../../otlp-export-delegate.cjs");
|
|
4
|
-
const require_semconv = require("../../semconv.cjs");
|
|
5
|
-
const require_ExporterMetrics = require("../../ExporterMetrics.cjs");
|
|
6
2
|
const require_http_exporter_transport = require("./transport/http-exporter-transport.cjs");
|
|
3
|
+
const require_bounded_queue_export_promise_handler = require("../../bounded-queue-export-promise-handler.cjs");
|
|
7
4
|
const require_retrying_transport = require("../../retrying-transport.cjs");
|
|
8
|
-
|
|
5
|
+
const require_types = require("../../types.cjs");
|
|
6
|
+
const require_semconv = require("../../semconv.cjs");
|
|
7
|
+
const require_ExporterMetrics = require("../../ExporterMetrics.cjs");
|
|
8
|
+
// src/platform/node/otlp-http-export-delegate.ts
|
|
9
9
|
function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) {
|
|
10
10
|
return new require_ExporterMetrics.ExporterMetrics({
|
|
11
11
|
componentType: metricsComponentType,
|
|
@@ -27,7 +27,6 @@ function createOtlpHttpExportDelegate(options, serializer, metricsComponentType,
|
|
|
27
27
|
metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider)
|
|
28
28
|
}, { timeout: options.timeoutMillis });
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
exports.createOtlpHttpExportDelegate = createOtlpHttpExportDelegate;
|
|
32
31
|
exports.createOtlpHttpExporterMetrics = createOtlpHttpExporterMetrics;
|
|
33
32
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { ExporterMetrics } from "../../ExporterMetrics.cjs";
|
|
2
1
|
import { IOtlpExportDelegate } from "../../otlp-export-delegate.cjs";
|
|
3
2
|
import { OtlpNodeHttpConfiguration } from "./configuration/otlp-node-http-configuration.cjs";
|
|
3
|
+
import { ExporterMetrics } from "../../ExporterMetrics.cjs";
|
|
4
4
|
import { IExporterMetricsHelper, ISerializer } from "@opentelemetry/otlp-transformer";
|
|
5
5
|
import { MeterProvider } from "@opentelemetry/api";
|
|
6
|
-
|
|
7
|
-
declare function
|
|
8
|
-
declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics };
|
|
6
|
+
export declare function createOtlpHttpExporterMetrics<Internal>(metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, url: string | undefined, meterProvider: MeterProvider | undefined): ExporterMetrics<Internal>;
|
|
7
|
+
export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
|
|
11
8
|
//# sourceMappingURL=otlp-http-export-delegate.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.d.cts","names":[],"sources":["../../../src/platform/node/otlp-http-export-delegate.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"otlp-http-export-delegate.d.cts","names":[],"sources":["../../../src/platform/node/otlp-http-export-delegate.d.ts"],"mappings":";;;;;wBAKwB,8BAA8B,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;wBACnN,6BAA6B,UAAU,UAAU,SAAS,2BAA2B,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,4BAA4B,oBAAoB"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { ExporterMetrics } from "../../ExporterMetrics.mjs";
|
|
2
1
|
import { IOtlpExportDelegate } from "../../otlp-export-delegate.mjs";
|
|
3
2
|
import { OtlpNodeHttpConfiguration } from "./configuration/otlp-node-http-configuration.mjs";
|
|
3
|
+
import { ExporterMetrics } from "../../ExporterMetrics.mjs";
|
|
4
4
|
import { MeterProvider } from "@opentelemetry/api";
|
|
5
5
|
import { IExporterMetricsHelper, ISerializer } from "@opentelemetry/otlp-transformer";
|
|
6
|
-
|
|
7
|
-
declare function
|
|
8
|
-
declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics };
|
|
6
|
+
export declare function createOtlpHttpExporterMetrics<Internal>(metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, url: string | undefined, meterProvider: MeterProvider | undefined): ExporterMetrics<Internal>;
|
|
7
|
+
export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
|
|
11
8
|
//# sourceMappingURL=otlp-http-export-delegate.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-http-export-delegate.d.mts","names":[],"sources":["../../../src/platform/node/otlp-http-export-delegate.d.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"otlp-http-export-delegate.d.mts","names":[],"sources":["../../../src/platform/node/otlp-http-export-delegate.d.ts"],"mappings":";;;;;wBAKwB,8BAA8B,UAAU,8BAA8B,uBAAuB,uBAAuB,WAAW,yBAAyB,eAAe,4BAA4B,gBAAgB;wBACnN,6BAA6B,UAAU,UAAU,SAAS,2BAA2B,YAAY,YAAY,UAAU,WAAW,8BAA8B,uBAAuB,uBAAuB,WAAW,eAAe,4BAA4B,oBAAoB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { OTLPExporterError } from "../../types.mjs";
|
|
2
|
-
import { createBoundedQueueExportPromiseHandler } from "../../bounded-queue-export-promise-handler.mjs";
|
|
3
1
|
import { createOtlpExportDelegate } from "../../otlp-export-delegate.mjs";
|
|
4
|
-
import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "../../semconv.mjs";
|
|
5
|
-
import { ExporterMetrics } from "../../ExporterMetrics.mjs";
|
|
6
2
|
import { createHttpExporterTransport } from "./transport/http-exporter-transport.mjs";
|
|
3
|
+
import { createBoundedQueueExportPromiseHandler } from "../../bounded-queue-export-promise-handler.mjs";
|
|
7
4
|
import { createRetryingTransport } from "../../retrying-transport.mjs";
|
|
8
|
-
|
|
5
|
+
import { OTLPExporterError } from "../../types.mjs";
|
|
6
|
+
import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "../../semconv.mjs";
|
|
7
|
+
import { ExporterMetrics } from "../../ExporterMetrics.mjs";
|
|
8
|
+
// src/platform/node/otlp-http-export-delegate.ts
|
|
9
9
|
function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) {
|
|
10
10
|
return new ExporterMetrics({
|
|
11
11
|
componentType: metricsComponentType,
|
|
@@ -27,7 +27,6 @@ function createOtlpHttpExportDelegate(options, serializer, metricsComponentType,
|
|
|
27
27
|
metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider)
|
|
28
28
|
}, { timeout: options.timeoutMillis });
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=otlp-http-export-delegate.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_http_transport_utils = require("./http-transport-utils.cjs");
|
|
2
|
-
|
|
2
|
+
// src/platform/node/transport/http-exporter-transport.ts
|
|
3
3
|
var HttpExporterTransport = class {
|
|
4
4
|
_utils = null;
|
|
5
5
|
_parameters;
|
|
@@ -32,7 +32,6 @@ async function requestFunctionFactory(protocol) {
|
|
|
32
32
|
function createHttpExporterTransport(parameters) {
|
|
33
33
|
return new HttpExporterTransport(parameters);
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
exports.createHttpExporterTransport = createHttpExporterTransport;
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=http-exporter-transport.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exporter-transport.cjs","names":["sendWithHttp"],"sources":["../../../../src/platform/node/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;
|
|
1
|
+
{"version":3,"file":"http-exporter-transport.cjs","names":["sendWithHttp"],"sources":["../../../../src/platform/node/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;CAChD,SAAuB;CACvB;CAER,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,5 +1,5 @@
|
|
|
1
1
|
import { sendWithHttp } from "./http-transport-utils.mjs";
|
|
2
|
-
|
|
2
|
+
// src/platform/node/transport/http-exporter-transport.ts
|
|
3
3
|
var HttpExporterTransport = class {
|
|
4
4
|
_utils = null;
|
|
5
5
|
_parameters;
|
|
@@ -32,7 +32,6 @@ async function requestFunctionFactory(protocol) {
|
|
|
32
32
|
function createHttpExporterTransport(parameters) {
|
|
33
33
|
return new HttpExporterTransport(parameters);
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { createHttpExporterTransport };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=http-exporter-transport.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exporter-transport.mjs","names":[],"sources":["../../../../src/platform/node/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;
|
|
1
|
+
{"version":3,"file":"http-exporter-transport.mjs","names":[],"sources":["../../../../src/platform/node/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;CAChD,SAAuB;CACvB;CAER,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,11 +1,11 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_is_export_retryable = require("../../../is-export-retryable.cjs");
|
|
2
3
|
const require_types = require("../../../types.cjs");
|
|
3
4
|
const require_version = require("../../../version.cjs");
|
|
4
|
-
const require_is_export_retryable = require("../../../is-export-retryable.cjs");
|
|
5
5
|
let zlib = require("zlib");
|
|
6
6
|
zlib = require_runtime.__toESM(zlib);
|
|
7
7
|
let stream = require("stream");
|
|
8
|
-
|
|
8
|
+
// src/platform/node/transport/http-transport-utils.ts
|
|
9
9
|
const DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${require_version.VERSION}`;
|
|
10
10
|
/**
|
|
11
11
|
* Maximum response body size (4 MB) that the HTTP transport will read.
|
|
@@ -128,7 +128,6 @@ function isHttpTransportNetworkErrorRetryable(error) {
|
|
|
128
128
|
if ("code" in error && typeof error.code === "string") return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
|
-
//#endregion
|
|
132
131
|
exports.MAX_RESPONSE_BODY_SIZE = MAX_RESPONSE_BODY_SIZE;
|
|
133
132
|
exports.compressAndSend = compressAndSend;
|
|
134
133
|
exports.sendWithHttp = sendWithHttp;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { isExportHTTPErrorRetryable, parseRetryAfterToMills } from "../../../is-export-retryable.mjs";
|
|
1
2
|
import { OTLPExporterError } from "../../../types.mjs";
|
|
2
3
|
import { VERSION } from "../../../version.mjs";
|
|
3
|
-
import { isExportHTTPErrorRetryable, parseRetryAfterToMills } from "../../../is-export-retryable.mjs";
|
|
4
4
|
import * as zlib from "zlib";
|
|
5
5
|
import { Readable } from "stream";
|
|
6
|
-
|
|
6
|
+
// src/platform/node/transport/http-transport-utils.ts
|
|
7
7
|
const DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`;
|
|
8
8
|
/**
|
|
9
9
|
* Maximum response body size (4 MB) that the HTTP transport will read.
|
|
@@ -126,7 +126,6 @@ function isHttpTransportNetworkErrorRetryable(error) {
|
|
|
126
126
|
if ("code" in error && typeof error.code === "string") return RETRYABLE_NETWORK_ERROR_CODES.has(error.code);
|
|
127
127
|
return false;
|
|
128
128
|
}
|
|
129
|
-
//#endregion
|
|
130
129
|
export { MAX_RESPONSE_BODY_SIZE, compressAndSend, sendWithHttp };
|
|
131
130
|
|
|
132
131
|
//# sourceMappingURL=http-transport-utils.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
2
|
-
|
|
2
|
+
// src/retrying-transport.ts
|
|
3
3
|
const MAX_ATTEMPTS = 5;
|
|
4
4
|
const INITIAL_BACKOFF = 1e3;
|
|
5
5
|
const MAX_BACKOFF = 5e3;
|
|
@@ -56,7 +56,6 @@ var RetryingTransport = class {
|
|
|
56
56
|
function createRetryingTransport(options) {
|
|
57
57
|
return new RetryingTransport(options.transport);
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
exports.createRetryingTransport = createRetryingTransport;
|
|
61
60
|
|
|
62
61
|
//# sourceMappingURL=retrying-transport.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrying-transport.cjs","names":[],"sources":["../src/retrying-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 { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"],"mappings":";;AASA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAC3B,MAAM,SAAS;;;;AAKf,SAAS,YAAY;CACnB,OAAO,KAAK,OAAO,KAAK,IAAI,UAAU;AACxC;AAEA,IAAM,oBAAN,MAAsD;
|
|
1
|
+
{"version":3,"file":"retrying-transport.cjs","names":["diag"],"sources":["../src/retrying-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 { diag } from '@opentelemetry/api';\n\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\n\nclass RetryingTransport implements IExporterTransport {\n private _transport: IExporterTransport;\n\n constructor(transport: IExporterTransport) {\n this._transport = transport;\n }\n\n private retry(\n data: Uint8Array,\n timeoutMillis: number,\n inMillis: number\n ): Promise<ExportResponse> {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n\n async send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(\n Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF),\n 0\n );\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(\n `Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(\n remainingTimeoutMillis\n )}ms, not retrying further.`\n );\n return result;\n }\n\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n\n if (result.status === 'success') {\n diag.verbose(\n `Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`\n );\n } else if (result.status === 'retryable') {\n diag.info(\n `Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`\n );\n } else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n\n return result;\n }\n\n shutdown() {\n return this._transport.shutdown();\n }\n}\n\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options: {\n // Underlying transport to wrap.\n transport: IExporterTransport;\n}): IExporterTransport {\n return new RetryingTransport(options.transport);\n}\n"],"mappings":";;AASA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAC3B,MAAM,SAAS;;;;AAKf,SAAS,YAAY;CACnB,OAAO,KAAK,OAAO,KAAK,IAAI,UAAU;AACxC;AAEA,IAAM,oBAAN,MAAsD;CAC5C;CAER,YAAY,WAA+B;EACzC,KAAK,aAAa;CACpB;CAEQ,MACN,MACA,eACA,UACyB;EACzB,OAAO,IAAI,SAAS,SAAS,WAAW;GACtC,iBAAiB;IACf,KAAK,WAAW,KAAK,MAAM,aAAa,CAAC,CAAC,KAAK,SAAS,MAAM;GAChE,GAAG,QAAQ;EACb,CAAC;CACH;CAEA,MAAM,KAAK,MAAkB,eAAgD;EAC3E,IAAI,WAAW;EACf,IAAI,cAAc;EAElB,MAAM,WAAW,KAAK,IAAI,IAAI;EAC9B,IAAI,SAAS,MAAM,KAAK,WAAW,KAAK,MAAM,aAAa;EAE3D,OAAO,OAAO,WAAW,eAAe,WAAW,GAAG;GACpD;GAGA,MAAM,UAAU,KAAK,IACnB,KAAK,IAAI,eAAe,IAAI,UAAU,IAAI,WAAW,GACrD,CACF;GACA,cAAc,cAAc;GAC5B,MAAM,gBAAgB,OAAO,iBAAiB;GAG9C,MAAM,yBAAyB,WAAW,KAAK,IAAI;GACnD,IAAI,gBAAgB,wBAAwB;IAC1CA,mBAAAA,KAAK,KACH,qBAAqB,KAAK,MAAM,aAAa,EAAE,+BAA+B,KAAK,MACjF,sBACF,EAAE,0BACJ;IACA,OAAO;GACT;GAEAA,mBAAAA,KAAK,QAAQ,8BAA8B,KAAK,MAAM,aAAa,EAAE,GAAG;GACxE,SAAS,MAAM,KAAK,MAAM,MAAM,wBAAwB,aAAa;EACvE;EAEA,IAAI,OAAO,WAAW,WACpBA,mBAAAA,KAAK,QACH,0BAA0B,eAAe,SAAS,iBACpD;OACK,IAAI,OAAO,WAAW,aAC3BA,mBAAAA,KAAK,KACH,+CAA+C,aAAa,GAC9D;OAEAA,mBAAAA,KAAK,KAAK,2CAA2C,OAAO,OAAO;EAGrE,OAAO;CACT;CAEA,WAAW;EACT,OAAO,KAAK,WAAW,SAAS;CAClC;AACF;;;;AAKA,SAAgB,wBAAwB,SAGjB;CACrB,OAAO,IAAI,kBAAkB,QAAQ,SAAS;AAChD"}
|