@opentelemetry/exporter-logs-otlp-http 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  LoggerProvider,
59
59
  BatchLogRecordProcessor,
60
60
  } from '@opentelemetry/sdk-logs';
61
- import { OTLPLogsExporter } from '@opentelemetry/exporter-logs-otlp-http';
61
+ import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
62
62
 
63
63
  // exporter options. see all options in OTLPExporterNodeConfigBase
64
64
  const collectorOptions = {
@@ -40,7 +40,6 @@ var __assign = (this && this.__assign) || function () {
40
40
  return __assign.apply(this, arguments);
41
41
  };
42
42
  import { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
43
- import { baggageUtils, getEnv } from '@opentelemetry/core';
44
43
  import { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';
45
44
  import { getDefaultUrl } from '../config';
46
45
  /**
@@ -50,11 +49,7 @@ var OTLPLogExporter = /** @class */ (function (_super) {
50
49
  __extends(OTLPLogExporter, _super);
51
50
  function OTLPLogExporter(config) {
52
51
  if (config === void 0) { config = {}; }
53
- var _this =
54
- // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var
55
- _super.call(this, __assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, 'application/json') || this;
56
- _this._headers = __assign(__assign({}, _this._headers), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
57
- return _this;
52
+ return _super.call(this, __assign({}, config), JsonLogsSerializer, 'application/json') || this;
58
53
  }
59
54
  OTLPLogExporter.prototype.getDefaultUrl = function (config) {
60
55
  return getDefaultUrl(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH;IACU,mCAAsE;IAG9E,yBAAY,MAAmC;QAAnC,uBAAA,EAAA,WAAmC;QAA/C;QACE,gDAAgD;QAChD,6BAEI,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB,SAOF;QANC,KAAI,CAAC,QAAQ,yBACR,KAAI,CAAC,QAAQ,GACb,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;;IACJ,CAAC;IAED,uCAAa,GAAb,UAAc,MAA8B;QAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AAzBD,CACU,uBAAuB,GAwBhC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this._headers = {\n ...this._headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH;IACU,mCAAsE;IAG9E,yBAAY,MAAmC;QAAnC,uBAAA,EAAA,WAAmC;eAC7C,+BAEO,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB;IACH,CAAC;IAED,uCAAa,GAAb,UAAc,MAA8B;QAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AAjBD,CACU,uBAAuB,GAgBhC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n super(\n {\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -23,12 +23,16 @@ export var DEFAULT_COLLECTOR_URL = "http://localhost:4318/" + DEFAULT_COLLECTOR_
23
23
  * @returns url string
24
24
  */
25
25
  export function getDefaultUrl(config) {
26
- return typeof config.url === 'string'
27
- ? config.url
28
- : getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0
29
- ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)
30
- : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
31
- ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
32
- : DEFAULT_COLLECTOR_URL;
26
+ if (typeof config.url === 'string') {
27
+ return config.url;
28
+ }
29
+ var env = getEnv();
30
+ if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {
31
+ return appendRootPathToUrlIfNeeded(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);
32
+ }
33
+ if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {
34
+ return appendResourcePathToUrl(env.OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH);
35
+ }
36
+ return DEFAULT_COLLECTOR_URL;
33
37
  }
34
38
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAE3C,IAAM,+BAA+B,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAA8B;IAC1D,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;QACnC,CAAC,CAAC,MAAM,CAAC,GAAG;QACZ,CAAC,CAAC,MAAM,EAAE,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC;YACtD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,gCAAgC,CAAC;YACxE,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;gBACH,CAAC,CAAC,qBAAqB,CAAC;AAC5B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_LOGS_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"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAE3C,IAAM,+BAA+B,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAA8B;IAC1D,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,EAAE;QAClC,OAAO,MAAM,CAAC,GAAG,CAAC;KACnB;IAED,IAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,IAAI,GAAG,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,OAAO,2BAA2B,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;KAC1E;IAED,IAAI,GAAG,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,OAAO,uBAAuB,CAC5B,GAAG,CAAC,2BAA2B,EAC/B,+BAA+B,CAChC,CAAC;KACH;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n if (typeof config.url === 'string') {\n return config.url;\n }\n\n const env = getEnv();\n if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {\n return appendRootPathToUrlIfNeeded(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);\n }\n\n if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {\n return appendResourcePathToUrl(\n env.OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n\n return DEFAULT_COLLECTOR_URL;\n}\n"]}
@@ -54,11 +54,8 @@ var OTLPLogExporter = /** @class */ (function (_super) {
54
54
  __extends(OTLPLogExporter, _super);
55
55
  function OTLPLogExporter(config) {
56
56
  if (config === void 0) { config = {}; }
57
- var _this =
58
57
  // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env
59
- _super.call(this, __assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, 'application/json') || this;
60
- _this.headers = __assign(__assign(__assign(__assign({}, _this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers));
61
- return _this;
58
+ return _super.call(this, __assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, __assign(__assign(__assign(__assign({}, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers)), USER_AGENT), { 'Content-Type': 'application/json' })) || this;
62
59
  }
63
60
  OTLPLogExporter.prototype.getDefaultUrl = function (config) {
64
61
  return getDefaultUrl(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,YAAY,GACb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;;GAEG;AACH;IACU,mCAAmE;IAG3E,yBAAY,MAAuC;QAAvC,uBAAA,EAAA,WAAuC;QAAnD;QACE,4CAA4C;QAC5C,6BAEI,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB,SASF;QARC,KAAI,CAAC,OAAO,2CACP,KAAI,CAAC,OAAO,GACZ,UAAU,GACV,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;;IACJ,CAAC;IAED,uCAAa,GAAb,UAAc,MAAkC;QAC9C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AA3BD,CACU,oBAAoB,GA0B7B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this.headers = {\n ...this.headers,\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n };\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,YAAY,GACb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;;GAEG;AACH;IACU,mCAAmE;IAG3E,yBAAY,MAAuC;QAAvC,uBAAA,EAAA,WAAuC;QACjD,4CAA4C;eAC5C,6BAEI,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,0CAEb,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,GAC7B,UAAU,KACb,cAAc,EAAE,kBAAkB,IAErC;IACH,CAAC;IAED,uCAAa,GAAb,UAAc,MAAkC;QAC9C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AA1BD,CACU,oBAAoB,GAyB7B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n {\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n }\n );\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.52.0";
1
+ export declare const VERSION = "0.53.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export var VERSION = '0.52.0';
17
+ export var VERSION = '0.53.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +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.52.0';\n"]}
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.53.0';\n"]}
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
17
- import { baggageUtils, getEnv } from '@opentelemetry/core';
18
17
  import { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';
19
18
  import { getDefaultUrl } from '../config';
20
19
  /**
@@ -22,9 +21,7 @@ import { getDefaultUrl } from '../config';
22
21
  */
23
22
  export class OTLPLogExporter extends OTLPExporterBrowserBase {
24
23
  constructor(config = {}) {
25
- // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var
26
- super(Object.assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, 'application/json');
27
- this._headers = Object.assign(Object.assign({}, this._headers), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
24
+ super(Object.assign({}, config), JsonLogsSerializer, 'application/json');
28
25
  }
29
26
  getDefaultUrl(config) {
30
27
  return getDefaultUrl(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,uBAAsE;IAG9E,YAAY,SAAiC,EAAE;QAC7C,gDAAgD;QAChD,KAAK,iBAED,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB,CAAC;QACF,IAAI,CAAC,QAAQ,mCACR,IAAI,CAAC,QAAQ,GACb,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,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 type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this._headers = {\n ...this._headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,uBAAsE;IAG9E,YAAY,SAAiC,EAAE;QAC7C,KAAK,mBAEE,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,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 type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n super(\n {\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -23,12 +23,16 @@ export const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_
23
23
  * @returns url string
24
24
  */
25
25
  export function getDefaultUrl(config) {
26
- return typeof config.url === 'string'
27
- ? config.url
28
- : getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0
29
- ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)
30
- : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
31
- ? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
32
- : DEFAULT_COLLECTOR_URL;
26
+ if (typeof config.url === 'string') {
27
+ return config.url;
28
+ }
29
+ const env = getEnv();
30
+ if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {
31
+ return appendRootPathToUrlIfNeeded(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);
32
+ }
33
+ if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {
34
+ return appendResourcePathToUrl(env.OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH);
35
+ }
36
+ return DEFAULT_COLLECTOR_URL;
33
37
  }
34
38
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,+BAA+B,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAA8B;IAC1D,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;QACnC,CAAC,CAAC,MAAM,CAAC,GAAG;QACZ,CAAC,CAAC,MAAM,EAAE,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC;YACtD,CAAC,CAAC,2BAA2B,CAAC,MAAM,EAAE,CAAC,gCAAgC,CAAC;YACxE,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;gBACH,CAAC,CAAC,qBAAqB,CAAC;AAC5B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_LOGS_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"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,+BAA+B,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAA8B;IAC1D,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,EAAE;QAClC,OAAO,MAAM,CAAC,GAAG,CAAC;KACnB;IAED,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,IAAI,GAAG,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,OAAO,2BAA2B,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;KAC1E;IAED,IAAI,GAAG,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,OAAO,uBAAuB,CAC5B,GAAG,CAAC,2BAA2B,EAC/B,+BAA+B,CAChC,CAAC;KACH;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n if (typeof config.url === 'string') {\n return config.url;\n }\n\n const env = getEnv();\n if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {\n return appendRootPathToUrlIfNeeded(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);\n }\n\n if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {\n return appendResourcePathToUrl(\n env.OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n\n return DEFAULT_COLLECTOR_URL;\n}\n"]}
@@ -27,8 +27,7 @@ const USER_AGENT = {
27
27
  export class OTLPLogExporter extends OTLPExporterNodeBase {
28
28
  constructor(config = {}) {
29
29
  // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env
30
- super(Object.assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, 'application/json');
31
- this.headers = Object.assign(Object.assign(Object.assign(Object.assign({}, this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers));
30
+ super(Object.assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), JsonLogsSerializer, Object.assign(Object.assign(Object.assign(Object.assign({}, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers)), USER_AGENT), { 'Content-Type': 'application/json' }));
32
31
  }
33
32
  getDefaultUrl(config) {
34
33
  return getDefaultUrl(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,YAAY,GACb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,OAAO,EAAE;CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,oBAAmE;IAG3E,YAAY,SAAqC,EAAE;QACjD,4CAA4C;QAC5C,KAAK,iBAED,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,EAClB,kBAAkB,CACnB,CAAC;QACF,IAAI,CAAC,OAAO,+DACP,IAAI,CAAC,OAAO,GACZ,UAAU,GACV,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,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 type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this.headers = {\n ...this.headers,\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n };\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,YAAY,GACb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,OAAO,EAAE;CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,oBAAmE;IAG3E,YAAY,SAAqC,EAAE;QACjD,4CAA4C;QAC5C,KAAK,iBAED,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,kBAAkB,8DAEb,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,GAC7B,UAAU,KACb,cAAc,EAAE,kBAAkB,IAErC,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,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 type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n {\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n }\n );\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.52.0";
1
+ export declare const VERSION = "0.53.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export const VERSION = '0.52.0';
17
+ export const VERSION = '0.53.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +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.52.0';\n"]}
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.53.0';\n"]}
@@ -17,7 +17,6 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.OTLPLogExporter = void 0;
19
19
  const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
20
- const core_1 = require("@opentelemetry/core");
21
20
  const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
22
21
  const config_1 = require("../config");
23
22
  /**
@@ -25,9 +24,7 @@ const config_1 = require("../config");
25
24
  */
26
25
  class OTLPLogExporter extends otlp_exporter_base_1.OTLPExporterBrowserBase {
27
26
  constructor(config = {}) {
28
- // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var
29
- super(Object.assign({ timeoutMillis: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), otlp_transformer_1.JsonLogsSerializer, 'application/json');
30
- this._headers = Object.assign(Object.assign({}, this._headers), core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
27
+ super(Object.assign({}, config), otlp_transformer_1.JsonLogsSerializer, 'application/json');
31
28
  }
32
29
  getDefaultUrl(config) {
33
30
  return (0, config_1.getDefaultUrl)(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,0EAA4E;AAC5E,8CAA2D;AAC3D,sEAAqE;AAErE,sCAA0C;AAE1C;;GAEG;AACH,MAAa,eACX,SAAQ,4CAAsE;IAG9E,YAAY,SAAiC,EAAE;QAC7C,gDAAgD;QAChD,KAAK,iBAED,aAAa,EAAE,IAAA,aAAM,GAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,qCAAkB,EAClB,kBAAkB,CACnB,CAAC;QACF,IAAI,CAAC,QAAQ,mCACR,IAAI,CAAC,QAAQ,GACb,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF;AAzBD,0CAyBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this._headers = {\n ...this._headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,0EAA4E;AAC5E,sEAAqE;AAErE,sCAA0C;AAE1C;;GAEG;AACH,MAAa,eACX,SAAQ,4CAAsE;IAG9E,YAAY,SAAiC,EAAE;QAC7C,KAAK,mBAEE,MAAM,GAEX,qCAAkB,EAClB,kBAAkB,CACnB,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF;AAjBD,0CAiBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Web\n */\nexport class OTLPLogExporter\n extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n super(\n {\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -26,13 +26,17 @@ exports.DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOU
26
26
  * @returns url string
27
27
  */
28
28
  function getDefaultUrl(config) {
29
- return typeof config.url === 'string'
30
- ? config.url
31
- : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0
32
- ? (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)
33
- : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
34
- ? (0, otlp_exporter_base_1.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
35
- : exports.DEFAULT_COLLECTOR_URL;
29
+ if (typeof config.url === 'string') {
30
+ return config.url;
31
+ }
32
+ const env = (0, core_1.getEnv)();
33
+ if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {
34
+ return (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);
35
+ }
36
+ if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {
37
+ return (0, otlp_exporter_base_1.appendResourcePathToUrl)(env.OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH);
38
+ }
39
+ return exports.DEFAULT_COLLECTOR_URL;
36
40
  }
37
41
  exports.getDefaultUrl = getDefaultUrl;
38
42
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAA6C;AAC7C,0EAI2C;AAE3C,MAAM,+BAA+B,GAAG,SAAS,CAAC;AACrC,QAAA,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEhG;;;;GAIG;AACH,SAAgB,aAAa,CAAC,MAA8B;IAC1D,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;QACnC,CAAC,CAAC,MAAM,CAAC,GAAG;QACZ,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC;YACtD,CAAC,CAAC,IAAA,gDAA2B,EAAC,IAAA,aAAM,GAAE,CAAC,gCAAgC,CAAC;YACxE,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACjD,CAAC,CAAC,IAAA,4CAAuB,EACrB,IAAA,aAAM,GAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;gBACH,CAAC,CAAC,6BAAqB,CAAC;AAC5B,CAAC;AAXD,sCAWC","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 { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_LOGS_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"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/platform/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAA6C;AAC7C,0EAI2C;AAE3C,MAAM,+BAA+B,GAAG,SAAS,CAAC;AACrC,QAAA,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AAEhG;;;;GAIG;AACH,SAAgB,aAAa,CAAC,MAA8B;IAC1D,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,EAAE;QAClC,OAAO,MAAM,CAAC,GAAG,CAAC;KACnB;IAED,MAAM,GAAG,GAAG,IAAA,aAAM,GAAE,CAAC;IACrB,IAAI,GAAG,CAAC,gCAAgC,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,OAAO,IAAA,gDAA2B,EAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;KAC1E;IAED,IAAI,GAAG,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,OAAO,IAAA,4CAAuB,EAC5B,GAAG,CAAC,2BAA2B,EAC/B,+BAA+B,CAChC,CAAC;KACH;IAED,OAAO,6BAAqB,CAAC;AAC/B,CAAC;AAlBD,sCAkBC","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 { getEnv } from '@opentelemetry/core';\nimport {\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';\nexport const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * common get default url\n * @param config exporter config\n * @returns url string\n */\nexport function getDefaultUrl(config: OTLPExporterConfigBase): string {\n if (typeof config.url === 'string') {\n return config.url;\n }\n\n const env = getEnv();\n if (env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.length > 0) {\n return appendRootPathToUrlIfNeeded(env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT);\n }\n\n if (env.OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {\n return appendResourcePathToUrl(\n env.OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n\n return DEFAULT_COLLECTOR_URL;\n}\n"]}
@@ -30,8 +30,7 @@ const USER_AGENT = {
30
30
  class OTLPLogExporter extends otlp_exporter_base_1.OTLPExporterNodeBase {
31
31
  constructor(config = {}) {
32
32
  // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env
33
- super(Object.assign({ timeoutMillis: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), otlp_transformer_1.JsonLogsSerializer, 'application/json');
34
- this.headers = Object.assign(Object.assign(Object.assign(Object.assign({}, this.headers), USER_AGENT), core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), (0, otlp_exporter_base_1.parseHeaders)(config === null || config === void 0 ? void 0 : config.headers));
33
+ super(Object.assign({ timeoutMillis: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config), otlp_transformer_1.JsonLogsSerializer, Object.assign(Object.assign(Object.assign(Object.assign({}, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_HEADERS)), (0, otlp_exporter_base_1.parseHeaders)(config === null || config === void 0 ? void 0 : config.headers)), USER_AGENT), { 'Content-Type': 'application/json' }));
35
34
  }
36
35
  getDefaultUrl(config) {
37
36
  return (0, config_1.getDefaultUrl)(config);
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,8CAA2D;AAC3D,0EAG2C;AAC3C,sEAAqE;AAErE,sCAA0C;AAC1C,2CAAwC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,iBAAO,EAAE;CACzD,CAAC;AAEF;;GAEG;AACH,MAAa,eACX,SAAQ,yCAAmE;IAG3E,YAAY,SAAqC,EAAE;QACjD,4CAA4C;QAC5C,KAAK,iBAED,aAAa,EAAE,IAAA,aAAM,GAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,qCAAkB,EAClB,kBAAkB,CACnB,CAAC;QACF,IAAI,CAAC,OAAO,+DACP,IAAI,CAAC,OAAO,GACZ,UAAU,GACV,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,+BAA+B,CACzC,GACE,IAAA,iCAAY,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF;AA3BD,0CA2BC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n 'application/json'\n );\n this.headers = {\n ...this.headers,\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n };\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPLogExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,8CAA2D;AAC3D,0EAG2C;AAC3C,sEAAqE;AAErE,sCAA0C;AAC1C,2CAAwC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,iBAAO,EAAE;CACzD,CAAC;AAEF;;GAEG;AACH,MAAa,eACX,SAAQ,yCAAmE;IAG3E,YAAY,SAAqC,EAAE;QACjD,4CAA4C;QAC5C,KAAK,iBAED,aAAa,EAAE,IAAA,aAAM,GAAE,CAAC,+BAA+B,IACpD,MAAM,GAEX,qCAAkB,8DAEb,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,+BAA+B,CACzC,GACE,IAAA,iCAAY,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,GAC7B,UAAU,KACb,cAAc,EAAE,kBAAkB,IAErC,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF;AA1BD,0CA0BC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ReadableLogRecord,\n LogRecordExporter,\n} from '@opentelemetry/sdk-logs';\nimport type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport type { IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport {\n OTLPExporterNodeBase,\n parseHeaders,\n} from '@opentelemetry/otlp-exporter-base';\nimport { JsonLogsSerializer } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super(\n {\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n },\n JsonLogsSerializer,\n {\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n }\n );\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.52.0";
1
+ export declare const VERSION = "0.53.0";
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.52.0';
20
+ exports.VERSION = '0.53.0';
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.52.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.53.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-logs-otlp-http",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,7 +37,7 @@
37
37
  "lint:fix": "eslint . --ext .ts --fix",
38
38
  "tdd": "npm run test -- --watch-extensions ts --watch",
39
39
  "tdd:browser": "karma start",
40
- "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
40
+ "test": "nyc mocha 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
41
41
  "test:browser": "karma start --single-run",
42
42
  "version": "node ../../../scripts/version-update.js",
43
43
  "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
@@ -72,30 +72,29 @@
72
72
  ],
73
73
  "sideEffects": false,
74
74
  "devDependencies": {
75
- "@babel/core": "7.24.6",
76
- "@babel/preset-env": "7.24.6",
75
+ "@babel/core": "7.25.2",
76
+ "@babel/preset-env": "7.25.3",
77
77
  "@opentelemetry/api": "1.9.0",
78
- "@opentelemetry/resources": "1.25.0",
79
- "@types/mocha": "10.0.6",
78
+ "@opentelemetry/resources": "1.26.0",
79
+ "@types/mocha": "10.0.7",
80
80
  "@types/node": "18.6.5",
81
81
  "@types/sinon": "17.0.3",
82
82
  "@types/webpack-env": "1.16.3",
83
83
  "babel-loader": "8.3.0",
84
- "babel-plugin-istanbul": "6.1.1",
84
+ "babel-plugin-istanbul": "7.0.0",
85
85
  "codecov": "3.8.3",
86
86
  "cross-var": "1.1.0",
87
- "karma": "6.4.3",
87
+ "karma": "6.4.4",
88
88
  "karma-chrome-launcher": "3.1.0",
89
89
  "karma-coverage": "2.2.1",
90
90
  "karma-mocha": "2.0.1",
91
91
  "karma-spec-reporter": "0.0.36",
92
92
  "karma-webpack": "5.0.1",
93
93
  "lerna": "6.6.2",
94
- "mocha": "10.2.0",
94
+ "mocha": "10.7.3",
95
95
  "nyc": "15.1.0",
96
96
  "sinon": "15.1.2",
97
97
  "ts-loader": "9.5.1",
98
- "ts-mocha": "10.0.0",
99
98
  "typescript": "4.4.4",
100
99
  "webpack": "5.89.0",
101
100
  "webpack-cli": "5.1.4",
@@ -105,11 +104,11 @@
105
104
  "@opentelemetry/api": "^1.0.0"
106
105
  },
107
106
  "dependencies": {
108
- "@opentelemetry/api-logs": "0.52.0",
109
- "@opentelemetry/core": "1.25.0",
110
- "@opentelemetry/otlp-exporter-base": "0.52.0",
111
- "@opentelemetry/otlp-transformer": "0.52.0",
112
- "@opentelemetry/sdk-logs": "0.52.0"
107
+ "@opentelemetry/api-logs": "0.53.0",
108
+ "@opentelemetry/core": "1.26.0",
109
+ "@opentelemetry/otlp-exporter-base": "0.53.0",
110
+ "@opentelemetry/otlp-transformer": "0.53.0",
111
+ "@opentelemetry/sdk-logs": "0.53.0"
113
112
  },
114
- "gitHead": "c4d3351b6b3f5593c8d7cbfec97b45cea9fe1511"
113
+ "gitHead": "720bc8c70d47029cb6b41a34ffdc3d25cbaa2f80"
115
114
  }