@opentelemetry/otlp-exporter-base 0.28.0 → 0.29.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/build/esm/OTLPExporterBase.d.ts +40 -0
- package/build/esm/OTLPExporterBase.js +104 -0
- package/build/esm/OTLPExporterBase.js.map +1 -0
- package/build/esm/index.d.ts +5 -0
- package/build/esm/index.js +20 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/platform/browser/OTLPExporterBrowserBase.d.ts +18 -0
- package/build/esm/platform/browser/OTLPExporterBrowserBase.js +91 -0
- package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +1 -0
- package/build/esm/platform/browser/index.d.ts +2 -0
- package/build/esm/platform/browser/index.js +17 -0
- package/build/esm/platform/browser/index.js.map +1 -0
- package/build/esm/platform/browser/util.d.ts +21 -0
- package/build/esm/platform/browser/util.js +108 -0
- package/build/esm/platform/browser/util.js.map +1 -0
- package/build/esm/platform/index.d.ts +3 -0
- package/build/esm/platform/index.js +18 -0
- package/build/esm/platform/index.js.map +1 -0
- package/build/esm/platform/node/OTLPExporterNodeBase.d.ts +20 -0
- package/build/esm/platform/node/OTLPExporterNodeBase.js +79 -0
- package/build/esm/platform/node/OTLPExporterNodeBase.js.map +1 -0
- package/build/esm/platform/node/index.d.ts +4 -0
- package/build/esm/platform/node/index.js +19 -0
- package/build/esm/platform/node/index.js.map +1 -0
- package/build/esm/platform/node/types.d.ts +17 -0
- package/build/esm/platform/node/types.js +6 -0
- package/build/esm/platform/node/types.js.map +1 -0
- package/build/esm/platform/node/util.d.ts +19 -0
- package/build/esm/platform/node/util.js +151 -0
- package/build/esm/platform/node/util.js.map +1 -0
- package/build/esm/types.d.ts +37 -0
- package/build/esm/types.js +46 -0
- package/build/esm/types.js.map +1 -0
- package/build/esm/util.d.ts +27 -0
- package/build/esm/util.js +110 -0
- package/build/esm/util.js.map +1 -0
- package/build/esm/version.d.ts +2 -0
- package/build/esm/version.js +18 -0
- package/build/esm/version.js.map +1 -0
- package/build/esnext/OTLPExporterBase.d.ts +40 -0
- package/build/esnext/OTLPExporterBase.js +100 -0
- package/build/esnext/OTLPExporterBase.js.map +1 -0
- package/build/esnext/index.d.ts +5 -0
- package/build/esnext/index.js +20 -0
- package/build/esnext/index.js.map +1 -0
- package/build/esnext/platform/browser/OTLPExporterBrowserBase.d.ts +18 -0
- package/build/esnext/platform/browser/OTLPExporterBrowserBase.js +70 -0
- package/build/esnext/platform/browser/OTLPExporterBrowserBase.js.map +1 -0
- package/build/esnext/platform/browser/index.d.ts +2 -0
- package/build/esnext/platform/browser/index.js +17 -0
- package/build/esnext/platform/browser/index.js.map +1 -0
- package/build/esnext/platform/browser/util.d.ts +21 -0
- package/build/esnext/platform/browser/util.js +80 -0
- package/build/esnext/platform/browser/util.js.map +1 -0
- package/build/esnext/platform/index.d.ts +3 -0
- package/build/esnext/platform/index.js +18 -0
- package/build/esnext/platform/index.js.map +1 -0
- package/build/esnext/platform/node/OTLPExporterNodeBase.d.ts +20 -0
- package/build/esnext/platform/node/OTLPExporterNodeBase.js +58 -0
- package/build/esnext/platform/node/OTLPExporterNodeBase.js.map +1 -0
- package/build/esnext/platform/node/index.d.ts +4 -0
- package/build/esnext/platform/node/index.js +19 -0
- package/build/esnext/platform/node/index.js.map +1 -0
- package/build/esnext/platform/node/types.d.ts +17 -0
- package/build/esnext/platform/node/types.js +6 -0
- package/build/esnext/platform/node/types.js.map +1 -0
- package/build/esnext/platform/node/util.d.ts +19 -0
- package/build/esnext/platform/node/util.js +140 -0
- package/build/esnext/platform/node/util.js.map +1 -0
- package/build/esnext/types.d.ts +37 -0
- package/build/esnext/types.js +27 -0
- package/build/esnext/types.js.map +1 -0
- package/build/esnext/util.d.ts +27 -0
- package/build/esnext/util.js +92 -0
- package/build/esnext/util.js.map +1 -0
- package/build/esnext/version.d.ts +2 -0
- package/build/esnext/version.js +18 -0
- package/build/esnext/version.js.map +1 -0
- package/build/src/OTLPExporterBase.d.ts +1 -0
- package/build/src/OTLPExporterBase.js +2 -0
- package/build/src/OTLPExporterBase.js.map +1 -1
- package/build/src/platform/browser/OTLPExporterBrowserBase.js +1 -1
- package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
- package/build/src/platform/browser/util.d.ts +1 -1
- package/build/src/platform/browser/util.js +12 -1
- package/build/src/platform/browser/util.js.map +1 -1
- package/build/src/platform/node/util.js +37 -8
- package/build/src/platform/node/util.js.map +1 -1
- package/build/src/types.d.ts +3 -0
- package/build/src/types.js.map +1 -1
- package/build/src/util.d.ts +21 -1
- package/build/src/util.js +62 -5
- package/build/src/util.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +10 -4
package/build/src/util.js
CHANGED
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.invalidTimeout = exports.configureExporterTimeout = exports.appendRootPathToUrlIfNeeded = exports.appendResourcePathToUrl = exports.parseHeaders = void 0;
|
|
19
19
|
const api_1 = require("@opentelemetry/api");
|
|
20
|
+
const core_1 = require("@opentelemetry/core");
|
|
21
|
+
const DEFAULT_TRACE_TIMEOUT = 10000;
|
|
20
22
|
/**
|
|
21
23
|
* Parses headers from config leaving only those that have defined values
|
|
22
24
|
* @param partialHeaders
|
|
@@ -34,10 +36,65 @@ function parseHeaders(partialHeaders = {}) {
|
|
|
34
36
|
return headers;
|
|
35
37
|
}
|
|
36
38
|
exports.parseHeaders = parseHeaders;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Adds path (version + signal) to a no per-signal endpoint
|
|
41
|
+
* @param url
|
|
42
|
+
* @param path
|
|
43
|
+
* @returns url + path
|
|
44
|
+
*/
|
|
45
|
+
function appendResourcePathToUrl(url, path) {
|
|
46
|
+
if (!url.endsWith('/')) {
|
|
47
|
+
url = url + '/';
|
|
48
|
+
}
|
|
40
49
|
return url + path;
|
|
41
50
|
}
|
|
42
|
-
exports.
|
|
51
|
+
exports.appendResourcePathToUrl = appendResourcePathToUrl;
|
|
52
|
+
/**
|
|
53
|
+
* Adds root path to signal specific endpoint when endpoint contains no path part and no root path
|
|
54
|
+
* @param url
|
|
55
|
+
* @param path
|
|
56
|
+
* @returns url
|
|
57
|
+
*/
|
|
58
|
+
function appendRootPathToUrlIfNeeded(url, path) {
|
|
59
|
+
if (!url.includes(path) && !url.endsWith('/')) {
|
|
60
|
+
url = url + '/';
|
|
61
|
+
}
|
|
62
|
+
return url;
|
|
63
|
+
}
|
|
64
|
+
exports.appendRootPathToUrlIfNeeded = appendRootPathToUrlIfNeeded;
|
|
65
|
+
/**
|
|
66
|
+
* Configure exporter trace timeout value from passed in value or environment variables
|
|
67
|
+
* @param timeoutMillis
|
|
68
|
+
* @returns timeout value in milliseconds
|
|
69
|
+
*/
|
|
70
|
+
function configureExporterTimeout(timeoutMillis) {
|
|
71
|
+
if (typeof timeoutMillis === 'number') {
|
|
72
|
+
if (timeoutMillis <= 0) {
|
|
73
|
+
// OTLP exporter configured timeout - using default value of 10000ms
|
|
74
|
+
return invalidTimeout(timeoutMillis, DEFAULT_TRACE_TIMEOUT);
|
|
75
|
+
}
|
|
76
|
+
return timeoutMillis;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return getExporterTimeoutFromEnv();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.configureExporterTimeout = configureExporterTimeout;
|
|
83
|
+
function getExporterTimeoutFromEnv() {
|
|
84
|
+
var _a;
|
|
85
|
+
const definedTimeout = Number((_a = (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT) !== null && _a !== void 0 ? _a : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);
|
|
86
|
+
if (definedTimeout <= 0) {
|
|
87
|
+
// OTLP exporter configured timeout - using default value of 10000ms
|
|
88
|
+
return invalidTimeout(definedTimeout, DEFAULT_TRACE_TIMEOUT);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return definedTimeout;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// OTLP exporter configured timeout - using default value of 10000ms
|
|
95
|
+
function invalidTimeout(timeout, defaultTimeout) {
|
|
96
|
+
api_1.diag.warn('Timeout must be greater than 0', timeout);
|
|
97
|
+
return defaultTimeout;
|
|
98
|
+
}
|
|
99
|
+
exports.invalidTimeout = invalidTimeout;
|
|
43
100
|
//# sourceMappingURL=util.js.map
|
package/build/src/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAC1C,8CAA6C;AAE7C,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEpC;;;GAGG;AACH,SAAgB,YAAY,CAC1B,iBAAmD,EAAE;IAErD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtD,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM;YACL,UAAI,CAAC,IAAI,CAAC,WAAW,GAAG,uCAAuC,CAAC,CAAC;SAClE;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAZD,oCAYC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,C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CAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { getEnv } from '@opentelemetry/core';\n\nconst DEFAULT_TRACE_TIMEOUT = 10000;\n\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function parseHeaders(\n partialHeaders: Partial<Record<string, unknown>> = {}\n): Record<string, string> {\n const headers: Record<string, string> = {};\n Object.entries(partialHeaders).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n } else {\n diag.warn(`Header \"${key}\" has wrong value and will be ignored`);\n }\n });\n return headers;\n}\n\n/**\n * Adds path (version + signal) to a no per-signal endpoint\n * @param url\n * @param path\n * @returns url + path\n */\nexport function appendResourcePathToUrl(url: string, path: string): string {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n return url + path;\n}\n\n/**\n * Adds root path to signal specific endpoint when endpoint contains no path part and no root path\n * @param url\n * @param path\n * @returns url\n */\nexport function appendRootPathToUrlIfNeeded(url: string, path: string): string {\n if (!url.includes(path) && !url.endsWith('/')) {\n url = url + '/';\n }\n return url;\n}\n\n/**\n * Configure exporter trace timeout value from passed in value or environment variables\n * @param timeoutMillis\n * @returns timeout value in milliseconds\n */\nexport function configureExporterTimeout(timeoutMillis: number | undefined): number {\n if (typeof timeoutMillis === 'number') {\n if (timeoutMillis <= 0) {\n // OTLP exporter configured timeout - using default value of 10000ms\n return invalidTimeout(timeoutMillis, DEFAULT_TRACE_TIMEOUT);\n }\n return timeoutMillis;\n } else {\n return getExporterTimeoutFromEnv();\n }\n}\n\nfunction getExporterTimeoutFromEnv(): number {\n const definedTimeout =\n Number(getEnv().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT ??\n getEnv().OTEL_EXPORTER_OTLP_TIMEOUT);\n\n if (definedTimeout <= 0) {\n // OTLP exporter configured timeout - using default value of 10000ms\n return invalidTimeout(definedTimeout, DEFAULT_TRACE_TIMEOUT);\n } else {\n return definedTimeout;\n }\n}\n\n// OTLP exporter configured timeout - using default value of 10000ms\nexport function invalidTimeout(timeout: number, defaultTimeout: number): number {\n diag.warn('Timeout must be greater than 0', timeout);\n\n return defaultTimeout;\n}\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.29.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.29.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/otlp-exporter-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "OpenTelemetry OTLP Exporter base (for internal use only)",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
"node": ">=8.12.0"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
|
+
"build/esm/**/*.js",
|
|
49
|
+
"build/esm/**/*.js.map",
|
|
50
|
+
"build/esm/**/*.d.ts",
|
|
51
|
+
"build/esnext/**/*.js",
|
|
52
|
+
"build/esnext/**/*.js.map",
|
|
53
|
+
"build/esnext/**/*.d.ts",
|
|
48
54
|
"build/src/**/*.js",
|
|
49
55
|
"build/src/**/*.js.map",
|
|
50
56
|
"build/src/**/*.d.ts",
|
|
@@ -55,7 +61,7 @@
|
|
|
55
61
|
"access": "public"
|
|
56
62
|
},
|
|
57
63
|
"dependencies": {
|
|
58
|
-
"@opentelemetry/core": "1.
|
|
64
|
+
"@opentelemetry/core": "1.3.0"
|
|
59
65
|
},
|
|
60
66
|
"devDependencies": {
|
|
61
67
|
"@opentelemetry/api": "^1.0.0",
|
|
@@ -69,11 +75,11 @@
|
|
|
69
75
|
"nyc": "15.1.0",
|
|
70
76
|
"sinon": "12.0.1",
|
|
71
77
|
"ts-loader": "8.3.0",
|
|
72
|
-
"ts-mocha": "
|
|
78
|
+
"ts-mocha": "9.0.2",
|
|
73
79
|
"typescript": "4.4.4"
|
|
74
80
|
},
|
|
75
81
|
"peerDependencies": {
|
|
76
82
|
"@opentelemetry/api": "^1.0.0"
|
|
77
83
|
},
|
|
78
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "eda0b092db484855ded8b4837ba7fc19a377c5a7"
|
|
79
85
|
}
|