@opentelemetry/exporter-trace-otlp-proto 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 (65) hide show
  1. package/build/esm/index.d.ts +2 -0
  2. package/build/esm/index.js +17 -0
  3. package/build/esm/index.js.map +1 -0
  4. package/build/esm/platform/browser/OTLPTraceExporter.d.ts +14 -0
  5. package/build/esm/platform/browser/OTLPTraceExporter.js +66 -0
  6. package/build/esm/platform/browser/OTLPTraceExporter.js.map +1 -0
  7. package/build/esm/platform/browser/index.d.ts +2 -0
  8. package/build/esm/platform/browser/index.js +17 -0
  9. package/build/esm/platform/browser/index.js.map +1 -0
  10. package/build/esm/platform/index.d.ts +2 -0
  11. package/build/esm/platform/index.js +17 -0
  12. package/build/esm/platform/index.js.map +1 -0
  13. package/build/{src → esm/platform/node}/OTLPTraceExporter.d.ts +0 -0
  14. package/build/esm/platform/node/OTLPTraceExporter.js +66 -0
  15. package/build/esm/platform/node/OTLPTraceExporter.js.map +1 -0
  16. package/build/esm/platform/node/index.d.ts +2 -0
  17. package/build/esm/platform/node/index.js +17 -0
  18. package/build/esm/platform/node/index.js.map +1 -0
  19. package/build/esm/version.d.ts +2 -0
  20. package/build/esm/version.js +18 -0
  21. package/build/esm/version.js.map +1 -0
  22. package/build/esnext/index.d.ts +2 -0
  23. package/build/esnext/index.js +17 -0
  24. package/build/esnext/index.js.map +1 -0
  25. package/build/esnext/platform/browser/OTLPTraceExporter.d.ts +14 -0
  26. package/build/esnext/platform/browser/OTLPTraceExporter.js +46 -0
  27. package/build/esnext/platform/browser/OTLPTraceExporter.js.map +1 -0
  28. package/build/esnext/platform/browser/index.d.ts +2 -0
  29. package/build/esnext/platform/browser/index.js +17 -0
  30. package/build/esnext/platform/browser/index.js.map +1 -0
  31. package/build/esnext/platform/index.d.ts +2 -0
  32. package/build/esnext/platform/index.js +17 -0
  33. package/build/esnext/platform/index.js.map +1 -0
  34. package/build/esnext/platform/node/OTLPTraceExporter.d.ts +14 -0
  35. package/build/esnext/platform/node/OTLPTraceExporter.js +46 -0
  36. package/build/esnext/platform/node/OTLPTraceExporter.js.map +1 -0
  37. package/build/esnext/platform/node/index.d.ts +2 -0
  38. package/build/esnext/platform/node/index.js +17 -0
  39. package/build/esnext/platform/node/index.js.map +1 -0
  40. package/build/esnext/version.d.ts +2 -0
  41. package/build/esnext/version.js +18 -0
  42. package/build/esnext/version.js.map +1 -0
  43. package/build/src/index.d.ts +1 -1
  44. package/build/src/index.js +4 -12
  45. package/build/src/index.js.map +1 -1
  46. package/build/src/platform/browser/OTLPTraceExporter.d.ts +14 -0
  47. package/build/src/platform/browser/OTLPTraceExporter.js +50 -0
  48. package/build/src/platform/browser/OTLPTraceExporter.js.map +1 -0
  49. package/build/src/platform/browser/index.d.ts +2 -0
  50. package/build/src/platform/browser/index.js +21 -0
  51. package/build/src/platform/browser/index.js.map +1 -0
  52. package/build/src/platform/index.d.ts +2 -0
  53. package/build/src/platform/index.js +21 -0
  54. package/build/src/platform/index.js.map +1 -0
  55. package/build/src/platform/node/OTLPTraceExporter.d.ts +14 -0
  56. package/build/src/{OTLPTraceExporter.js → platform/node/OTLPTraceExporter.js} +0 -0
  57. package/build/src/platform/node/OTLPTraceExporter.js.map +1 -0
  58. package/build/src/platform/node/index.d.ts +2 -0
  59. package/build/src/platform/node/index.js +21 -0
  60. package/build/src/platform/node/index.js.map +1 -0
  61. package/build/src/version.d.ts +1 -1
  62. package/build/src/version.js +1 -1
  63. package/build/src/version.js.map +1 -1
  64. package/package.json +29 -14
  65. package/build/src/OTLPTraceExporter.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './platform';
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 { OTLPTraceExporter } from './platform';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,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 */\nexport { OTLPTraceExporter } from './platform';\n"]}
@@ -0,0 +1,14 @@
1
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+ import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPProtoExporterBrowserBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Collector Trace Exporter for Web
7
+ */
8
+ export declare class OTLPTraceExporter extends OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
+ constructor(config?: OTLPExporterConfigBase);
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
+ getDefaultUrl(config: OTLPExporterConfigBase): string;
12
+ getServiceClientType(): ServiceClientType;
13
+ }
14
+ //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -0,0 +1,66 @@
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
+ var __extends = (this && this.__extends) || (function () {
17
+ var extendStatics = function (d, b) {
18
+ extendStatics = Object.setPrototypeOf ||
19
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
+ return extendStatics(d, b);
22
+ };
23
+ return function (d, b) {
24
+ if (typeof b !== "function" && b !== null)
25
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
26
+ extendStatics(d, b);
27
+ function __() { this.constructor = d; }
28
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29
+ };
30
+ })();
31
+ import { getEnv, baggageUtils } from '@opentelemetry/core';
32
+ import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
33
+ import { OTLPProtoExporterBrowserBase, ServiceClientType, } from '@opentelemetry/otlp-proto-exporter-base';
34
+ import { createExportTraceServiceRequest, } from '@opentelemetry/otlp-transformer';
35
+ var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';
36
+ var DEFAULT_COLLECTOR_URL = "http://localhost:4318/" + DEFAULT_COLLECTOR_RESOURCE_PATH;
37
+ /**
38
+ * Collector Trace Exporter for Web
39
+ */
40
+ var OTLPTraceExporter = /** @class */ (function (_super) {
41
+ __extends(OTLPTraceExporter, _super);
42
+ function OTLPTraceExporter(config) {
43
+ if (config === void 0) { config = {}; }
44
+ var _this = _super.call(this, config) || this;
45
+ _this._headers = Object.assign(_this._headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
46
+ return _this;
47
+ }
48
+ OTLPTraceExporter.prototype.convert = function (spans) {
49
+ return createExportTraceServiceRequest(spans);
50
+ };
51
+ OTLPTraceExporter.prototype.getDefaultUrl = function (config) {
52
+ return typeof config.url === 'string'
53
+ ? config.url
54
+ : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
55
+ ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT)
56
+ : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
57
+ ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
58
+ : DEFAULT_COLLECTOR_URL;
59
+ };
60
+ OTLPTraceExporter.prototype.getServiceClientType = function () {
61
+ return ServiceClientType.SPANS;
62
+ };
63
+ return OTLPTraceExporter;
64
+ }(OTLPProtoExporterBrowserBase));
65
+ export { OTLPTraceExporter };
66
+ //# sourceMappingURL=OTLPTraceExporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAEL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AAEzC,IAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AAEzF;;GAEG;AACH;IACU,qCAAsE;IAG9E,2BAAY,MAAmC;QAAnC,uBAAA,EAAA,WAAmC;QAA/C,YACE,kBAAM,MAAM,CAAC,SAOd;QANC,KAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,KAAI,CAAC,QAAQ,EACb,YAAY,CAAC,uBAAuB,CAClC,MAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;;IACJ,CAAC;IACD,mCAAO,GAAP,UAAQ,KAAqB;QAC3B,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,yCAAa,GAAb,UAAc,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACxD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,gDAAoB,GAApB;QACE,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;IACH,wBAAC;AAAD,CAAC,AAjCD,CACU,4BAA4B,GAgCrC","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} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterBrowserBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } 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 { OTLPTraceExporter } from './OTLPTraceExporter';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 */\nexport { OTLPTraceExporter } from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './node';
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 { OTLPTraceExporter } from './node';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 */\nexport { OTLPTraceExporter } from './node';\n"]}
@@ -0,0 +1,66 @@
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
+ var __extends = (this && this.__extends) || (function () {
17
+ var extendStatics = function (d, b) {
18
+ extendStatics = Object.setPrototypeOf ||
19
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
+ return extendStatics(d, b);
22
+ };
23
+ return function (d, b) {
24
+ if (typeof b !== "function" && b !== null)
25
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
26
+ extendStatics(d, b);
27
+ function __() { this.constructor = d; }
28
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29
+ };
30
+ })();
31
+ import { getEnv, baggageUtils } from '@opentelemetry/core';
32
+ import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
33
+ import { OTLPProtoExporterNodeBase, ServiceClientType, } from '@opentelemetry/otlp-proto-exporter-base';
34
+ import { createExportTraceServiceRequest, } from '@opentelemetry/otlp-transformer';
35
+ var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/traces';
36
+ var DEFAULT_COLLECTOR_URL = "http://localhost:4318/" + DEFAULT_COLLECTOR_RESOURCE_PATH;
37
+ /**
38
+ * Collector Trace Exporter for Node with protobuf
39
+ */
40
+ var OTLPTraceExporter = /** @class */ (function (_super) {
41
+ __extends(OTLPTraceExporter, _super);
42
+ function OTLPTraceExporter(config) {
43
+ if (config === void 0) { config = {}; }
44
+ var _this = _super.call(this, config) || this;
45
+ _this.headers = Object.assign(_this.headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
46
+ return _this;
47
+ }
48
+ OTLPTraceExporter.prototype.convert = function (spans) {
49
+ return createExportTraceServiceRequest(spans);
50
+ };
51
+ OTLPTraceExporter.prototype.getDefaultUrl = function (config) {
52
+ return typeof config.url === 'string'
53
+ ? config.url
54
+ : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
55
+ ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT)
56
+ : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
57
+ ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
58
+ : DEFAULT_COLLECTOR_URL;
59
+ };
60
+ OTLPTraceExporter.prototype.getServiceClientType = function () {
61
+ return ServiceClientType.SPANS;
62
+ };
63
+ return OTLPTraceExporter;
64
+ }(OTLPProtoExporterNodeBase));
65
+ export { OTLPTraceExporter };
66
+ //# 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,EAEL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AAEzC,IAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AAEzF;;GAEG;AACH;IACU,qCAAmE;IAG3E,2BAAY,MAAuC;QAAvC,uBAAA,EAAA,WAAuC;QAAnD,YACE,kBAAM,MAAM,CAAC,SAOd;QANC,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B,KAAI,CAAC,OAAO,EACZ,YAAY,CAAC,uBAAuB,CAClC,MAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;;IACJ,CAAC;IAED,mCAAO,GAAP,UAAQ,KAAqB;QAC3B,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,yCAAa,GAAb,UAAc,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;gBACxD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,gDAAoB,GAApB;QACE,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;IACH,wBAAC;AAAD,CAAC,AAlCD,CACU,yBAAyB,GAiClC","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 OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterNodeBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 with protobuf\n */\nexport class OTLPTraceExporter\n extends OTLPProtoExporterNodeBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase) {\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } 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 { OTLPTraceExporter } 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 { OTLPTraceExporter } from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "0.35.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 var VERSION = '0.35.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,IAAM,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"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './platform';
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 { OTLPTraceExporter } from './platform';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,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 */\nexport { OTLPTraceExporter } from './platform';\n"]}
@@ -0,0 +1,14 @@
1
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+ import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPProtoExporterBrowserBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Collector Trace Exporter for Web
7
+ */
8
+ export declare class OTLPTraceExporter extends OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
+ constructor(config?: OTLPExporterConfigBase);
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
+ getDefaultUrl(config: OTLPExporterConfigBase): string;
12
+ getServiceClientType(): ServiceClientType;
13
+ }
14
+ //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -0,0 +1,46 @@
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 { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
18
+ import { OTLPProtoExporterBrowserBase, ServiceClientType, } from '@opentelemetry/otlp-proto-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 Web
24
+ */
25
+ export class OTLPTraceExporter extends OTLPProtoExporterBrowserBase {
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);
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)
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
+ getServiceClientType() {
43
+ return ServiceClientType.SPANS;
44
+ }
45
+ }
46
+ //# sourceMappingURL=OTLPTraceExporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAEL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAM,OAAO,iBACX,SAAQ,4BAAsE;IAG9E,YAAY,SAAiC,EAAE;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,IAAI,CAAC,QAAQ,EACb,YAAY,CAAC,uBAAuB,CAClC,MAAM,EAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,KAAqB;QAC3B,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACxD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,oBAAoB;QAClB,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACjC,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 {\n OTLPExporterConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterBrowserBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } 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 { OTLPTraceExporter } from './OTLPTraceExporter';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 */\nexport { OTLPTraceExporter } from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './node';
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 { OTLPTraceExporter } from './node';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 */\nexport { OTLPTraceExporter } from './node';\n"]}
@@ -0,0 +1,14 @@
1
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+ import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPProtoExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Collector Trace Exporter for Node with protobuf
7
+ */
8
+ export declare class OTLPTraceExporter extends OTLPProtoExporterNodeBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
+ constructor(config?: OTLPExporterNodeConfigBase);
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
+ getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
12
+ getServiceClientType(): ServiceClientType;
13
+ }
14
+ //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -0,0 +1,46 @@
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 { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
18
+ import { OTLPProtoExporterNodeBase, ServiceClientType, } from '@opentelemetry/otlp-proto-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 with protobuf
24
+ */
25
+ export class OTLPTraceExporter extends OTLPProtoExporterNodeBase {
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);
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)
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
+ getServiceClientType() {
43
+ return ServiceClientType.SPANS;
44
+ }
45
+ }
46
+ //# 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,EAEL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,GAEhC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAM,OAAO,iBACX,SAAQ,yBAAmE;IAG3E,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,CAAC,CAAC;IAChD,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;gBACxD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,oBAAoB;QAClB,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACjC,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 {\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterNodeBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 with protobuf\n */\nexport class OTLPTraceExporter\n extends OTLPProtoExporterNodeBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase) {\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } 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 { OTLPTraceExporter } 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,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 { OTLPTraceExporter } from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "0.35.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.35.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.35.1';\n"]}
@@ -1,2 +1,2 @@
1
- export * from './OTLPTraceExporter';
1
+ export { OTLPTraceExporter } from './platform';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OTLPTraceExporter = void 0;
2
4
  /*
3
5
  * Copyright The OpenTelemetry Authors
4
6
  *
@@ -14,16 +16,6 @@
14
16
  * See the License for the specific language governing permissions and
15
17
  * limitations under the License.
16
18
  */
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
- Object.defineProperty(exports, "__esModule", { value: true });
28
- __exportStar(require("./OTLPTraceExporter"), exports);
19
+ var platform_1 = require("./platform");
20
+ Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function () { return platform_1.OTLPTraceExporter; } });
29
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,uCAA+C;AAAtC,6GAAA,iBAAiB,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 */\nexport { OTLPTraceExporter } from './platform';\n"]}
@@ -0,0 +1,14 @@
1
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+ import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPProtoExporterBrowserBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Collector Trace Exporter for Web
7
+ */
8
+ export declare class OTLPTraceExporter extends OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
+ constructor(config?: OTLPExporterConfigBase);
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
+ getDefaultUrl(config: OTLPExporterConfigBase): string;
12
+ getServiceClientType(): ServiceClientType;
13
+ }
14
+ //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OTLPTraceExporter = void 0;
19
+ const core_1 = require("@opentelemetry/core");
20
+ const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
21
+ const otlp_proto_exporter_base_1 = require("@opentelemetry/otlp-proto-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
+ /**
26
+ * Collector Trace Exporter for Web
27
+ */
28
+ class OTLPTraceExporter extends otlp_proto_exporter_base_1.OTLPProtoExporterBrowserBase {
29
+ constructor(config = {}) {
30
+ super(config);
31
+ this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
32
+ }
33
+ convert(spans) {
34
+ return (0, otlp_transformer_1.createExportTraceServiceRequest)(spans);
35
+ }
36
+ getDefaultUrl(config) {
37
+ return typeof config.url === 'string'
38
+ ? config.url
39
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
40
+ ? (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT)
41
+ : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
42
+ ? (0, otlp_exporter_base_1.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
43
+ : DEFAULT_COLLECTOR_URL;
44
+ }
45
+ getServiceClientType() {
46
+ return otlp_proto_exporter_base_1.ServiceClientType.SPANS;
47
+ }
48
+ }
49
+ exports.OTLPTraceExporter = OTLPTraceExporter;
50
+ //# sourceMappingURL=OTLPTraceExporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAC3D,0EAI2C;AAC3C,sFAGiD;AACjD,sEAGyC;AAEzC,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAa,iBACX,SAAQ,uDAAsE;IAG9E,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,CAAC,CAAC;IAChD,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;gBACxD,CAAC,CAAC,IAAA,gDAA2B,EAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,IAAA,4CAAuB,EACrB,IAAA,aAAM,GAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,oBAAoB;QAClB,OAAO,4CAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;CACF;AAjCD,8CAiCC","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} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterBrowserBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 OTLPProtoExporterBrowserBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './OTLPTraceExporter';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OTLPTraceExporter = void 0;
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ var OTLPTraceExporter_1 = require("./OTLPTraceExporter");
20
+ Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function () { return OTLPTraceExporter_1.OTLPTraceExporter; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,yDAAwD;AAA/C,sHAAA,iBAAiB,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 */\nexport { OTLPTraceExporter } from './OTLPTraceExporter';\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './node';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OTLPTraceExporter = void 0;
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ var node_1 = require("./node");
20
+ Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function () { return node_1.OTLPTraceExporter; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+BAA2C;AAAlC,yGAAA,iBAAiB,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 */\nexport { OTLPTraceExporter } from './node';\n"]}
@@ -0,0 +1,14 @@
1
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+ import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { OTLPProtoExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
4
+ import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
5
+ /**
6
+ * Collector Trace Exporter for Node with protobuf
7
+ */
8
+ export declare class OTLPTraceExporter extends OTLPProtoExporterNodeBase<ReadableSpan, IExportTraceServiceRequest> implements SpanExporter {
9
+ constructor(config?: OTLPExporterNodeConfigBase);
10
+ convert(spans: ReadableSpan[]): IExportTraceServiceRequest;
11
+ getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
12
+ getServiceClientType(): ServiceClientType;
13
+ }
14
+ //# sourceMappingURL=OTLPTraceExporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAC3D,0EAI2C;AAC3C,sFAGiD;AACjD,sEAGyC;AAEzC,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAa,iBACX,SAAQ,oDAAmE;IAG3E,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,CAAC,CAAC;IAChD,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;gBACxD,CAAC,CAAC,IAAA,gDAA2B,EAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC;gBAC1E,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,IAAA,4CAAuB,EACrB,IAAA,aAAM,GAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,oBAAoB;QAClB,OAAO,4CAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;CACF;AAlCD,8CAkCC","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 OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n OTLPProtoExporterNodeBase,\n ServiceClientType,\n} from '@opentelemetry/otlp-proto-exporter-base';\nimport {\n createExportTraceServiceRequest,\n IExportTraceServiceRequest,\n} 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 with protobuf\n */\nexport class OTLPTraceExporter\n extends OTLPProtoExporterNodeBase<ReadableSpan, IExportTraceServiceRequest>\n implements SpanExporter\n{\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);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase) {\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)\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { OTLPTraceExporter } from './OTLPTraceExporter';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OTLPTraceExporter = void 0;
19
+ var OTLPTraceExporter_1 = require("./OTLPTraceExporter");
20
+ Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function () { return OTLPTraceExporter_1.OTLPTraceExporter; } });
21
+ //# 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,yDAAwD;AAA/C,sHAAA,iBAAiB,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 { OTLPTraceExporter } from './OTLPTraceExporter';\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,20 +1,29 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-trace-otlp-proto",
3
- "version": "0.34.0",
3
+ "version": "0.35.1",
4
4
  "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector using protobuf over HTTP",
5
5
  "main": "build/src/index.js",
6
+ "module": "build/esm/index.js",
7
+ "esnext": "build/esnext/index.js",
6
8
  "types": "build/src/index.d.ts",
7
9
  "repository": "open-telemetry/opentelemetry-js",
10
+ "browser": {
11
+ "./src/platform/index.ts": "./src/platform/browser/index.ts",
12
+ "./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
13
+ "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
14
+ "./build/src/platform/index.js": "./build/src/platform/browser/index.js"
15
+ },
8
16
  "scripts": {
9
17
  "prepublishOnly": "npm run compile",
10
- "compile": "tsc --build",
11
- "clean": "tsc --build --clean",
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",
12
20
  "lint": "eslint . --ext .ts",
13
21
  "lint:fix": "eslint . --ext .ts --fix",
14
22
  "tdd": "npm run test -- --watch-extensions ts --watch",
15
- "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
23
+ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
24
+ "test:browser": "nyc karma start --single-run",
16
25
  "version": "node ../../../scripts/version-update.js",
17
- "watch": "tsc -w",
26
+ "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
18
27
  "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies",
19
28
  "prewatch": "npm run precompile",
20
29
  "peer-api-check": "node ../../../scripts/peer-api-check.js",
@@ -35,6 +44,12 @@
35
44
  "node": ">=14"
36
45
  },
37
46
  "files": [
47
+ "build/esm/**/*.js",
48
+ "build/esm/**/*.js.map",
49
+ "build/esm/**/*.d.ts",
50
+ "build/esnext/**/*.js",
51
+ "build/esnext/**/*.js.map",
52
+ "build/esnext/**/*.d.ts",
38
53
  "build/src/**/*.js",
39
54
  "build/src/**/*.js.map",
40
55
  "build/src/**/*.d.ts",
@@ -56,8 +71,8 @@
56
71
  "cpx": "1.5.0",
57
72
  "mocha": "10.0.0",
58
73
  "nyc": "15.1.0",
59
- "rimraf": "3.0.2",
60
- "sinon": "14.0.0",
74
+ "rimraf": "4.1.2",
75
+ "sinon": "15.0.0",
61
76
  "ts-loader": "8.4.0",
62
77
  "ts-mocha": "10.0.0",
63
78
  "typescript": "4.4.4"
@@ -66,14 +81,14 @@
66
81
  "@opentelemetry/api": "^1.0.0"
67
82
  },
68
83
  "dependencies": {
69
- "@opentelemetry/core": "1.8.0",
70
- "@opentelemetry/otlp-exporter-base": "0.34.0",
71
- "@opentelemetry/otlp-proto-exporter-base": "0.34.0",
72
- "@opentelemetry/otlp-transformer": "0.34.0",
73
- "@opentelemetry/resources": "1.8.0",
74
- "@opentelemetry/sdk-trace-base": "1.8.0"
84
+ "@opentelemetry/core": "1.9.1",
85
+ "@opentelemetry/otlp-exporter-base": "0.35.1",
86
+ "@opentelemetry/otlp-proto-exporter-base": "0.35.1",
87
+ "@opentelemetry/otlp-transformer": "0.35.1",
88
+ "@opentelemetry/resources": "1.9.1",
89
+ "@opentelemetry/sdk-trace-base": "1.9.1"
75
90
  },
76
91
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-proto",
77
92
  "sideEffects": false,
78
- "gitHead": "7972edf6659fb6e0d5928a5cf7a35f26683e168f"
93
+ "gitHead": "279458e7ddf16f7ddca5fe60c78672e05fafce66"
79
94
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../src/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAC3D,0EAI2C;AAC3C,sFAAuG;AACvG,sEAA8G;AAE9G,MAAM,+BAA+B,GAAG,WAAW,CAAC;AACpD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEzF;;GAEG;AACH,MAAa,iBACX,SAAQ,oDAGP;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,IAAA,aAAM,GAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,KAAqB;QAC3B,OAAO,IAAA,kDAA+B,EAAC,KAAK,CAAC,CAAC;IAChD,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,CAAC;gBAC1E,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;IAED,oBAAoB;QAClB,OAAO,4CAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;CACF;AAjCD,8CAiCC","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 OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded\n} from '@opentelemetry/otlp-exporter-base';\nimport { OTLPProtoExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-proto-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 with protobuf\n */\nexport class OTLPTraceExporter\n extends OTLPProtoExporterNodeBase<\n ReadableSpan,\n IExportTraceServiceRequest\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(spans: ReadableSpan[]): IExportTraceServiceRequest {\n return createExportTraceServiceRequest(spans);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase) {\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)\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 getServiceClientType() {\n return ServiceClientType.SPANS;\n }\n}\n"]}