@opentelemetry/otlp-exporter-base 0.53.0 → 0.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/build/esm/OTLPExporterBase.d.ts +0 -8
  2. package/build/esm/OTLPExporterBase.js +0 -8
  3. package/build/esm/OTLPExporterBase.js.map +1 -1
  4. package/build/esm/configuration/otlp-http-configuration.d.ts +13 -0
  5. package/build/esm/configuration/otlp-http-configuration.js +67 -0
  6. package/build/esm/configuration/otlp-http-configuration.js.map +1 -0
  7. package/build/esm/configuration/otlp-http-env-configuration.d.ts +9 -0
  8. package/build/esm/configuration/otlp-http-env-configuration.js +104 -0
  9. package/build/esm/configuration/otlp-http-env-configuration.js.map +1 -0
  10. package/build/esm/configuration/shared-configuration.d.ts +22 -0
  11. package/build/esm/configuration/shared-configuration.js +44 -0
  12. package/build/esm/configuration/shared-configuration.js.map +1 -0
  13. package/build/esm/configuration/shared-env-configuration.d.ts +3 -0
  14. package/build/esm/configuration/shared-env-configuration.js +44 -0
  15. package/build/esm/configuration/shared-env-configuration.js.map +1 -0
  16. package/build/esm/index.d.ts +3 -1
  17. package/build/esm/index.js +3 -1
  18. package/build/esm/index.js.map +1 -1
  19. package/build/esm/platform/browser/OTLPExporterBrowserBase.d.ts +4 -3
  20. package/build/esm/platform/browser/OTLPExporterBrowserBase.js +18 -10
  21. package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  22. package/build/esm/platform/browser/xhr-transport.js +1 -1
  23. package/build/esm/platform/browser/xhr-transport.js.map +1 -1
  24. package/build/esm/platform/node/OTLPExporterNodeBase.d.ts +2 -2
  25. package/build/esm/platform/node/OTLPExporterNodeBase.js +18 -27
  26. package/build/esm/platform/node/OTLPExporterNodeBase.js.map +1 -1
  27. package/build/esm/platform/node/convert-legacy-agent-options.d.ts +12 -0
  28. package/build/esm/platform/node/convert-legacy-agent-options.js +27 -0
  29. package/build/esm/platform/node/convert-legacy-agent-options.js.map +1 -0
  30. package/build/esm/types.d.ts +1 -2
  31. package/build/esm/types.js.map +1 -1
  32. package/build/esm/util.d.ts +1 -27
  33. package/build/esm/util.js +1 -89
  34. package/build/esm/util.js.map +1 -1
  35. package/build/esm/version.d.ts +1 -1
  36. package/build/esm/version.js +1 -1
  37. package/build/esm/version.js.map +1 -1
  38. package/build/esnext/OTLPExporterBase.d.ts +0 -8
  39. package/build/esnext/OTLPExporterBase.js +0 -8
  40. package/build/esnext/OTLPExporterBase.js.map +1 -1
  41. package/build/esnext/configuration/otlp-http-configuration.d.ts +13 -0
  42. package/build/esnext/configuration/otlp-http-configuration.js +56 -0
  43. package/build/esnext/configuration/otlp-http-configuration.js.map +1 -0
  44. package/build/esnext/configuration/otlp-http-env-configuration.d.ts +9 -0
  45. package/build/esnext/configuration/otlp-http-env-configuration.js +93 -0
  46. package/build/esnext/configuration/otlp-http-env-configuration.js.map +1 -0
  47. package/build/esnext/configuration/shared-configuration.d.ts +22 -0
  48. package/build/esnext/configuration/shared-configuration.js +44 -0
  49. package/build/esnext/configuration/shared-configuration.js.map +1 -0
  50. package/build/esnext/configuration/shared-env-configuration.d.ts +3 -0
  51. package/build/esnext/configuration/shared-env-configuration.js +44 -0
  52. package/build/esnext/configuration/shared-env-configuration.js.map +1 -0
  53. package/build/esnext/index.d.ts +3 -1
  54. package/build/esnext/index.js +3 -1
  55. package/build/esnext/index.js.map +1 -1
  56. package/build/esnext/platform/browser/OTLPExporterBrowserBase.d.ts +4 -3
  57. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js +18 -10
  58. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  59. package/build/esnext/platform/browser/xhr-transport.js +1 -1
  60. package/build/esnext/platform/browser/xhr-transport.js.map +1 -1
  61. package/build/esnext/platform/node/OTLPExporterNodeBase.d.ts +2 -2
  62. package/build/esnext/platform/node/OTLPExporterNodeBase.js +18 -27
  63. package/build/esnext/platform/node/OTLPExporterNodeBase.js.map +1 -1
  64. package/build/esnext/platform/node/convert-legacy-agent-options.d.ts +12 -0
  65. package/build/esnext/platform/node/convert-legacy-agent-options.js +27 -0
  66. package/build/esnext/platform/node/convert-legacy-agent-options.js.map +1 -0
  67. package/build/esnext/types.d.ts +1 -2
  68. package/build/esnext/types.js.map +1 -1
  69. package/build/esnext/util.d.ts +1 -27
  70. package/build/esnext/util.js +1 -89
  71. package/build/esnext/util.js.map +1 -1
  72. package/build/esnext/version.d.ts +1 -1
  73. package/build/esnext/version.js +1 -1
  74. package/build/esnext/version.js.map +1 -1
  75. package/build/src/OTLPExporterBase.d.ts +0 -8
  76. package/build/src/OTLPExporterBase.js +0 -8
  77. package/build/src/OTLPExporterBase.js.map +1 -1
  78. package/build/src/configuration/otlp-http-configuration.d.ts +13 -0
  79. package/build/src/configuration/otlp-http-configuration.js +61 -0
  80. package/build/src/configuration/otlp-http-configuration.js.map +1 -0
  81. package/build/src/configuration/otlp-http-env-configuration.d.ts +9 -0
  82. package/build/src/configuration/otlp-http-env-configuration.js +97 -0
  83. package/build/src/configuration/otlp-http-env-configuration.js.map +1 -0
  84. package/build/src/configuration/shared-configuration.d.ts +22 -0
  85. package/build/src/configuration/shared-configuration.js +50 -0
  86. package/build/src/configuration/shared-configuration.js.map +1 -0
  87. package/build/src/configuration/shared-env-configuration.d.ts +3 -0
  88. package/build/src/configuration/shared-env-configuration.js +48 -0
  89. package/build/src/configuration/shared-env-configuration.js.map +1 -0
  90. package/build/src/index.d.ts +3 -1
  91. package/build/src/index.js +7 -6
  92. package/build/src/index.js.map +1 -1
  93. package/build/src/platform/browser/OTLPExporterBrowserBase.d.ts +4 -3
  94. package/build/src/platform/browser/OTLPExporterBrowserBase.js +18 -10
  95. package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  96. package/build/src/platform/browser/xhr-transport.js +3 -3
  97. package/build/src/platform/browser/xhr-transport.js.map +1 -1
  98. package/build/src/platform/node/OTLPExporterNodeBase.d.ts +2 -2
  99. package/build/src/platform/node/OTLPExporterNodeBase.js +18 -27
  100. package/build/src/platform/node/OTLPExporterNodeBase.js.map +1 -1
  101. package/build/src/platform/node/convert-legacy-agent-options.d.ts +12 -0
  102. package/build/src/platform/node/convert-legacy-agent-options.js +31 -0
  103. package/build/src/platform/node/convert-legacy-agent-options.js.map +1 -0
  104. package/build/src/types.d.ts +1 -2
  105. package/build/src/types.js.map +1 -1
  106. package/build/src/util.d.ts +1 -27
  107. package/build/src/util.js +3 -97
  108. package/build/src/util.js.map +1 -1
  109. package/build/src/version.d.ts +1 -1
  110. package/build/src/version.js +1 -1
  111. package/build/src/version.js.map +1 -1
  112. package/package.json +8 -11
  113. package/build/esm/platform/node/util.d.ts +0 -3
  114. package/build/esm/platform/node/util.js +0 -30
  115. package/build/esm/platform/node/util.js.map +0 -1
  116. package/build/esnext/platform/node/util.d.ts +0 -3
  117. package/build/esnext/platform/node/util.js +0 -30
  118. package/build/esnext/platform/node/util.js.map +0 -1
  119. package/build/src/platform/node/util.d.ts +0 -3
  120. package/build/src/platform/node/util.js +0 -34
  121. package/build/src/platform/node/util.js.map +0 -1
package/build/src/util.js CHANGED
@@ -15,19 +15,13 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.parseRetryAfterToMills = exports.isExportRetryable = exports.invalidTimeout = exports.configureExporterTimeout = exports.appendRootPathToUrlIfNeeded = exports.appendResourcePathToUrl = exports.parseHeaders = exports.DEFAULT_EXPORT_BACKOFF_MULTIPLIER = exports.DEFAULT_EXPORT_MAX_BACKOFF = exports.DEFAULT_EXPORT_INITIAL_BACKOFF = exports.DEFAULT_EXPORT_MAX_ATTEMPTS = void 0;
18
+ exports.validateAndNormalizeHeaders = void 0;
19
19
  const api_1 = require("@opentelemetry/api");
20
- const core_1 = require("@opentelemetry/core");
21
- const DEFAULT_TRACE_TIMEOUT = 10000;
22
- exports.DEFAULT_EXPORT_MAX_ATTEMPTS = 5;
23
- exports.DEFAULT_EXPORT_INITIAL_BACKOFF = 1000;
24
- exports.DEFAULT_EXPORT_MAX_BACKOFF = 5000;
25
- exports.DEFAULT_EXPORT_BACKOFF_MULTIPLIER = 1.5;
26
20
  /**
27
21
  * Parses headers from config leaving only those that have defined values
28
22
  * @param partialHeaders
29
23
  */
30
- function parseHeaders(partialHeaders = {}) {
24
+ function validateAndNormalizeHeaders(partialHeaders = {}) {
31
25
  const headers = {};
32
26
  Object.entries(partialHeaders).forEach(([key, value]) => {
33
27
  if (typeof value !== 'undefined') {
@@ -39,93 +33,5 @@ function parseHeaders(partialHeaders = {}) {
39
33
  });
40
34
  return headers;
41
35
  }
42
- exports.parseHeaders = parseHeaders;
43
- /**
44
- * Adds path (version + signal) to a no per-signal endpoint
45
- * @param url
46
- * @param path
47
- * @returns url + path
48
- */
49
- function appendResourcePathToUrl(url, path) {
50
- if (!url.endsWith('/')) {
51
- url = url + '/';
52
- }
53
- return url + path;
54
- }
55
- exports.appendResourcePathToUrl = appendResourcePathToUrl;
56
- /**
57
- * Adds root path to signal specific endpoint when endpoint contains no path part and no root path
58
- * @param url
59
- * @returns url
60
- */
61
- function appendRootPathToUrlIfNeeded(url) {
62
- try {
63
- const parsedUrl = new URL(url);
64
- if (parsedUrl.pathname === '') {
65
- parsedUrl.pathname = parsedUrl.pathname + '/';
66
- }
67
- return parsedUrl.toString();
68
- }
69
- catch (_a) {
70
- api_1.diag.warn(`Could not parse export URL: '${url}'`);
71
- return url;
72
- }
73
- }
74
- exports.appendRootPathToUrlIfNeeded = appendRootPathToUrlIfNeeded;
75
- /**
76
- * Configure exporter trace timeout value from passed in value or environment variables
77
- * @param timeoutMillis
78
- * @returns timeout value in milliseconds
79
- */
80
- function configureExporterTimeout(timeoutMillis) {
81
- if (typeof timeoutMillis === 'number') {
82
- if (timeoutMillis <= 0) {
83
- // OTLP exporter configured timeout - using default value of 10000ms
84
- return invalidTimeout(timeoutMillis, DEFAULT_TRACE_TIMEOUT);
85
- }
86
- return timeoutMillis;
87
- }
88
- else {
89
- return getExporterTimeoutFromEnv();
90
- }
91
- }
92
- exports.configureExporterTimeout = configureExporterTimeout;
93
- function getExporterTimeoutFromEnv() {
94
- var _a;
95
- 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);
96
- if (definedTimeout <= 0) {
97
- // OTLP exporter configured timeout - using default value of 10000ms
98
- return invalidTimeout(definedTimeout, DEFAULT_TRACE_TIMEOUT);
99
- }
100
- else {
101
- return definedTimeout;
102
- }
103
- }
104
- // OTLP exporter configured timeout - using default value of 10000ms
105
- function invalidTimeout(timeout, defaultTimeout) {
106
- api_1.diag.warn('Timeout must be greater than 0', timeout);
107
- return defaultTimeout;
108
- }
109
- exports.invalidTimeout = invalidTimeout;
110
- function isExportRetryable(statusCode) {
111
- const retryCodes = [429, 502, 503, 504];
112
- return retryCodes.includes(statusCode);
113
- }
114
- exports.isExportRetryable = isExportRetryable;
115
- function parseRetryAfterToMills(retryAfter) {
116
- if (retryAfter == null) {
117
- return -1;
118
- }
119
- const seconds = Number.parseInt(retryAfter, 10);
120
- if (Number.isInteger(seconds)) {
121
- return seconds > 0 ? seconds * 1000 : -1;
122
- }
123
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives
124
- const delay = new Date(retryAfter).getTime() - Date.now();
125
- if (delay >= 0) {
126
- return delay;
127
- }
128
- return 0;
129
- }
130
- exports.parseRetryAfterToMills = parseRetryAfterToMills;
36
+ exports.validateAndNormalizeHeaders = validateAndNormalizeHeaders;
131
37
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
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;AACvB,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AS,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,mFAAmF;IACnF,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE1D,IAAI,KAAK,IAAI,CAAC,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAfD,wDAeC","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;\nexport const DEFAULT_EXPORT_MAX_ATTEMPTS = 5;\nexport const DEFAULT_EXPORT_INITIAL_BACKOFF = 1000;\nexport const DEFAULT_EXPORT_MAX_BACKOFF = 5000;\nexport const DEFAULT_EXPORT_BACKOFF_MULTIPLIER = 1.5;\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(\n `Header \"${key}\" has invalid value (${value}) and will be ignored`\n );\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 * @returns url\n */\nexport function appendRootPathToUrlIfNeeded(url: string): string {\n try {\n const parsedUrl = new URL(url);\n if (parsedUrl.pathname === '') {\n parsedUrl.pathname = parsedUrl.pathname + '/';\n }\n return parsedUrl.toString();\n } catch {\n diag.warn(`Could not parse export URL: '${url}'`);\n return url;\n }\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(\n timeoutMillis: number | undefined\n): 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 = Number(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT ??\n getEnv().OTEL_EXPORTER_OTLP_TIMEOUT\n );\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(\n timeout: number,\n defaultTimeout: number\n): number {\n diag.warn('Timeout must be greater than 0', timeout);\n\n return defaultTimeout;\n}\n\nexport function isExportRetryable(statusCode: number): boolean {\n const retryCodes = [429, 502, 503, 504];\n\n return retryCodes.includes(statusCode);\n}\n\nexport function parseRetryAfterToMills(retryAfter?: string | null): number {\n if (retryAfter == null) {\n return -1;\n }\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C;;;GAGG;AACH,SAAgB,2BAA2B,CACzC,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,CACP,WAAW,GAAG,wBAAwB,KAAK,uBAAuB,CACnE,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAdD,kEAcC","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';\n\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function validateAndNormalizeHeaders(\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(\n `Header \"${key}\" has invalid value (${value}) and will be ignored`\n );\n }\n });\n return headers;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.53.0";
1
+ export declare const VERSION = "0.54.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.53.0';
20
+ exports.VERSION = '0.54.1';
21
21
  //# sourceMappingURL=version.js.map
@@ -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.53.0';\n"]}
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.54.1';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-exporter-base",
3
- "version": "0.53.0",
3
+ "version": "0.54.1",
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",
@@ -17,8 +17,6 @@
17
17
  "prepublishOnly": "npm run compile",
18
18
  "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
19
19
  "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
20
- "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
21
- "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
22
20
  "lint": "eslint . --ext .ts",
23
21
  "lint:fix": "eslint . --ext .ts --fix",
24
22
  "tdd": "npm run test -- --watch-extensions ts --watch",
@@ -62,18 +60,17 @@
62
60
  "access": "public"
63
61
  },
64
62
  "dependencies": {
65
- "@opentelemetry/core": "1.26.0",
66
- "@opentelemetry/otlp-transformer": "0.53.0"
63
+ "@opentelemetry/core": "1.27.0",
64
+ "@opentelemetry/otlp-transformer": "0.54.1"
67
65
  },
68
66
  "devDependencies": {
69
67
  "@babel/core": "7.25.2",
70
- "@babel/preset-env": "7.25.3",
68
+ "@babel/preset-env": "7.25.4",
71
69
  "@opentelemetry/api": "1.9.0",
72
- "@types/mocha": "10.0.7",
70
+ "@types/mocha": "10.0.8",
73
71
  "@types/node": "18.6.5",
74
72
  "@types/sinon": "17.0.3",
75
73
  "babel-plugin-istanbul": "7.0.0",
76
- "codecov": "3.8.3",
77
74
  "cross-var": "1.1.0",
78
75
  "karma": "6.4.4",
79
76
  "karma-chrome-launcher": "3.1.0",
@@ -87,14 +84,14 @@
87
84
  "sinon": "15.1.2",
88
85
  "ts-loader": "9.5.1",
89
86
  "typescript": "4.4.4",
90
- "webpack": "5.89.0",
87
+ "webpack": "5.94.0",
91
88
  "webpack-cli": "5.1.4",
92
89
  "webpack-merge": "5.10.0"
93
90
  },
94
91
  "peerDependencies": {
95
- "@opentelemetry/api": "^1.0.0"
92
+ "@opentelemetry/api": "^1.3.0"
96
93
  },
97
94
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base",
98
95
  "sideEffects": false,
99
- "gitHead": "720bc8c70d47029cb6b41a34ffdc3d25cbaa2f80"
96
+ "gitHead": "6f4f3fcefd8e453f0516ba15fe0c2580442dd06a"
100
97
  }
@@ -1,3 +0,0 @@
1
- import { CompressionAlgorithm } from './types';
2
- export declare function configureCompression(compression: CompressionAlgorithm | undefined): CompressionAlgorithm;
3
- //# sourceMappingURL=util.d.ts.map
@@ -1,30 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { CompressionAlgorithm } from './types';
17
- import { getEnv } from '@opentelemetry/core';
18
- export function configureCompression(compression) {
19
- if (compression) {
20
- return compression;
21
- }
22
- else {
23
- var definedCompression = getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||
24
- getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;
25
- return definedCompression === CompressionAlgorithm.GZIP
26
- ? CompressionAlgorithm.GZIP
27
- : CompressionAlgorithm.NONE;
28
- }
29
- }
30
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/node/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,UAAU,oBAAoB,CAClC,WAA6C;IAE7C,IAAI,WAAW,EAAE;QACf,OAAO,WAAW,CAAC;KACpB;SAAM;QACL,IAAM,kBAAkB,GACtB,MAAM,EAAE,CAAC,qCAAqC;YAC9C,MAAM,EAAE,CAAC,8BAA8B,CAAC;QAC1C,OAAO,kBAAkB,KAAK,oBAAoB,CAAC,IAAI;YACrD,CAAC,CAAC,oBAAoB,CAAC,IAAI;YAC3B,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC;KAC/B;AACH,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\nimport { CompressionAlgorithm } from './types';\nimport { getEnv } from '@opentelemetry/core';\n\nexport function configureCompression(\n compression: CompressionAlgorithm | undefined\n): CompressionAlgorithm {\n if (compression) {\n return compression;\n } else {\n const definedCompression =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||\n getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n return definedCompression === CompressionAlgorithm.GZIP\n ? CompressionAlgorithm.GZIP\n : CompressionAlgorithm.NONE;\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { CompressionAlgorithm } from './types';
2
- export declare function configureCompression(compression: CompressionAlgorithm | undefined): CompressionAlgorithm;
3
- //# sourceMappingURL=util.d.ts.map
@@ -1,30 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { CompressionAlgorithm } from './types';
17
- import { getEnv } from '@opentelemetry/core';
18
- export function configureCompression(compression) {
19
- if (compression) {
20
- return compression;
21
- }
22
- else {
23
- const definedCompression = getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||
24
- getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;
25
- return definedCompression === CompressionAlgorithm.GZIP
26
- ? CompressionAlgorithm.GZIP
27
- : CompressionAlgorithm.NONE;
28
- }
29
- }
30
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/node/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,UAAU,oBAAoB,CAClC,WAA6C;IAE7C,IAAI,WAAW,EAAE;QACf,OAAO,WAAW,CAAC;KACpB;SAAM;QACL,MAAM,kBAAkB,GACtB,MAAM,EAAE,CAAC,qCAAqC;YAC9C,MAAM,EAAE,CAAC,8BAA8B,CAAC;QAC1C,OAAO,kBAAkB,KAAK,oBAAoB,CAAC,IAAI;YACrD,CAAC,CAAC,oBAAoB,CAAC,IAAI;YAC3B,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC;KAC/B;AACH,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\nimport { CompressionAlgorithm } from './types';\nimport { getEnv } from '@opentelemetry/core';\n\nexport function configureCompression(\n compression: CompressionAlgorithm | undefined\n): CompressionAlgorithm {\n if (compression) {\n return compression;\n } else {\n const definedCompression =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||\n getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n return definedCompression === CompressionAlgorithm.GZIP\n ? CompressionAlgorithm.GZIP\n : CompressionAlgorithm.NONE;\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { CompressionAlgorithm } from './types';
2
- export declare function configureCompression(compression: CompressionAlgorithm | undefined): CompressionAlgorithm;
3
- //# sourceMappingURL=util.d.ts.map
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.configureCompression = void 0;
19
- const types_1 = require("./types");
20
- const core_1 = require("@opentelemetry/core");
21
- function configureCompression(compression) {
22
- if (compression) {
23
- return compression;
24
- }
25
- else {
26
- const definedCompression = (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||
27
- (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_COMPRESSION;
28
- return definedCompression === types_1.CompressionAlgorithm.GZIP
29
- ? types_1.CompressionAlgorithm.GZIP
30
- : types_1.CompressionAlgorithm.NONE;
31
- }
32
- }
33
- exports.configureCompression = configureCompression;
34
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/node/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,mCAA+C;AAC/C,8CAA6C;AAE7C,SAAgB,oBAAoB,CAClC,WAA6C;IAE7C,IAAI,WAAW,EAAE;QACf,OAAO,WAAW,CAAC;KACpB;SAAM;QACL,MAAM,kBAAkB,GACtB,IAAA,aAAM,GAAE,CAAC,qCAAqC;YAC9C,IAAA,aAAM,GAAE,CAAC,8BAA8B,CAAC;QAC1C,OAAO,kBAAkB,KAAK,4BAAoB,CAAC,IAAI;YACrD,CAAC,CAAC,4BAAoB,CAAC,IAAI;YAC3B,CAAC,CAAC,4BAAoB,CAAC,IAAI,CAAC;KAC/B;AACH,CAAC;AAbD,oDAaC","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 { CompressionAlgorithm } from './types';\nimport { getEnv } from '@opentelemetry/core';\n\nexport function configureCompression(\n compression: CompressionAlgorithm | undefined\n): CompressionAlgorithm {\n if (compression) {\n return compression;\n } else {\n const definedCompression =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||\n getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n return definedCompression === CompressionAlgorithm.GZIP\n ? CompressionAlgorithm.GZIP\n : CompressionAlgorithm.NONE;\n }\n}\n"]}