@opentelemetry/exporter-logs-otlp-http 0.40.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/LICENSE +201 -0
- package/README.md +114 -0
- package/build/esm/index.d.ts +2 -0
- package/build/esm/index.js +17 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/platform/browser/OTLPLogExporter.d.ts +13 -0
- package/build/esm/platform/browser/OTLPLogExporter.js +68 -0
- package/build/esm/platform/browser/OTLPLogExporter.js.map +1 -0
- package/build/esm/platform/browser/index.d.ts +2 -0
- package/build/esm/platform/browser/index.js +17 -0
- package/build/esm/platform/browser/index.js.map +1 -0
- package/build/esm/platform/config.d.ts +9 -0
- package/build/esm/platform/config.js +34 -0
- package/build/esm/platform/config.js.map +1 -0
- package/build/esm/platform/index.d.ts +2 -0
- package/build/esm/platform/index.js +17 -0
- package/build/esm/platform/index.js.map +1 -0
- package/build/esm/platform/node/OTLPLogExporter.d.ts +13 -0
- package/build/esm/platform/node/OTLPLogExporter.js +68 -0
- package/build/esm/platform/node/OTLPLogExporter.js.map +1 -0
- package/build/esm/platform/node/index.d.ts +2 -0
- package/build/esm/platform/node/index.js +17 -0
- package/build/esm/platform/node/index.js.map +1 -0
- package/build/esm/version.d.ts +2 -0
- package/build/esm/version.js +18 -0
- package/build/esm/version.js.map +1 -0
- package/build/esnext/index.d.ts +2 -0
- package/build/esnext/index.js +17 -0
- package/build/esnext/index.js.map +1 -0
- package/build/esnext/platform/browser/OTLPLogExporter.d.ts +13 -0
- package/build/esnext/platform/browser/OTLPLogExporter.js +36 -0
- package/build/esnext/platform/browser/OTLPLogExporter.js.map +1 -0
- package/build/esnext/platform/browser/index.d.ts +2 -0
- package/build/esnext/platform/browser/index.js +17 -0
- package/build/esnext/platform/browser/index.js.map +1 -0
- package/build/esnext/platform/config.d.ts +9 -0
- package/build/esnext/platform/config.js +34 -0
- package/build/esnext/platform/config.js.map +1 -0
- package/build/esnext/platform/index.d.ts +2 -0
- package/build/esnext/platform/index.js +17 -0
- package/build/esnext/platform/index.js.map +1 -0
- package/build/esnext/platform/node/OTLPLogExporter.d.ts +13 -0
- package/build/esnext/platform/node/OTLPLogExporter.js +36 -0
- package/build/esnext/platform/node/OTLPLogExporter.js.map +1 -0
- package/build/esnext/platform/node/index.d.ts +2 -0
- package/build/esnext/platform/node/index.js +17 -0
- package/build/esnext/platform/node/index.js.map +1 -0
- package/build/esnext/version.d.ts +2 -0
- package/build/esnext/version.js +18 -0
- package/build/esnext/version.js.map +1 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +21 -0
- package/build/src/index.js.map +1 -0
- package/build/src/platform/browser/OTLPLogExporter.d.ts +13 -0
- package/build/src/platform/browser/OTLPLogExporter.js +40 -0
- package/build/src/platform/browser/OTLPLogExporter.js.map +1 -0
- package/build/src/platform/browser/index.d.ts +2 -0
- package/build/src/platform/browser/index.js +21 -0
- package/build/src/platform/browser/index.js.map +1 -0
- package/build/src/platform/config.d.ts +9 -0
- package/build/src/platform/config.js +38 -0
- package/build/src/platform/config.js.map +1 -0
- package/build/src/platform/index.d.ts +2 -0
- package/build/src/platform/index.js +21 -0
- package/build/src/platform/index.js.map +1 -0
- package/build/src/platform/node/OTLPLogExporter.d.ts +13 -0
- package/build/src/platform/node/OTLPLogExporter.js +40 -0
- package/build/src/platform/node/OTLPLogExporter.js.map +1 -0
- package/build/src/platform/node/index.d.ts +2 -0
- package/build/src/platform/node/index.js +21 -0
- package/build/src/platform/node/index.js.map +1 -0
- package/build/src/version.d.ts +2 -0
- package/build/src/version.js +21 -0
- package/build/src/version.js.map +1 -0
- package/package.json +110 -0
|
@@ -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 { OTLPLogExporter } from './OTLPLogExporter';
|
|
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,eAAe,EAAE,MAAM,mBAAmB,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 { OTLPLogExporter } from './OTLPLogExporter';\n"]}
|
|
@@ -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.40.0';
|
|
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.40.0';\n"]}
|
|
@@ -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 { OTLPLogExporter } 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;AAEH,OAAO,EAAE,eAAe,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 */\n\nexport { OTLPLogExporter } from './platform';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
2
|
+
import type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
3
|
+
import type { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
4
|
+
import { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
|
+
/**
|
|
6
|
+
* Collector Logs Exporter for Web
|
|
7
|
+
*/
|
|
8
|
+
export declare class OTLPLogExporter extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceRequest> implements LogRecordExporter {
|
|
9
|
+
constructor(config?: OTLPExporterConfigBase);
|
|
10
|
+
convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest;
|
|
11
|
+
getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=OTLPLogExporter.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
|
|
17
|
+
import { baggageUtils, getEnv } from '@opentelemetry/core';
|
|
18
|
+
import { createExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
19
|
+
import { getDefaultUrl } from '../config';
|
|
20
|
+
/**
|
|
21
|
+
* Collector Logs Exporter for Web
|
|
22
|
+
*/
|
|
23
|
+
export class OTLPLogExporter extends OTLPExporterBrowserBase {
|
|
24
|
+
constructor(config = {}) {
|
|
25
|
+
// load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var
|
|
26
|
+
super(Object.assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config));
|
|
27
|
+
this._headers = Object.assign(Object.assign({}, this._headers), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
|
|
28
|
+
}
|
|
29
|
+
convert(logRecords) {
|
|
30
|
+
return createExportLogsServiceRequest(logRecords);
|
|
31
|
+
}
|
|
32
|
+
getDefaultUrl(config) {
|
|
33
|
+
return getDefaultUrl(config);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=OTLPLogExporter.js.map
|
|
@@ -0,0 +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,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,uBAAqE;IAG7E,YAAY,SAAiC,EAAE;QAC7C,gDAAgD;QAChD,KAAK,iBACH,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,EACT,CAAC;QACH,IAAI,CAAC,QAAQ,mCACR,IAAI,CAAC,QAAQ,GACb,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,UAA+B;QACrC,OAAO,8BAA8B,CAAC,UAAU,CAAC,CAAC;IACpD,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 { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { createExportLogsServiceRequest } 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, IExportLogsServiceRequest>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var\n super({\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n });\n this._headers = {\n ...this._headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest {\n return createExportLogsServiceRequest(logRecords);\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
|
|
@@ -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 { OTLPLogExporter } from './OTLPLogExporter';
|
|
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;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,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 { OTLPLogExporter } from './OTLPLogExporter';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
2
|
+
export declare const DEFAULT_COLLECTOR_URL: string;
|
|
3
|
+
/**
|
|
4
|
+
* common get default url
|
|
5
|
+
* @param config exporter config
|
|
6
|
+
* @returns url string
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
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 } from '@opentelemetry/core';
|
|
17
|
+
import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
|
|
18
|
+
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';
|
|
19
|
+
export const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
20
|
+
/**
|
|
21
|
+
* common get default url
|
|
22
|
+
* @param config exporter config
|
|
23
|
+
* @returns url string
|
|
24
|
+
*/
|
|
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;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -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 { OTLPLogExporter } 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;AAEH,OAAO,EAAE,eAAe,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 */\n\nexport { OTLPLogExporter } from './node';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
2
|
+
import type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
3
|
+
import type { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
4
|
+
import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
|
+
/**
|
|
6
|
+
* Collector Logs Exporter for Node
|
|
7
|
+
*/
|
|
8
|
+
export declare class OTLPLogExporter extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceRequest> implements LogRecordExporter {
|
|
9
|
+
constructor(config?: OTLPExporterNodeConfigBase);
|
|
10
|
+
convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest;
|
|
11
|
+
getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=OTLPLogExporter.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
17
|
+
import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
|
|
18
|
+
import { createExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
19
|
+
import { getDefaultUrl } from '../config';
|
|
20
|
+
/**
|
|
21
|
+
* Collector Logs Exporter for Node
|
|
22
|
+
*/
|
|
23
|
+
export class OTLPLogExporter extends OTLPExporterNodeBase {
|
|
24
|
+
constructor(config = {}) {
|
|
25
|
+
// load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env
|
|
26
|
+
super(Object.assign({ timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT }, config));
|
|
27
|
+
this.headers = Object.assign(Object.assign({}, this.headers), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
|
|
28
|
+
}
|
|
29
|
+
convert(logRecords) {
|
|
30
|
+
return createExportLogsServiceRequest(logRecords);
|
|
31
|
+
}
|
|
32
|
+
getDefaultUrl(config) {
|
|
33
|
+
return getDefaultUrl(config);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=OTLPLogExporter.js.map
|
|
@@ -0,0 +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,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,eACX,SAAQ,oBAAkE;IAG1E,YAAY,SAAqC,EAAE;QACjD,4CAA4C;QAC5C,KAAK,iBACH,aAAa,EAAE,MAAM,EAAE,CAAC,+BAA+B,IACpD,MAAM,EACT,CAAC;QACH,IAAI,CAAC,OAAO,mCACP,IAAI,CAAC,OAAO,GACZ,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,UAA+B;QACrC,OAAO,8BAA8B,CAAC,UAAU,CAAC,CAAC;IACpD,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 { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';\nimport { createExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';\n\nimport { getDefaultUrl } from '../config';\n\n/**\n * Collector Logs Exporter for Node\n */\nexport class OTLPLogExporter\n extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceRequest>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterNodeConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env\n super({\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n });\n this.headers = {\n ...this.headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest {\n return createExportLogsServiceRequest(logRecords);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
|
|
@@ -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 { OTLPLogExporter } from './OTLPLogExporter';
|
|
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,eAAe,EAAE,MAAM,mBAAmB,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 { OTLPLogExporter } from './OTLPLogExporter';\n"]}
|
|
@@ -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.40.0';
|
|
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.40.0';\n"]}
|
|
@@ -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.OTLPLogExporter = void 0;
|
|
19
|
+
var platform_1 = require("./platform");
|
|
20
|
+
Object.defineProperty(exports, "OTLPLogExporter", { enumerable: true, get: function () { return platform_1.OTLPLogExporter; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,uCAA6C;AAApC,2GAAA,eAAe,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 { OTLPLogExporter } from './platform';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
2
|
+
import type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
3
|
+
import type { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
4
|
+
import { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
|
+
/**
|
|
6
|
+
* Collector Logs Exporter for Web
|
|
7
|
+
*/
|
|
8
|
+
export declare class OTLPLogExporter extends OTLPExporterBrowserBase<ReadableLogRecord, IExportLogsServiceRequest> implements LogRecordExporter {
|
|
9
|
+
constructor(config?: OTLPExporterConfigBase);
|
|
10
|
+
convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest;
|
|
11
|
+
getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=OTLPLogExporter.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
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.OTLPLogExporter = void 0;
|
|
19
|
+
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
20
|
+
const core_1 = require("@opentelemetry/core");
|
|
21
|
+
const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
|
|
22
|
+
const config_1 = require("../config");
|
|
23
|
+
/**
|
|
24
|
+
* Collector Logs Exporter for Web
|
|
25
|
+
*/
|
|
26
|
+
class OTLPLogExporter extends otlp_exporter_base_1.OTLPExporterBrowserBase {
|
|
27
|
+
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));
|
|
30
|
+
this._headers = Object.assign(Object.assign({}, this._headers), core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_LOGS_HEADERS));
|
|
31
|
+
}
|
|
32
|
+
convert(logRecords) {
|
|
33
|
+
return (0, otlp_transformer_1.createExportLogsServiceRequest)(logRecords);
|
|
34
|
+
}
|
|
35
|
+
getDefaultUrl(config) {
|
|
36
|
+
return (0, config_1.getDefaultUrl)(config);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.OTLPLogExporter = OTLPLogExporter;
|
|
40
|
+
//# sourceMappingURL=OTLPLogExporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OTLPLogExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPLogExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,0EAA4E;AAC5E,8CAA2D;AAC3D,sEAAiF;AAEjF,sCAA0C;AAE1C;;GAEG;AACH,MAAa,eACX,SAAQ,4CAAqE;IAG7E,YAAY,SAAiC,EAAE;QAC7C,gDAAgD;QAChD,KAAK,iBACH,aAAa,EAAE,IAAA,aAAM,GAAE,CAAC,+BAA+B,IACpD,MAAM,EACT,CAAC;QACH,IAAI,CAAC,QAAQ,mCACR,IAAI,CAAC,QAAQ,GACb,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,+BAA+B,CACzC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,UAA+B;QACrC,OAAO,IAAA,iDAA8B,EAAC,UAAU,CAAC,CAAC;IACpD,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 { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { createExportLogsServiceRequest } 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, IExportLogsServiceRequest>\n implements LogRecordExporter\n{\n constructor(config: OTLPExporterConfigBase = {}) {\n // load OTEL_EXPORTER_OTLP_LOGS_TIMEOUT env var\n super({\n timeoutMillis: getEnv().OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,\n ...config,\n });\n this._headers = {\n ...this._headers,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_LOGS_HEADERS\n ),\n };\n }\n\n convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest {\n return createExportLogsServiceRequest(logRecords);\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return getDefaultUrl(config);\n }\n}\n"]}
|
|
@@ -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.OTLPLogExporter = void 0;
|
|
19
|
+
var OTLPLogExporter_1 = require("./OTLPLogExporter");
|
|
20
|
+
Object.defineProperty(exports, "OTLPLogExporter", { enumerable: true, get: function () { return OTLPLogExporter_1.OTLPLogExporter; } });
|
|
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;;;AAEH,qDAAoD;AAA3C,kHAAA,eAAe,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 { OTLPLogExporter } from './OTLPLogExporter';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
2
|
+
export declare const DEFAULT_COLLECTOR_URL: string;
|
|
3
|
+
/**
|
|
4
|
+
* common get default url
|
|
5
|
+
* @param config exporter config
|
|
6
|
+
* @returns url string
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
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.getDefaultUrl = exports.DEFAULT_COLLECTOR_URL = void 0;
|
|
19
|
+
const core_1 = require("@opentelemetry/core");
|
|
20
|
+
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
21
|
+
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/logs';
|
|
22
|
+
exports.DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
23
|
+
/**
|
|
24
|
+
* common get default url
|
|
25
|
+
* @param config exporter config
|
|
26
|
+
* @returns url string
|
|
27
|
+
*/
|
|
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;
|
|
36
|
+
}
|
|
37
|
+
exports.getDefaultUrl = getDefaultUrl;
|
|
38
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -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.OTLPLogExporter = void 0;
|
|
19
|
+
var node_1 = require("./node");
|
|
20
|
+
Object.defineProperty(exports, "OTLPLogExporter", { enumerable: true, get: function () { return node_1.OTLPLogExporter; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+BAAyC;AAAhC,uGAAA,eAAe,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 { OTLPLogExporter } from './node';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadableLogRecord, LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
2
|
+
import type { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
3
|
+
import type { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
4
|
+
import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
|
+
/**
|
|
6
|
+
* Collector Logs Exporter for Node
|
|
7
|
+
*/
|
|
8
|
+
export declare class OTLPLogExporter extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceRequest> implements LogRecordExporter {
|
|
9
|
+
constructor(config?: OTLPExporterNodeConfigBase);
|
|
10
|
+
convert(logRecords: ReadableLogRecord[]): IExportLogsServiceRequest;
|
|
11
|
+
getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=OTLPLogExporter.d.ts.map
|