@opentelemetry/otlp-exporter-base 0.34.0 → 0.35.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 (86) hide show
  1. package/README.md +2 -0
  2. package/build/esm/OTLPExporterBase.js +2 -3
  3. package/build/esm/OTLPExporterBase.js.map +1 -1
  4. package/build/esm/index.d.ts +3 -3
  5. package/build/esm/index.js +3 -3
  6. package/build/esm/index.js.map +1 -1
  7. package/build/esm/platform/browser/OTLPExporterBrowserBase.js +1 -2
  8. package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  9. package/build/esm/platform/browser/index.d.ts +2 -1
  10. package/build/esm/platform/browser/index.js +2 -1
  11. package/build/esm/platform/browser/index.js.map +1 -1
  12. package/build/esm/platform/browser/util.d.ts +1 -1
  13. package/build/esm/platform/browser/util.js +1 -1
  14. package/build/esm/platform/browser/util.js.map +1 -1
  15. package/build/esm/platform/index.d.ts +2 -2
  16. package/build/esm/platform/index.js +2 -2
  17. package/build/esm/platform/index.js.map +1 -1
  18. package/build/esm/platform/node/OTLPExporterNodeBase.js +1 -2
  19. package/build/esm/platform/node/OTLPExporterNodeBase.js.map +1 -1
  20. package/build/esm/platform/node/index.d.ts +3 -3
  21. package/build/esm/platform/node/index.js +3 -3
  22. package/build/esm/platform/node/index.js.map +1 -1
  23. package/build/esm/platform/node/types.js.map +1 -1
  24. package/build/esm/platform/node/util.js +9 -4
  25. package/build/esm/platform/node/util.js.map +1 -1
  26. package/build/esm/util.js.map +1 -1
  27. package/build/esm/version.d.ts +1 -1
  28. package/build/esm/version.js +1 -1
  29. package/build/esm/version.js.map +1 -1
  30. package/build/esnext/OTLPExporterBase.js +2 -3
  31. package/build/esnext/OTLPExporterBase.js.map +1 -1
  32. package/build/esnext/index.d.ts +3 -3
  33. package/build/esnext/index.js +3 -3
  34. package/build/esnext/index.js.map +1 -1
  35. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js +1 -2
  36. package/build/esnext/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  37. package/build/esnext/platform/browser/index.d.ts +2 -1
  38. package/build/esnext/platform/browser/index.js +2 -1
  39. package/build/esnext/platform/browser/index.js.map +1 -1
  40. package/build/esnext/platform/browser/util.d.ts +1 -1
  41. package/build/esnext/platform/browser/util.js +1 -1
  42. package/build/esnext/platform/browser/util.js.map +1 -1
  43. package/build/esnext/platform/index.d.ts +2 -2
  44. package/build/esnext/platform/index.js +2 -2
  45. package/build/esnext/platform/index.js.map +1 -1
  46. package/build/esnext/platform/node/OTLPExporterNodeBase.js +1 -2
  47. package/build/esnext/platform/node/OTLPExporterNodeBase.js.map +1 -1
  48. package/build/esnext/platform/node/index.d.ts +3 -3
  49. package/build/esnext/platform/node/index.js +3 -3
  50. package/build/esnext/platform/node/index.js.map +1 -1
  51. package/build/esnext/platform/node/types.js.map +1 -1
  52. package/build/esnext/platform/node/util.js +9 -4
  53. package/build/esnext/platform/node/util.js.map +1 -1
  54. package/build/esnext/util.js.map +1 -1
  55. package/build/esnext/version.d.ts +1 -1
  56. package/build/esnext/version.js +1 -1
  57. package/build/esnext/version.js.map +1 -1
  58. package/build/src/OTLPExporterBase.js +1 -2
  59. package/build/src/OTLPExporterBase.js.map +1 -1
  60. package/build/src/index.d.ts +3 -3
  61. package/build/src/index.js +11 -3
  62. package/build/src/index.js.map +1 -1
  63. package/build/src/platform/browser/OTLPExporterBrowserBase.js +1 -2
  64. package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +1 -1
  65. package/build/src/platform/browser/index.d.ts +2 -1
  66. package/build/src/platform/browser/index.js +5 -11
  67. package/build/src/platform/browser/index.js.map +1 -1
  68. package/build/src/platform/browser/util.d.ts +1 -1
  69. package/build/src/platform/browser/util.js +1 -1
  70. package/build/src/platform/browser/util.js.map +1 -1
  71. package/build/src/platform/index.d.ts +2 -2
  72. package/build/src/platform/index.js +9 -13
  73. package/build/src/platform/index.js.map +1 -1
  74. package/build/src/platform/node/OTLPExporterNodeBase.js +1 -2
  75. package/build/src/platform/node/OTLPExporterNodeBase.js.map +1 -1
  76. package/build/src/platform/node/index.d.ts +3 -3
  77. package/build/src/platform/node/index.js +9 -13
  78. package/build/src/platform/node/index.js.map +1 -1
  79. package/build/src/platform/node/types.js.map +1 -1
  80. package/build/src/platform/node/util.js +9 -4
  81. package/build/src/platform/node/util.js.map +1 -1
  82. package/build/src/util.js.map +1 -1
  83. package/build/src/version.d.ts +1 -1
  84. package/build/src/version.js +1 -1
  85. package/build/src/version.js.map +1 -1
  86. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPExporterNodeBase.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPExporterNodeBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,6DAA0D;AAG1D,qCAA0C;AAC1C,iCAA6E;AAC7E,4CAA0C;AAC1C,8CAA2D;AAE3D;;GAEG;AACH,MAAsB,oBAGpB,SAAQ,mCAIT;IAMC,YAAY,SAAqC,EAAE;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QANhB,oBAAe,GAA2B,EAAE,CAAC;QAO3C,8DAA8D;QAC9D,IAAK,MAAc,CAAC,QAAQ,EAAE;YAC5B,UAAI,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;SACrD;QACD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B,IAAI,CAAC,eAAe,EACpB,IAAA,mBAAY,EAAC,MAAM,CAAC,OAAO,CAAC,EAC5B,mBAAY,CAAC,uBAAuB,CAAC,IAAA,aAAM,GAAE,CAAC,0BAA0B,CAAC,CAC1E,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,IAAA,sBAAe,EAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAA,2BAAoB,EAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,CAAC,OAAmC,IAAS,CAAC;IAEpD,IAAI,CACF,OAAqB,EACrB,SAAqB,EACrB,OAAqD;QAErD,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;YAC/B,UAAI,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;YAC5D,OAAO;SACR;QACD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE7C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpD,IAAA,mBAAY,EACV,IAAI,EACJ,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAC9B,kBAAkB,EAClB,OAAO,EACP,MAAM,CACP,CAAC;QACJ,CAAC,CAAC;aACC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE5B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,GAAG,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,UAAU,KAAU,CAAC;CACtB;AA7DD,oDA6DC","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 type * as http from 'http';\nimport type * as https from 'https';\n\nimport { OTLPExporterBase } from '../../OTLPExporterBase';\nimport { OTLPExporterNodeConfigBase, CompressionAlgorithm } from './types';\nimport * as otlpTypes from '../../types';\nimport { parseHeaders } from '../../util';\nimport { createHttpAgent, sendWithHttp, configureCompression } from './util';\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\n\n/**\n * Collector Metric Exporter abstract base class\n */\nexport abstract class OTLPExporterNodeBase<\n ExportItem,\n ServiceRequest\n> extends OTLPExporterBase<\n OTLPExporterNodeConfigBase,\n ExportItem,\n ServiceRequest\n> {\n DEFAULT_HEADERS: Record<string, string> = {};\n headers: Record<string, string>;\n agent: http.Agent | https.Agent | undefined;\n compression: CompressionAlgorithm;\n\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n super(config);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((config as any).metadata) {\n diag.warn('Metadata cannot be set when using http');\n }\n this.headers = Object.assign(\n this.DEFAULT_HEADERS,\n parseHeaders(config.headers),\n baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_HEADERS)\n );\n this.agent = createHttpAgent(config);\n this.compression = configureCompression(config.compression);\n }\n\n onInit(_config: OTLPExporterNodeConfigBase): void {}\n\n send(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: otlpTypes.OTLPExporterError) => void\n ): void {\n if (this._shutdownOnce.isCalled) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n const serviceRequest = this.convert(objects);\n\n const promise = new Promise<void>((resolve, reject) => {\n sendWithHttp(\n this,\n JSON.stringify(serviceRequest),\n 'application/json',\n resolve,\n reject\n );\n })\n .then(onSuccess, onError);\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n onShutdown(): void {}\n}\n"]}
1
+ {"version":3,"file":"OTLPExporterNodeBase.js","sourceRoot":"","sources":["../../../../src/platform/node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CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE5B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,GAAG,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,UAAU,KAAU,CAAC;CACtB;AA5DD,oDA4DC","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 type * as http from 'http';\nimport type * as https from 'https';\n\nimport { OTLPExporterBase } from '../../OTLPExporterBase';\nimport { OTLPExporterNodeConfigBase, CompressionAlgorithm } from './types';\nimport * as otlpTypes from '../../types';\nimport { parseHeaders } from '../../util';\nimport { createHttpAgent, sendWithHttp, configureCompression } from './util';\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\n\n/**\n * Collector Metric Exporter abstract base class\n */\nexport abstract class OTLPExporterNodeBase<\n ExportItem,\n ServiceRequest\n> extends OTLPExporterBase<\n OTLPExporterNodeConfigBase,\n ExportItem,\n ServiceRequest\n> {\n DEFAULT_HEADERS: Record<string, string> = {};\n headers: Record<string, string>;\n agent: http.Agent | https.Agent | undefined;\n compression: CompressionAlgorithm;\n\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n super(config);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((config as any).metadata) {\n diag.warn('Metadata cannot be set when using http');\n }\n this.headers = Object.assign(\n this.DEFAULT_HEADERS,\n parseHeaders(config.headers),\n baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_HEADERS)\n );\n this.agent = createHttpAgent(config);\n this.compression = configureCompression(config.compression);\n }\n\n onInit(_config: OTLPExporterNodeConfigBase): void {}\n\n send(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: otlpTypes.OTLPExporterError) => void\n ): void {\n if (this._shutdownOnce.isCalled) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n const serviceRequest = this.convert(objects);\n\n const promise = new Promise<void>((resolve, reject) => {\n sendWithHttp(\n this,\n JSON.stringify(serviceRequest),\n 'application/json',\n resolve,\n reject\n );\n }).then(onSuccess, onError);\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n onShutdown(): void {}\n}\n"]}
@@ -1,4 +1,4 @@
1
- export * from './OTLPExporterNodeBase';
2
- export * from './util';
3
- export * from './types';
1
+ export { OTLPExporterNodeBase } from './OTLPExporterNodeBase';
2
+ export { sendWithHttp, createHttpAgent, configureCompression } from './util';
3
+ export { OTLPExporterNodeConfigBase, CompressionAlgorithm } from './types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -14,18 +14,14 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
17
  Object.defineProperty(exports, "__esModule", { value: true });
28
- __exportStar(require("./OTLPExporterNodeBase"), exports);
29
- __exportStar(require("./util"), exports);
30
- __exportStar(require("./types"), exports);
18
+ exports.CompressionAlgorithm = exports.configureCompression = exports.createHttpAgent = exports.sendWithHttp = exports.OTLPExporterNodeBase = void 0;
19
+ var OTLPExporterNodeBase_1 = require("./OTLPExporterNodeBase");
20
+ Object.defineProperty(exports, "OTLPExporterNodeBase", { enumerable: true, get: function () { return OTLPExporterNodeBase_1.OTLPExporterNodeBase; } });
21
+ var util_1 = require("./util");
22
+ Object.defineProperty(exports, "sendWithHttp", { enumerable: true, get: function () { return util_1.sendWithHttp; } });
23
+ Object.defineProperty(exports, "createHttpAgent", { enumerable: true, get: function () { return util_1.createHttpAgent; } });
24
+ Object.defineProperty(exports, "configureCompression", { enumerable: true, get: function () { return util_1.configureCompression; } });
25
+ var types_1 = require("./types");
26
+ Object.defineProperty(exports, "CompressionAlgorithm", { enumerable: true, get: function () { return types_1.CompressionAlgorithm; } });
31
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,yDAAuC;AACvC,yCAAuB;AACvB,0CAAwB","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\nexport * from './OTLPExporterNodeBase';\nexport * from './util';\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+BAA6E;AAApE,oGAAA,YAAY,OAAA;AAAE,uGAAA,eAAe,OAAA;AAAE,4GAAA,oBAAoB,OAAA;AAC5D,iCAA2E;AAAtC,6GAAA,oBAAoB,OAAA","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\nexport { OTLPExporterNodeBase } from './OTLPExporterNodeBase';\nexport { sendWithHttp, createHttpAgent, configureCompression } from './util';\nexport { OTLPExporterNodeConfigBase, CompressionAlgorithm } from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/platform/node/types.ts"],"names":[],"mappings":";;;AA8BA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,qCAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B","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 */\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nimport { OTLPExporterConfigBase } from '../../types';\n\n/**\n * Collector Exporter node base config\n */\nexport interface OTLPExporterNodeConfigBase\n extends OTLPExporterConfigBase {\n keepAlive?: boolean;\n compression?: CompressionAlgorithm;\n httpAgentOptions?: http.AgentOptions | https.AgentOptions;\n}\n\nexport enum CompressionAlgorithm {\n NONE = 'none',\n GZIP = 'gzip'\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/platform/node/types.ts"],"names":[],"mappings":";;;AA6BA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,qCAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B","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 */\nimport type * as http from 'http';\nimport type * as https from 'https';\n\nimport { OTLPExporterConfigBase } from '../../types';\n\n/**\n * Collector Exporter node base config\n */\nexport interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase {\n keepAlive?: boolean;\n compression?: CompressionAlgorithm;\n httpAgentOptions?: http.AgentOptions | https.AgentOptions;\n}\n\nexport enum CompressionAlgorithm {\n NONE = 'none',\n GZIP = 'gzip',\n}\n"]}
@@ -94,8 +94,10 @@ function sendWithHttp(collector, data, contentType, onSuccess, onError) {
94
94
  case types_1.CompressionAlgorithm.GZIP: {
95
95
  req.setHeader('Content-Encoding', 'gzip');
96
96
  const dataStream = readableFromBuffer(data);
97
- dataStream.on('error', onError)
98
- .pipe(zlib.createGzip()).on('error', onError)
97
+ dataStream
98
+ .on('error', onError)
99
+ .pipe(zlib.createGzip())
100
+ .on('error', onError)
99
101
  .pipe(req);
100
102
  break;
101
103
  }
@@ -134,8 +136,11 @@ function configureCompression(compression) {
134
136
  return compression;
135
137
  }
136
138
  else {
137
- const definedCompression = (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION || (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_COMPRESSION;
138
- return definedCompression === types_1.CompressionAlgorithm.GZIP ? types_1.CompressionAlgorithm.GZIP : types_1.CompressionAlgorithm.NONE;
139
+ const definedCompression = (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||
140
+ (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_COMPRESSION;
141
+ return definedCompression === types_1.CompressionAlgorithm.GZIP
142
+ ? types_1.CompressionAlgorithm.GZIP
143
+ : types_1.CompressionAlgorithm.NONE;
139
144
  }
140
145
  }
141
146
  exports.configureCompression = configureCompression;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/node/util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAA2B;AAC3B,6BAA6B;AAC7B,+BAA+B;AAC/B,6BAA6B;AAC7B,mCAAkC;AAGlC,4CAA0C;AAC1C,mCAA+C;AAC/C,8CAA6C;AAC7C,uCAAgD;AAEhD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,SAA2D,EAC3D,IAAqB,EACrB,WAAmB,EACnB,SAAqB,EACrB,OAA2C;IAE3C,MAAM,eAAe,GAAG,SAAS,CAAC,aAAa,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,cAAuB,CAAC;IAC5B,MAAM,WAAW,G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A,aAAM,GAAE,CAAC,8BAA8B,CAAC;QACrH,OAAO,kBAAkB,KAAK,4BAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,4BAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,4BAAoB,CAAC,IAAI,CAAC;KACjH;AACH,CAAC;AAPD,oDAOC","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 */\nimport * as url from 'url';\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport { OTLPExporterNodeBase } from './OTLPExporterNodeBase';\nimport { OTLPExporterNodeConfigBase } from '.';\nimport { diag } from '@opentelemetry/api';\nimport { CompressionAlgorithm } from './types';\nimport { getEnv } from '@opentelemetry/core';\nimport { OTLPExporterError } from '../../types';\n\n/**\n * Sends data using http\n * @param collector\n * @param data\n * @param contentType\n * @param onSuccess\n * @param onError\n */\nexport function sendWithHttp<ExportItem, ServiceRequest>(\n collector: OTLPExporterNodeBase<ExportItem, ServiceRequest>,\n data: string | Buffer,\n contentType: string,\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n): void {\n const exporterTimeout = collector.timeoutMillis;\n const parsedUrl = new url.URL(collector.url);\n let reqIsDestroyed: boolean;\n const nodeVersion = Number(process.versions.node.split('.')[0]);\n\n const exporterTimer = setTimeout(() => {\n reqIsDestroyed = true;\n // req.abort() was deprecated since v14\n if (nodeVersion >= 14) {\n req.destroy();\n } else {\n req.abort();\n }\n }, exporterTimeout);\n\n const options: http.RequestOptions | https.RequestOptions = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers: {\n 'Content-Type': contentType,\n ...collector.headers,\n },\n agent: collector.agent,\n };\n\n const request = parsedUrl.protocol === 'http:' ? http.request : https.request;\n\n const req = request(options, (res: http.IncomingMessage) => {\n let responseData = '';\n res.on('data', chunk => (responseData += chunk));\n\n res.on('aborted', () => {\n if (reqIsDestroyed) {\n const err = new OTLPExporterError(\n 'Request Timeout'\n );\n onError(err);\n }\n });\n\n res.on('end', () => {\n if (!reqIsDestroyed) {\n if (res.statusCode && res.statusCode < 299) {\n diag.debug(`statusCode: ${res.statusCode}`, responseData);\n onSuccess();\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n responseData\n );\n onError(error);\n }\n clearTimeout(exporterTimer);\n }\n });\n });\n\n req.on('error', (error: Error | any) => {\n if (reqIsDestroyed) {\n const err = new OTLPExporterError(\n 'Request Timeout', error.code\n );\n onError(err);\n } else {\n clearTimeout(exporterTimer);\n onError(error);\n }\n });\n\n switch (collector.compression) {\n case CompressionAlgorithm.GZIP: {\n req.setHeader('Content-Encoding', 'gzip');\n const dataStream = readableFromBuffer(data);\n dataStream.on('error', onError)\n .pipe(zlib.createGzip()).on('error', onError)\n .pipe(req);\n\n break;\n }\n default:\n req.end(data);\n break;\n }\n}\n\nfunction readableFromBuffer(buff: string | Buffer): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n\nexport function createHttpAgent(\n config: OTLPExporterNodeConfigBase\n): http.Agent | https.Agent | undefined {\n if (config.httpAgentOptions && config.keepAlive === false) {\n diag.warn('httpAgentOptions is used only when keepAlive is true');\n return undefined;\n }\n\n if (config.keepAlive === false || !config.url) return undefined;\n\n try {\n const parsedUrl = new url.URL(config.url as string);\n const Agent = parsedUrl.protocol === 'http:' ? http.Agent : https.Agent;\n return new Agent({ keepAlive: true, ...config.httpAgentOptions });\n } catch (err) {\n diag.error(\n `collector exporter failed to create http agent. err: ${err.message}`\n );\n return undefined;\n }\n}\n\nexport function configureCompression(compression: CompressionAlgorithm | undefined): CompressionAlgorithm {\n if (compression) {\n return compression;\n } else {\n const definedCompression = getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION || getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n return definedCompression === CompressionAlgorithm.GZIP ? CompressionAlgorithm.GZIP : CompressionAlgorithm.NONE;\n }\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/node/util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAA2B;AAC3B,6BAA6B;AAC7B,+BAA+B;AAC/B,6BAA6B;AAC7B,mCAAkC;AAGlC,4CAA0C;AAC1C,mCAA+C;AAC/C,8CAA6C;AAC7C,uCAAgD;AAEhD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,SAA2D,EAC3D,IAAqB,EACrB,WAAmB,EACnB,SAAqB,EACrB,OAA2C;IAE3C,MAAM,eAAe,GAAG,SAAS,CAAC,aAAa,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,cAAuB,CAAC;IAC5B,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;QACpC,cAAc,GAAG,IAAI,CAAC;QACtB,uCAAuC;QACvC,IAAI,WAAW,IAAI,EAAE,EAAE;YACrB,GAAG,CAAC,OAAO,EAAE,CAAC;SACf;aAAM;YACL,GAAG,CAAC,KAAK,EAAE,CAAC;SACb;IACH,CAAC,EAAE,eAAe,CAAC,CAAC;IAEpB,MAAM,OAAO,GAA+C;QAC1D,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE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AAC,sDAAsD,CAAC,CAAC;QAClE,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,MAAM,CAAC,SAAS,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAEhE,IAAI;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAa,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;QACxE,OAAO,IAAI,KAAK,iBAAG,SAAS,EAAE,IAAI,IAAK,MAAM,CAAC,gBAAgB,EAAG,CAAC;KACnE;IAAC,OAAO,GAAG,EAAE;QACZ,UAAI,CAAC,KAAK,CACR,wDAAwD,GAAG,CAAC,OAAO,EAAE,CACtE,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AApBD,0CAoBC;AAED,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 */\nimport * as url from 'url';\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport { OTLPExporterNodeBase } from './OTLPExporterNodeBase';\nimport { OTLPExporterNodeConfigBase } from '.';\nimport { diag } from '@opentelemetry/api';\nimport { CompressionAlgorithm } from './types';\nimport { getEnv } from '@opentelemetry/core';\nimport { OTLPExporterError } from '../../types';\n\n/**\n * Sends data using http\n * @param collector\n * @param data\n * @param contentType\n * @param onSuccess\n * @param onError\n */\nexport function sendWithHttp<ExportItem, ServiceRequest>(\n collector: OTLPExporterNodeBase<ExportItem, ServiceRequest>,\n data: string | Buffer,\n contentType: string,\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n): void {\n const exporterTimeout = collector.timeoutMillis;\n const parsedUrl = new url.URL(collector.url);\n let reqIsDestroyed: boolean;\n const nodeVersion = Number(process.versions.node.split('.')[0]);\n\n const exporterTimer = setTimeout(() => {\n reqIsDestroyed = true;\n // req.abort() was deprecated since v14\n if (nodeVersion >= 14) {\n req.destroy();\n } else {\n req.abort();\n }\n }, exporterTimeout);\n\n const options: http.RequestOptions | https.RequestOptions = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers: {\n 'Content-Type': contentType,\n ...collector.headers,\n },\n agent: collector.agent,\n };\n\n const request = parsedUrl.protocol === 'http:' ? http.request : https.request;\n\n const req = request(options, (res: http.IncomingMessage) => {\n let responseData = '';\n res.on('data', chunk => (responseData += chunk));\n\n res.on('aborted', () => {\n if (reqIsDestroyed) {\n const err = new OTLPExporterError('Request Timeout');\n onError(err);\n }\n });\n\n res.on('end', () => {\n if (!reqIsDestroyed) {\n if (res.statusCode && res.statusCode < 299) {\n diag.debug(`statusCode: ${res.statusCode}`, responseData);\n onSuccess();\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n responseData\n );\n onError(error);\n }\n clearTimeout(exporterTimer);\n }\n });\n });\n\n req.on('error', (error: Error | any) => {\n if (reqIsDestroyed) {\n const err = new OTLPExporterError('Request Timeout', error.code);\n onError(err);\n } else {\n clearTimeout(exporterTimer);\n onError(error);\n }\n });\n\n switch (collector.compression) {\n case CompressionAlgorithm.GZIP: {\n req.setHeader('Content-Encoding', 'gzip');\n const dataStream = readableFromBuffer(data);\n dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError)\n .pipe(req);\n\n break;\n }\n default:\n req.end(data);\n break;\n }\n}\n\nfunction readableFromBuffer(buff: string | Buffer): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n\nexport function createHttpAgent(\n config: OTLPExporterNodeConfigBase\n): http.Agent | https.Agent | undefined {\n if (config.httpAgentOptions && config.keepAlive === false) {\n diag.warn('httpAgentOptions is used only when keepAlive is true');\n return undefined;\n }\n\n if (config.keepAlive === false || !config.url) return undefined;\n\n try {\n const parsedUrl = new url.URL(config.url as string);\n const Agent = parsedUrl.protocol === 'http:' ? http.Agent : https.Agent;\n return new Agent({ keepAlive: true, ...config.httpAgentOptions });\n } catch (err) {\n diag.error(\n `collector exporter failed to create http agent. err: ${err.message}`\n );\n return undefined;\n }\n}\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 +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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AAC,EAAE;YACtB,oEAAoE;YACpE,OAAO,cAAc,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;SAC7D;QACD,OAAO,aAAa,CAAC;KACtB;SAAM;QACL,OAAO,yBAAyB,EAAE,CAAC;KACpC;AACH,CAAC;AAVD,4DAUC;AAED,SAAS,yBAAyB;;IAChC,MAAM,cAAc,GAClB,MAAM,CAAC,MAAA,IAAA,aAAM,GAAE,CAAC,iCAAiC,mCAC/C,IAAA,aAAM,GAAE,CAAC,0BAA0B,CAAC,CAAC;IAEzC,IAAI,cAAc,IAAI,CAAC,EAAE;QACvB,oEAAoE;QACpE,OAAO,cAAc,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,cAAc,CAAC;KACvB;AACH,CAAC;AAED,oEAAoE;AACpE,SAAgB,cAAc,CAAC,OAAe,EAAE,cAAsB;IACpE,UAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAErD,OAAO,cAAc,CAAC;AACxB,CAAC;AAJD,wCAIC","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 * @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(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"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAC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,aAAa,KAAK,QAAQ,EAAE;QACrC,IAAI,aAAa,IAAI,CAAC,EAAE;YACtB,oEAAoE;YACpE,OAAO,cAAc,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;SAC7D;QACD,OAAO,aAAa,CAAC;KACtB;SAAM;QACL,OAAO,yBAAyB,EAAE,CAAC;KACpC;AACH,CAAC;AAZD,4DAYC;AAED,SAAS,yBAAyB;;IAChC,MAAM,cAAc,GAAG,MAAM,CAC3B,MAAA,IAAA,aAAM,GAAE,CAAC,iCAAiC,mCACxC,IAAA,aAAM,GAAE,CAAC,0BAA0B,CACtC,CAAC;IAEF,IAAI,cAAc,IAAI,CAAC,EAAE;QACvB,oEAAoE;QACpE,OAAO,cAAc,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,cAAc,CAAC;KACvB;AACH,CAAC;AAED,oEAAoE;AACpE,SAAgB,cAAc,CAC5B,OAAe,EACf,cAAsB;IAEtB,UAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IAErD,OAAO,cAAc,CAAC;AACxB,CAAC;AAPD,wCAOC","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 * @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"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.34.0";
1
+ export declare const VERSION = "0.35.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.34.0';
20
+ exports.VERSION = '0.35.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.34.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.35.1';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-exporter-base",
3
- "version": "0.34.0",
3
+ "version": "0.35.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",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "scripts": {
17
17
  "prepublishOnly": "npm run compile",
18
- "compile": "tsc --build tsconfig.all.json",
19
- "clean": "tsc --build --clean tsconfig.all.json",
18
+ "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
19
+ "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
20
20
  "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
21
21
  "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
22
22
  "lint": "eslint . --ext .ts",
@@ -26,7 +26,7 @@
26
26
  "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
27
27
  "test:browser": "nyc karma start --single-run",
28
28
  "version": "node ../../../scripts/version-update.js",
29
- "watch": "tsc --build --watch tsconfig.all.json",
29
+ "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
30
30
  "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies",
31
31
  "prewatch": "npm run precompile"
32
32
  },
@@ -61,7 +61,7 @@
61
61
  "access": "public"
62
62
  },
63
63
  "dependencies": {
64
- "@opentelemetry/core": "1.8.0"
64
+ "@opentelemetry/core": "1.9.1"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@opentelemetry/api": "^1.0.0",
@@ -73,7 +73,7 @@
73
73
  "mocha": "10.0.0",
74
74
  "nock": "13.0.11",
75
75
  "nyc": "15.1.0",
76
- "sinon": "14.0.0",
76
+ "sinon": "15.0.0",
77
77
  "ts-loader": "8.4.0",
78
78
  "ts-mocha": "10.0.0",
79
79
  "typescript": "4.4.4"
@@ -83,5 +83,5 @@
83
83
  },
84
84
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base",
85
85
  "sideEffects": false,
86
- "gitHead": "7972edf6659fb6e0d5928a5cf7a35f26683e168f"
86
+ "gitHead": "279458e7ddf16f7ddca5fe60c78672e05fafce66"
87
87
  }