@opentelemetry/exporter-trace-otlp-http 0.27.0 → 0.29.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 (119) hide show
  1. package/README.md +47 -21
  2. package/build/esm/index.d.ts +0 -4
  3. package/build/esm/index.js +0 -5
  4. package/build/esm/index.js.map +1 -1
  5. package/build/esm/platform/browser/OTLPTraceExporter.d.ts +4 -5
  6. package/build/esm/platform/browser/OTLPTraceExporter.js +7 -8
  7. package/build/esm/platform/browser/OTLPTraceExporter.js.map +1 -1
  8. package/build/esm/platform/browser/index.d.ts +0 -1
  9. package/build/esm/platform/browser/index.js +0 -1
  10. package/build/esm/platform/browser/index.js.map +1 -1
  11. package/build/esm/platform/index.d.ts +0 -1
  12. package/build/esm/platform/index.js +0 -1
  13. package/build/esm/platform/index.js.map +1 -1
  14. package/build/esm/platform/node/OTLPTraceExporter.d.ts +5 -5
  15. package/build/esm/platform/node/OTLPTraceExporter.js +8 -8
  16. package/build/esm/platform/node/OTLPTraceExporter.js.map +1 -1
  17. package/build/esm/platform/node/index.d.ts +0 -3
  18. package/build/esm/platform/node/index.js +0 -3
  19. package/build/esm/platform/node/index.js.map +1 -1
  20. package/build/esm/version.d.ts +1 -1
  21. package/build/esm/version.js +1 -1
  22. package/build/esm/version.js.map +1 -1
  23. package/build/esnext/index.d.ts +2 -0
  24. package/build/esnext/index.js +17 -0
  25. package/build/esnext/index.js.map +1 -0
  26. package/build/esnext/platform/browser/OTLPTraceExporter.d.ts +12 -0
  27. package/build/esnext/platform/browser/OTLPTraceExporter.js +42 -0
  28. package/build/esnext/platform/browser/OTLPTraceExporter.js.map +1 -0
  29. package/build/esnext/platform/browser/index.d.ts +2 -0
  30. package/build/esnext/platform/browser/index.js +17 -0
  31. package/build/esnext/platform/browser/index.js.map +1 -0
  32. package/build/esnext/platform/index.d.ts +2 -0
  33. package/build/esnext/platform/index.js +17 -0
  34. package/build/esnext/platform/index.js.map +1 -0
  35. package/build/esnext/platform/node/OTLPTraceExporter.d.ts +13 -0
  36. package/build/esnext/platform/node/OTLPTraceExporter.js +43 -0
  37. package/build/esnext/platform/node/OTLPTraceExporter.js.map +1 -0
  38. package/build/esnext/platform/node/index.d.ts +2 -0
  39. package/build/esnext/platform/node/index.js +17 -0
  40. package/build/esnext/platform/node/index.js.map +1 -0
  41. package/build/esnext/version.d.ts +2 -0
  42. package/build/esnext/version.js +18 -0
  43. package/build/esnext/version.js.map +1 -0
  44. package/build/src/index.d.ts +0 -4
  45. package/build/src/index.js +0 -8
  46. package/build/src/index.js.map +1 -1
  47. package/build/src/platform/browser/OTLPTraceExporter.d.ts +4 -5
  48. package/build/src/platform/browser/OTLPTraceExporter.js +11 -12
  49. package/build/src/platform/browser/OTLPTraceExporter.js.map +1 -1
  50. package/build/src/platform/browser/index.d.ts +0 -1
  51. package/build/src/platform/browser/index.js +0 -1
  52. package/build/src/platform/browser/index.js.map +1 -1
  53. package/build/src/platform/index.d.ts +0 -1
  54. package/build/src/platform/index.js +0 -3
  55. package/build/src/platform/index.js.map +1 -1
  56. package/build/src/platform/node/OTLPTraceExporter.d.ts +5 -5
  57. package/build/src/platform/node/OTLPTraceExporter.js +12 -12
  58. package/build/src/platform/node/OTLPTraceExporter.js.map +1 -1
  59. package/build/src/platform/node/index.d.ts +0 -3
  60. package/build/src/platform/node/index.js +0 -3
  61. package/build/src/platform/node/index.js.map +1 -1
  62. package/build/src/version.d.ts +1 -1
  63. package/build/src/version.js +1 -1
  64. package/build/src/version.js.map +1 -1
  65. package/package.json +32 -22
  66. package/build/esm/OTLPExporterBase.d.ts +0 -36
  67. package/build/esm/OTLPExporterBase.js +0 -114
  68. package/build/esm/OTLPExporterBase.js.map +0 -1
  69. package/build/esm/platform/browser/OTLPExporterBrowserBase.d.ts +0 -18
  70. package/build/esm/platform/browser/OTLPExporterBrowserBase.js +0 -91
  71. package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
  72. package/build/esm/platform/browser/util.d.ts +0 -17
  73. package/build/esm/platform/browser/util.js +0 -77
  74. package/build/esm/platform/browser/util.js.map +0 -1
  75. package/build/esm/platform/node/OTLPExporterNodeBase.d.ts +0 -20
  76. package/build/esm/platform/node/OTLPExporterNodeBase.js +0 -82
  77. package/build/esm/platform/node/OTLPExporterNodeBase.js.map +0 -1
  78. package/build/esm/platform/node/types.d.ts +0 -17
  79. package/build/esm/platform/node/types.js +0 -6
  80. package/build/esm/platform/node/types.js.map +0 -1
  81. package/build/esm/platform/node/util.d.ts +0 -17
  82. package/build/esm/platform/node/util.js +0 -113
  83. package/build/esm/platform/node/util.js.map +0 -1
  84. package/build/esm/transform.d.ts +0 -80
  85. package/build/esm/transform.js +0 -271
  86. package/build/esm/transform.js.map +0 -1
  87. package/build/esm/types.d.ts +0 -241
  88. package/build/esm/types.js +0 -176
  89. package/build/esm/types.js.map +0 -1
  90. package/build/esm/util.d.ts +0 -7
  91. package/build/esm/util.js +0 -40
  92. package/build/esm/util.js.map +0 -1
  93. package/build/src/OTLPExporterBase.d.ts +0 -36
  94. package/build/src/OTLPExporterBase.js +0 -113
  95. package/build/src/OTLPExporterBase.js.map +0 -1
  96. package/build/src/platform/browser/OTLPExporterBrowserBase.d.ts +0 -18
  97. package/build/src/platform/browser/OTLPExporterBrowserBase.js +0 -74
  98. package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
  99. package/build/src/platform/browser/util.d.ts +0 -17
  100. package/build/src/platform/browser/util.js +0 -70
  101. package/build/src/platform/browser/util.js.map +0 -1
  102. package/build/src/platform/node/OTLPExporterNodeBase.d.ts +0 -20
  103. package/build/src/platform/node/OTLPExporterNodeBase.js +0 -65
  104. package/build/src/platform/node/OTLPExporterNodeBase.js.map +0 -1
  105. package/build/src/platform/node/types.d.ts +0 -17
  106. package/build/src/platform/node/types.js +0 -9
  107. package/build/src/platform/node/types.js.map +0 -1
  108. package/build/src/platform/node/util.d.ts +0 -17
  109. package/build/src/platform/node/util.js +0 -107
  110. package/build/src/platform/node/util.js.map +0 -1
  111. package/build/src/transform.d.ts +0 -80
  112. package/build/src/transform.js +0 -282
  113. package/build/src/transform.js.map +0 -1
  114. package/build/src/types.d.ts +0 -241
  115. package/build/src/types.js +0 -160
  116. package/build/src/types.js.map +0 -1
  117. package/build/src/util.d.ts +0 -7
  118. package/build/src/util.js +0 -43
  119. package/build/src/util.js.map +0 -1
@@ -0,0 +1,43 @@
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 { getEnv, baggageUtils } from '@opentelemetry/core';
17
+ import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
18
+ import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded } from '@opentelemetry/otlp-exporter-base';
19
+ import { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
20
+ const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';
21
+ const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
22
+ /**
23
+ * Collector Trace Exporter for Node
24
+ */
25
+ export class OTLPTraceExporter extends OTLPExporterNodeBase {
26
+ constructor(config = {}) {
27
+ super(config);
28
+ this.headers = Object.assign(this.headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
29
+ }
30
+ convert(spans) {
31
+ return createExportTraceServiceRequest(spans, true);
32
+ }
33
+ getDefaultUrl(config) {
34
+ return typeof config.url === 'string'
35
+ ? config.url
36
+ : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
37
+ ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
38
+ : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
39
+ ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
40
+ : DEFAULT_COLLECTOR_URL;
41
+ }
42
+ }
43
+ //# sourceMappingURL=OTLPTraceExporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPTraceExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAEL,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,+BAA+B,EAA8B,MAAM,iCAAiC,CAAC;AAE9G,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAM,OAAO,iBACX,SAAQ,oBACqB;IAE7B,YAAY,SAAqC,EAAE;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B,IAAI,CAAC,OAAO,EACZ,YAAY,CAAC,uBAAuB,CAClC,MAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,KAAqB;QAC3B,OAAO,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACtD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,kCAAkC,EAAE,+BAA+B,CAAC;gBAC3G,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBAC/C,CAAC,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAChG,CAAC,CAAC,qBAAqB,CAAC;IAChC,CAAC;CACF","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 { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded\n} from '@opentelemetry/otlp-exporter-base';\nimport { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Node\n */\nexport class OTLPTraceExporter\n extends OTLPExporterNodeBase<ReadableSpan,\n IExportTraceServiceRequest>\n implements SpanExporter {\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n super(config);\n this.headers = Object.assign(\n this.headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n\n convert(spans: ReadableSpan[]): IExportTraceServiceRequest {\n return createExportTraceServiceRequest(spans, true);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './OTLPTraceExporter';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
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
+ export * from './OTLPTraceExporter';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qBAAqB,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\nexport * from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "0.29.1";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,18 @@
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
+ // this is autogenerated file, see scripts/version-update.js
17
+ export const VERSION = '0.29.1';
18
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,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.1';\n"]}
@@ -1,6 +1,2 @@
1
- export * from './OTLPExporterBase';
2
1
  export * from './platform';
3
- export * as otlpTypes from './types';
4
- export { toCollectorResource, toOTLPExportTraceServiceRequest } from './transform';
5
- export { appendResourcePathToUrlIfNotPresent } from './util';
6
2
  //# sourceMappingURL=index.d.ts.map
@@ -25,13 +25,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
25
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.appendResourcePathToUrlIfNotPresent = exports.toOTLPExportTraceServiceRequest = exports.toCollectorResource = exports.otlpTypes = void 0;
29
- __exportStar(require("./OTLPExporterBase"), exports);
30
28
  __exportStar(require("./platform"), exports);
31
- exports.otlpTypes = require("./types");
32
- var transform_1 = require("./transform");
33
- Object.defineProperty(exports, "toCollectorResource", { enumerable: true, get: function () { return transform_1.toCollectorResource; } });
34
- Object.defineProperty(exports, "toOTLPExportTraceServiceRequest", { enumerable: true, get: function () { return transform_1.toOTLPExportTraceServiceRequest; } });
35
- var util_1 = require("./util");
36
- Object.defineProperty(exports, "appendResourcePathToUrlIfNotPresent", { enumerable: true, get: function () { return util_1.appendResourcePathToUrlIfNotPresent; } });
37
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,6CAA2B;AAC3B,uCAAqC;AACrC,yCAAmF;AAA1E,gHAAA,mBAAmB,OAAA;AAAE,4HAAA,+BAA+B,OAAA;AAC7D,+BAA6D;AAApD,2HAAA,mCAAmC,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 * from './OTLPExporterBase';\nexport * from './platform';\nexport * as otlpTypes from './types';\nexport { toCollectorResource, toOTLPExportTraceServiceRequest } from './transform';\nexport { appendResourcePathToUrlIfNotPresent } from './util';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,6CAA2B","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 './platform';\n"]}
@@ -1,13 +1,12 @@
1
- import { OTLPExporterConfigBase } from '../../types';
2
- import { OTLPExporterBrowserBase } from './OTLPExporterBrowserBase';
3
1
  import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
4
- import * as otlpTypes from '../../types';
2
+ import { OTLPExporterConfigBase, OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
4
  /**
6
5
  * Collector Trace Exporter for Web
7
6
  */
8
- export declare class OTLPTraceExporter extends OTLPExporterBrowserBase<ReadableSpan, otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest> implements SpanExporter {
7
+ export declare class OTLPTraceExporter extends OTLPExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
8
  constructor(config?: OTLPExporterConfigBase);
10
- convert(spans: ReadableSpan[]): otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest;
9
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
10
  getDefaultUrl(config: OTLPExporterConfigBase): string;
12
11
  }
13
12
  //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -16,30 +16,29 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.OTLPTraceExporter = void 0;
19
- const OTLPExporterBrowserBase_1 = require("./OTLPExporterBrowserBase");
20
- const transform_1 = require("../../transform");
21
19
  const core_1 = require("@opentelemetry/core");
22
- const util_1 = require("../../util");
23
- const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
24
- const DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
20
+ const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
21
+ const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
22
+ const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';
23
+ const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
25
24
  /**
26
25
  * Collector Trace Exporter for Web
27
26
  */
28
- class OTLPTraceExporter extends OTLPExporterBrowserBase_1.OTLPExporterBrowserBase {
27
+ class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterBrowserBase {
29
28
  constructor(config = {}) {
30
29
  super(config);
31
- this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
30
+ this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
32
31
  }
33
32
  convert(spans) {
34
- return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);
33
+ return (0, otlp_transformer_1.createExportTraceServiceRequest)(spans, true);
35
34
  }
36
35
  getDefaultUrl(config) {
37
36
  return typeof config.url === 'string'
38
37
  ? config.url
39
- : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
40
- ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
41
- : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
42
- ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
38
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
39
+ ? (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
40
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
41
+ ? (0, otlp_exporter_base_1.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
43
42
  : DEFAULT_COLLECTOR_URL;
44
43
  }
45
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,uEAAoE;AAEpE,+CAAkE;AAElE,8CAA2D;AAC3D,qCAAiE;AAEjE,MAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,MAAM,qBAAqB,GAAC,yBAAyB,+BAA+B,EAAE,CAAC;AAEvF;;GAEG;AACH,MAAa,iBACX,SAAQ,iDAGP;IAED,YAAY,SAAiC,EAAE;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,IAAI,CAAC,QAAQ,EACb,mBAAY,CAAC,uBAAuB,CAClC,aAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IACD,OAAO,CACL,KAAqB;QAErB,OAAO,2CAA+B,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,aAAM,EAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACxD,CAAC,CAAC,aAAM,EAAE,CAAC,kCAAkC;gBAC7C,CAAC,CAAC,aAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,0CAAmC,CAAC,aAAM,EAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAC5G,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;CACF;AA9BD,8CA8BC","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 { OTLPExporterConfigBase } from '../../types';\nimport { OTLPExporterBrowserBase } from './OTLPExporterBrowserBase';\nimport { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { toOTLPExportTraceServiceRequest } from '../../transform';\nimport * as otlpTypes from '../../types';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { appendResourcePathToUrlIfNotPresent } from '../../util';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';\nconst DEFAULT_COLLECTOR_URL=`http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Web\n */\nexport class OTLPTraceExporter\n extends OTLPExporterBrowserBase<\n ReadableSpan,\n otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest\n >\n implements SpanExporter {\n constructor(config: OTLPExporterConfigBase = {}) {\n super(config);\n this._headers = Object.assign(\n this._headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n convert(\n spans: ReadableSpan[]\n ): otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest {\n return toOTLPExportTraceServiceRequest(spans, this, true);\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrlIfNotPresent(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAC3D,0EAK2C;AAC3C,sEAA8G;AAE9G,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAa,iBACX,SAAQ,4CAGP;IAED,YAAY,SAAiC,EAAE;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,IAAI,CAAC,QAAQ,EACb,mBAAY,CAAC,uBAAuB,CAClC,IAAA,aAAM,GAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,KAAqB;QAC3B,OAAO,IAAA,kDAA+B,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACtD,CAAC,CAAC,IAAA,gDAA2B,EAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,EAAE,+BAA+B,CAAC;gBAC3G,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBAC/C,CAAC,CAAC,IAAA,4CAAuB,EAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAChG,CAAC,CAAC,qBAAqB,CAAC;IAChC,CAAC;CACF;AA5BD,8CA4BC","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 { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterBrowserBase\n} from '@opentelemetry/otlp-exporter-base';\nimport { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Web\n */\nexport class OTLPTraceExporter\n extends OTLPExporterBrowserBase<\n ReadableSpan,\n IExportTraceServiceRequest\n >\n implements SpanExporter {\n constructor(config: OTLPExporterConfigBase = {}) {\n super(config);\n this._headers = Object.assign(\n this._headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n convert(spans: ReadableSpan[]): IExportTraceServiceRequest {\n return createExportTraceServiceRequest(spans, true);\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './OTLPTraceExporter';
2
- export * from './OTLPExporterBrowserBase';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -26,5 +26,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  __exportStar(require("./OTLPTraceExporter"), exports);
29
- __exportStar(require("./OTLPExporterBrowserBase"), exports);
30
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,sDAAoC;AACpC,4DAA0C","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 './OTLPTraceExporter';\nexport * from './OTLPExporterBrowserBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,sDAAoC","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 './OTLPTraceExporter';\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './node';
2
- export { OTLPExporterBrowserBase } from './browser';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -25,8 +25,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
25
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.OTLPExporterBrowserBase = void 0;
29
28
  __exportStar(require("./node"), exports);
30
- var browser_1 = require("./browser");
31
- Object.defineProperty(exports, "OTLPExporterBrowserBase", { enumerable: true, get: function () { return browser_1.OTLPExporterBrowserBase; } });
32
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,qCAAoD;AAA3C,kHAAA,uBAAuB,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 * from './node';\nexport { OTLPExporterBrowserBase } from './browser';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,yCAAuB","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 './node';\n"]}
@@ -1,13 +1,13 @@
1
1
  import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
- import { OTLPExporterNodeBase } from './OTLPExporterNodeBase';
3
- import { OTLPExporterNodeConfigBase } from './types';
4
- import * as otlpTypes from '../../types';
2
+ import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
5
  /**
6
6
  * Collector Trace Exporter for Node
7
7
  */
8
- export declare class OTLPTraceExporter extends OTLPExporterNodeBase<ReadableSpan, otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest> implements SpanExporter {
8
+ export declare class OTLPTraceExporter extends OTLPExporterNodeBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
9
  constructor(config?: OTLPExporterNodeConfigBase);
10
- convert(spans: ReadableSpan[]): otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest;
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
11
  getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
12
12
  }
13
13
  //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -16,30 +16,30 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.OTLPTraceExporter = void 0;
19
- const OTLPExporterNodeBase_1 = require("./OTLPExporterNodeBase");
20
- const transform_1 = require("../../transform");
21
19
  const core_1 = require("@opentelemetry/core");
22
- const util_1 = require("../../util");
23
- const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
24
- const DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
20
+ const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
21
+ const otlp_exporter_base_2 = require("@opentelemetry/otlp-exporter-base");
22
+ const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
23
+ const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';
24
+ const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
25
25
  /**
26
26
  * Collector Trace Exporter for Node
27
27
  */
28
- class OTLPTraceExporter extends OTLPExporterNodeBase_1.OTLPExporterNodeBase {
28
+ class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterNodeBase {
29
29
  constructor(config = {}) {
30
30
  super(config);
31
- this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
31
+ this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
32
32
  }
33
33
  convert(spans) {
34
- return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);
34
+ return (0, otlp_transformer_1.createExportTraceServiceRequest)(spans, true);
35
35
  }
36
36
  getDefaultUrl(config) {
37
37
  return typeof config.url === 'string'
38
38
  ? config.url
39
- : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
40
- ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
41
- : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
42
- ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
39
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
40
+ ? (0, otlp_exporter_base_2.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
41
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
42
+ ? (0, otlp_exporter_base_2.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
43
43
  : DEFAULT_COLLECTOR_URL;
44
44
  }
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,iEAA8D;AAG9D,+CAAkE;AAClE,8CAA2D;AAC3D,qCAAiE;AAEjE,MAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,MAAM,qBAAqB,GAAC,yBAAyB,+BAA+B,EAAE,CAAC;AAEvF;;GAEG;AACH,MAAa,iBACX,SAAQ,2CAGP;IAED,YAAY,SAAqC,EAAE;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B,IAAI,CAAC,OAAO,EACZ,mBAAY,CAAC,uBAAuB,CAClC,aAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAqB;QAErB,OAAO,2CAA+B,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,aAAM,EAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACxD,CAAC,CAAC,aAAM,EAAE,CAAC,kCAAkC;gBAC7C,CAAC,CAAC,aAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,0CAAmC,CAAC,aAAM,EAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAC5G,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;CACF;AA/BD,8CA+BC","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 { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { OTLPExporterNodeBase } from './OTLPExporterNodeBase';\nimport { OTLPExporterNodeConfigBase } from './types';\nimport * as otlpTypes from '../../types';\nimport { toOTLPExportTraceServiceRequest } from '../../transform';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { appendResourcePathToUrlIfNotPresent } from '../../util';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';\nconst DEFAULT_COLLECTOR_URL=`http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Node\n */\nexport class OTLPTraceExporter\n extends OTLPExporterNodeBase<\n ReadableSpan,\n otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest\n >\n implements SpanExporter {\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n super(config);\n this.headers = Object.assign(\n this.headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n\n convert(\n spans: ReadableSpan[]\n ): otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest {\n return toOTLPExportTraceServiceRequest(spans, this, true);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase) : string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrlIfNotPresent(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAC3D,0EAAyE;AACzE,0EAI2C;AAC3C,sEAA8G;AAE9G,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAa,iBACX,SAAQ,yCACqB;IAE7B,YAAY,SAAqC,EAAE;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B,IAAI,CAAC,OAAO,EACZ,mBAAY,CAAC,uBAAuB,CAClC,IAAA,aAAM,GAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,KAAqB;QAC3B,OAAO,IAAA,kDAA+B,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACtD,CAAC,CAAC,IAAA,gDAA2B,EAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,EAAE,+BAA+B,CAAC;gBAC3G,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBAC/C,CAAC,CAAC,IAAA,4CAAuB,EAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAChG,CAAC,CAAC,qBAAqB,CAAC;IAChC,CAAC;CACF;AA3BD,8CA2BC","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 { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded\n} from '@opentelemetry/otlp-exporter-base';\nimport { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Node\n */\nexport class OTLPTraceExporter\n extends OTLPExporterNodeBase<ReadableSpan,\n IExportTraceServiceRequest>\n implements SpanExporter {\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n super(config);\n this.headers = Object.assign(\n this.headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n\n convert(spans: ReadableSpan[]): IExportTraceServiceRequest {\n return createExportTraceServiceRequest(spans, true);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
@@ -1,5 +1,2 @@
1
1
  export * from './OTLPTraceExporter';
2
- export * from './OTLPExporterNodeBase';
3
- export * from './util';
4
- export * from './types';
5
2
  //# sourceMappingURL=index.d.ts.map
@@ -26,7 +26,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  __exportStar(require("./OTLPTraceExporter"), exports);
29
- __exportStar(require("./OTLPExporterNodeBase"), exports);
30
- __exportStar(require("./util"), exports);
31
- __exportStar(require("./types"), exports);
32
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,sDAAoC;AACpC,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 './OTLPTraceExporter';\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,sDAAoC","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 './OTLPTraceExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.27.0";
1
+ export declare const VERSION = "0.29.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.27.0';
20
+ exports.VERSION = '0.29.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.27.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.29.1';\n"]}
package/package.json CHANGED
@@ -1,20 +1,23 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-trace-otlp-http",
3
- "version": "0.27.0",
3
+ "version": "0.29.1",
4
4
  "description": "OpenTelemetry Collector Trace Exporter allows user to send collected traces to the OpenTelemetry Collector",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
7
+ "esnext": "build/esnext/index.js",
7
8
  "types": "build/src/index.d.ts",
8
9
  "repository": "open-telemetry/opentelemetry-js",
9
10
  "browser": {
10
11
  "./src/platform/index.ts": "./src/platform/browser/index.ts",
11
12
  "./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
13
+ "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
12
14
  "./build/src/platform/index.js": "./build/src/platform/browser/index.js"
13
15
  },
14
16
  "scripts": {
15
- "compile": "tsc --build tsconfig.json tsconfig.esm.json",
16
- "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
17
- "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
17
+ "prepublishOnly": "npm run compile",
18
+ "compile": "tsc --build tsconfig.all.json",
19
+ "clean": "tsc --build --clean tsconfig.all.json",
20
+ "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
18
21
  "lint": "eslint . --ext .ts",
19
22
  "lint:fix": "eslint . --ext .ts --fix",
20
23
  "tdd": "npm run test -- --watch-extensions ts --watch",
@@ -22,9 +25,11 @@
22
25
  "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
23
26
  "test:browser": "nyc karma start --single-run",
24
27
  "version": "node ../../../scripts/version-update.js",
25
- "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
26
- "precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
27
- "prewatch": "npm run precompile"
28
+ "watch": "tsc --build --watch tsconfig.all.json",
29
+ "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies",
30
+ "prewatch": "npm run precompile",
31
+ "peer-api-check": "node ../../../scripts/peer-api-check.js",
32
+ "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../"
28
33
  },
29
34
  "keywords": [
30
35
  "opentelemetry",
@@ -38,12 +43,15 @@
38
43
  "author": "OpenTelemetry Authors",
39
44
  "license": "Apache-2.0",
40
45
  "engines": {
41
- "node": ">=8.0.0"
46
+ "node": ">=8.12.0"
42
47
  },
43
48
  "files": [
44
49
  "build/esm/**/*.js",
45
50
  "build/esm/**/*.js.map",
46
51
  "build/esm/**/*.d.ts",
52
+ "build/esnext/**/*.js",
53
+ "build/esnext/**/*.js.map",
54
+ "build/esnext/**/*.d.ts",
47
55
  "build/src/**/*.js",
48
56
  "build/src/**/*.js.map",
49
57
  "build/src/**/*.d.ts",
@@ -55,17 +63,17 @@
55
63
  "access": "public"
56
64
  },
57
65
  "devDependencies": {
58
- "@babel/core": "7.15.0",
59
- "@opentelemetry/api": "^1.0.3",
66
+ "@babel/core": "7.16.0",
67
+ "@opentelemetry/api": "^1.0.0",
60
68
  "@types/mocha": "8.2.3",
61
- "@types/node": "14.17.11",
62
- "@types/sinon": "10.0.2",
63
- "@types/webpack-env": "1.16.2",
64
- "babel-loader": "8.2.2",
69
+ "@types/node": "14.17.33",
70
+ "@types/sinon": "10.0.6",
71
+ "@types/webpack-env": "1.16.3",
72
+ "babel-loader": "8.2.3",
65
73
  "codecov": "3.8.3",
66
74
  "cpx": "1.5.0",
67
75
  "istanbul-instrumenter-loader": "3.0.1",
68
- "karma": "6.3.7",
76
+ "karma": "6.3.16",
69
77
  "karma-chrome-launcher": "3.1.0",
70
78
  "karma-coverage-istanbul-reporter": "3.0.3",
71
79
  "karma-mocha": "2.0.1",
@@ -76,19 +84,21 @@
76
84
  "rimraf": "3.0.2",
77
85
  "sinon": "12.0.1",
78
86
  "ts-loader": "8.3.0",
79
- "ts-mocha": "8.0.0",
80
- "typescript": "4.3.5",
87
+ "ts-mocha": "9.0.2",
88
+ "typescript": "4.4.4",
81
89
  "webpack": "4.46.0",
82
- "webpack-cli": "4.8.0",
90
+ "webpack-cli": "4.9.1",
83
91
  "webpack-merge": "5.8.0"
84
92
  },
85
93
  "peerDependencies": {
86
94
  "@opentelemetry/api": "^1.0.0"
87
95
  },
88
96
  "dependencies": {
89
- "@opentelemetry/core": "1.0.1",
90
- "@opentelemetry/resources": "1.0.1",
91
- "@opentelemetry/sdk-trace-base": "1.0.1"
97
+ "@opentelemetry/core": "1.3.0",
98
+ "@opentelemetry/otlp-exporter-base": "0.29.1",
99
+ "@opentelemetry/otlp-transformer": "0.29.1",
100
+ "@opentelemetry/resources": "1.3.0",
101
+ "@opentelemetry/sdk-trace-base": "1.3.0"
92
102
  },
93
- "gitHead": "f5e227f0cb829df1ca2dc220a3e0e8ae0e607405"
103
+ "gitHead": "094f016ac6697fc45ba5d7b5765f5c3e56f18d1e"
94
104
  }
@@ -1,36 +0,0 @@
1
- import { SpanAttributes } from '@opentelemetry/api';
2
- import { ExportResult } from '@opentelemetry/core';
3
- import { OTLPExporterError, OTLPExporterConfigBase } from './types';
4
- /**
5
- * Collector Exporter abstract base class
6
- */
7
- export declare abstract class OTLPExporterBase<T extends OTLPExporterConfigBase, ExportItem, ServiceRequest> {
8
- readonly url: string;
9
- readonly hostname: string | undefined;
10
- readonly attributes?: SpanAttributes;
11
- protected _concurrencyLimit: number;
12
- protected _isShutdown: boolean;
13
- private _shuttingDownPromise;
14
- protected _sendingPromises: Promise<unknown>[];
15
- /**
16
- * @param config
17
- */
18
- constructor(config?: T);
19
- /**
20
- * Export items.
21
- * @param items
22
- * @param resultCallback
23
- */
24
- export(items: ExportItem[], resultCallback: (result: ExportResult) => void): void;
25
- private _export;
26
- /**
27
- * Shutdown the exporter.
28
- */
29
- shutdown(): Promise<void>;
30
- abstract onShutdown(): void;
31
- abstract onInit(config: T): void;
32
- abstract send(items: ExportItem[], onSuccess: () => void, onError: (error: OTLPExporterError) => void): void;
33
- abstract getDefaultUrl(config: T): string;
34
- abstract convert(objects: ExportItem[]): ServiceRequest;
35
- }
36
- //# sourceMappingURL=OTLPExporterBase.d.ts.map