@opentelemetry/otlp-exporter-base 0.203.0 → 0.204.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/build/esm/configuration/convert-legacy-node-http-options.js +14 -18
- package/build/esm/configuration/convert-legacy-node-http-options.js.map +1 -1
- package/build/esm/configuration/create-legacy-browser-delegate.d.ts +2 -0
- package/build/esm/configuration/create-legacy-browser-delegate.js +11 -5
- package/build/esm/configuration/create-legacy-browser-delegate.js.map +1 -1
- package/build/esm/configuration/legacy-node-configuration.d.ts +25 -2
- package/build/esm/configuration/legacy-node-configuration.js.map +1 -1
- package/build/esm/configuration/otlp-http-configuration.d.ts +13 -1
- package/build/esm/configuration/otlp-http-configuration.js +14 -6
- package/build/esm/configuration/otlp-http-configuration.js.map +1 -1
- package/build/esm/configuration/otlp-http-env-configuration.js +7 -7
- package/build/esm/configuration/otlp-http-env-configuration.js.map +1 -1
- package/build/esm/index-node-http.d.ts +1 -0
- package/build/esm/index-node-http.js +1 -0
- package/build/esm/index-node-http.js.map +1 -1
- package/build/esm/otlp-browser-http-export-delegate.d.ts +4 -0
- package/build/esm/otlp-browser-http-export-delegate.js +9 -0
- package/build/esm/otlp-browser-http-export-delegate.js.map +1 -1
- package/build/esm/transport/fetch-transport.d.ts +11 -0
- package/build/esm/transport/fetch-transport.js +82 -0
- package/build/esm/transport/fetch-transport.js.map +1 -0
- package/build/esm/transport/http-exporter-transport.js +15 -11
- package/build/esm/transport/http-exporter-transport.js.map +1 -1
- package/build/esm/transport/http-transport-types.d.ts +2 -7
- package/build/esm/transport/http-transport-types.js.map +1 -1
- package/build/esm/transport/http-transport-utils.d.ts +4 -4
- package/build/esm/transport/http-transport-utils.js +2 -24
- package/build/esm/transport/http-transport-utils.js.map +1 -1
- package/build/esm/transport/xhr-transport.d.ts +6 -0
- package/build/esm/transport/xhr-transport.js +2 -0
- package/build/esm/transport/xhr-transport.js.map +1 -1
- package/build/esm/version.d.ts +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/esnext/configuration/convert-legacy-node-http-options.js +14 -18
- package/build/esnext/configuration/convert-legacy-node-http-options.js.map +1 -1
- package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +2 -0
- package/build/esnext/configuration/create-legacy-browser-delegate.js +11 -5
- package/build/esnext/configuration/create-legacy-browser-delegate.js.map +1 -1
- package/build/esnext/configuration/legacy-node-configuration.d.ts +25 -2
- package/build/esnext/configuration/legacy-node-configuration.js.map +1 -1
- package/build/esnext/configuration/otlp-http-configuration.d.ts +13 -1
- package/build/esnext/configuration/otlp-http-configuration.js +14 -6
- package/build/esnext/configuration/otlp-http-configuration.js.map +1 -1
- package/build/esnext/configuration/otlp-http-env-configuration.js +7 -7
- package/build/esnext/configuration/otlp-http-env-configuration.js.map +1 -1
- package/build/esnext/index-node-http.d.ts +1 -0
- package/build/esnext/index-node-http.js +1 -0
- package/build/esnext/index-node-http.js.map +1 -1
- package/build/esnext/otlp-browser-http-export-delegate.d.ts +4 -0
- package/build/esnext/otlp-browser-http-export-delegate.js +9 -0
- package/build/esnext/otlp-browser-http-export-delegate.js.map +1 -1
- package/build/esnext/transport/fetch-transport.d.ts +11 -0
- package/build/esnext/transport/fetch-transport.js +82 -0
- package/build/esnext/transport/fetch-transport.js.map +1 -0
- package/build/esnext/transport/http-exporter-transport.js +15 -11
- package/build/esnext/transport/http-exporter-transport.js.map +1 -1
- package/build/esnext/transport/http-transport-types.d.ts +2 -7
- package/build/esnext/transport/http-transport-types.js.map +1 -1
- package/build/esnext/transport/http-transport-utils.d.ts +4 -4
- package/build/esnext/transport/http-transport-utils.js +2 -24
- package/build/esnext/transport/http-transport-utils.js.map +1 -1
- package/build/esnext/transport/xhr-transport.d.ts +6 -0
- package/build/esnext/transport/xhr-transport.js +2 -0
- package/build/esnext/transport/xhr-transport.js.map +1 -1
- package/build/esnext/version.d.ts +1 -1
- package/build/esnext/version.js +1 -1
- package/build/esnext/version.js.map +1 -1
- package/build/src/configuration/convert-legacy-node-http-options.js +13 -17
- package/build/src/configuration/convert-legacy-node-http-options.js.map +1 -1
- package/build/src/configuration/create-legacy-browser-delegate.d.ts +2 -0
- package/build/src/configuration/create-legacy-browser-delegate.js +13 -6
- package/build/src/configuration/create-legacy-browser-delegate.js.map +1 -1
- package/build/src/configuration/legacy-node-configuration.d.ts +25 -2
- package/build/src/configuration/legacy-node-configuration.js.map +1 -1
- package/build/src/configuration/otlp-http-configuration.d.ts +13 -1
- package/build/src/configuration/otlp-http-configuration.js +16 -7
- package/build/src/configuration/otlp-http-configuration.js.map +1 -1
- package/build/src/configuration/otlp-http-env-configuration.js +6 -6
- package/build/src/configuration/otlp-http-env-configuration.js.map +1 -1
- package/build/src/index-node-http.d.ts +1 -0
- package/build/src/index-node-http.js +3 -1
- package/build/src/index-node-http.js.map +1 -1
- package/build/src/otlp-browser-http-export-delegate.d.ts +4 -0
- package/build/src/otlp-browser-http-export-delegate.js +11 -1
- package/build/src/otlp-browser-http-export-delegate.js.map +1 -1
- package/build/src/transport/fetch-transport.d.ts +11 -0
- package/build/src/transport/fetch-transport.js +86 -0
- package/build/src/transport/fetch-transport.js.map +1 -0
- package/build/src/transport/http-exporter-transport.js +15 -11
- package/build/src/transport/http-exporter-transport.js.map +1 -1
- package/build/src/transport/http-transport-types.d.ts +2 -7
- package/build/src/transport/http-transport-types.js.map +1 -1
- package/build/src/transport/http-transport-utils.d.ts +4 -4
- package/build/src/transport/http-transport-utils.js +3 -26
- package/build/src/transport/http-transport-utils.js.map +1 -1
- package/build/src/transport/xhr-transport.d.ts +6 -0
- package/build/src/transport/xhr-transport.js +2 -0
- package/build/src/transport/xhr-transport.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +11 -12
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import * as http from 'http';
|
|
4
|
-
import * as https from 'https';
|
|
3
|
+
import type * as http from 'http';
|
|
4
|
+
import type * as https from 'https';
|
|
5
5
|
import { HttpRequestParameters } from './http-transport-types';
|
|
6
6
|
import { ExportResponse } from '../export-response';
|
|
7
7
|
/**
|
|
8
8
|
* Sends data using http
|
|
9
|
+
* @param requestFunction
|
|
9
10
|
* @param params
|
|
10
11
|
* @param agent
|
|
11
12
|
* @param data
|
|
12
13
|
* @param onDone
|
|
13
14
|
* @param timeoutMillis
|
|
14
15
|
*/
|
|
15
|
-
export declare function sendWithHttp(params: HttpRequestParameters, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number): void;
|
|
16
|
+
export declare function sendWithHttp(request: typeof https.request | typeof http.request, params: HttpRequestParameters, agent: http.Agent | https.Agent, data: Uint8Array, onDone: (response: ExportResponse) => void, timeoutMillis: number): void;
|
|
16
17
|
export declare function compressAndSend(req: http.ClientRequest, compression: 'gzip' | 'none', data: Uint8Array, onError: (error: Error) => void): void;
|
|
17
|
-
export declare function createHttpAgent(rawUrl: string, agentOptions: http.AgentOptions | https.AgentOptions): http.Agent;
|
|
18
18
|
//# sourceMappingURL=http-transport-utils.d.ts.map
|
|
@@ -1,36 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
/*
|
|
5
|
-
* Copyright The OpenTelemetry Authors
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
const http = require("http");
|
|
20
|
-
const https = require("https");
|
|
3
|
+
exports.compressAndSend = exports.sendWithHttp = void 0;
|
|
21
4
|
const zlib = require("zlib");
|
|
22
5
|
const stream_1 = require("stream");
|
|
23
6
|
const is_export_retryable_1 = require("../is-export-retryable");
|
|
24
7
|
const types_1 = require("../types");
|
|
25
8
|
/**
|
|
26
9
|
* Sends data using http
|
|
10
|
+
* @param requestFunction
|
|
27
11
|
* @param params
|
|
28
12
|
* @param agent
|
|
29
13
|
* @param data
|
|
30
14
|
* @param onDone
|
|
31
15
|
* @param timeoutMillis
|
|
32
16
|
*/
|
|
33
|
-
function sendWithHttp(params, agent, data, onDone, timeoutMillis) {
|
|
17
|
+
function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) {
|
|
34
18
|
const parsedUrl = new URL(params.url);
|
|
35
19
|
const options = {
|
|
36
20
|
hostname: parsedUrl.hostname,
|
|
@@ -42,7 +26,6 @@ function sendWithHttp(params, agent, data, onDone, timeoutMillis) {
|
|
|
42
26
|
},
|
|
43
27
|
agent: agent,
|
|
44
28
|
};
|
|
45
|
-
const request = parsedUrl.protocol === 'http:' ? http.request : https.request;
|
|
46
29
|
const req = request(options, (res) => {
|
|
47
30
|
const responseData = [];
|
|
48
31
|
res.on('data', chunk => responseData.push(chunk));
|
|
@@ -107,10 +90,4 @@ function readableFromUint8Array(buff) {
|
|
|
107
90
|
readable.push(null);
|
|
108
91
|
return readable;
|
|
109
92
|
}
|
|
110
|
-
function createHttpAgent(rawUrl, agentOptions) {
|
|
111
|
-
const parsedUrl = new URL(rawUrl);
|
|
112
|
-
const Agent = parsedUrl.protocol === 'http:' ? http.Agent : https.Agent;
|
|
113
|
-
return new Agent(agentOptions);
|
|
114
|
-
}
|
|
115
|
-
exports.createHttpAgent = createHttpAgent;
|
|
116
93
|
//# sourceMappingURL=http-transport-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-transport-utils.js","sourceRoot":"","sources":["../../../src/transport/http-transport-utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"http-transport-utils.js","sourceRoot":"","sources":["../../../src/transport/http-transport-utils.ts"],"names":[],"mappings":";;;AAiBA,6BAA6B;AAC7B,mCAAkC;AAGlC,gEAGgC;AAChC,oCAA6C;AAE7C;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,OAAmD,EACnD,MAA6B,EAC7B,KAA+B,EAC/B,IAAgB,EAChB,MAA0C,EAC1C,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,OAAO,GAA+C;QAC1D,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE,SAAS,CAAC,IAAI;QACpB,IAAI,EAAE,SAAS,CAAC,QAAQ;QACxB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,GAAG,MAAM,CAAC,OAAO,EAAE;SACpB;QACD,KAAK,EAAE,KAAK;KACb,CAAC;IAEF,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,GAAyB,EAAE,EAAE;QACzD,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAElD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACjB,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,GAAG,GAAG,EAAE;gBAC1C,MAAM,CAAC;oBACL,MAAM,EAAE,SAAS;oBACjB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;iBAClC,CAAC,CAAC;aACJ;iBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,I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,KAAK,MAAM,EAAE;QAC1B,GAAG,CAAC,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC1C,UAAU,GAAG,UAAU;aACpB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;aACvB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KACzB;IAED,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAjBD,0CAiBC;AAED,SAAS,sBAAsB,CAAC,IAAyB;IACvD,MAAM,QAAQ,GAAG,IAAI,iBAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO,QAAQ,CAAC;AAClB,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 */\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport * as zlib from 'zlib';\nimport { Readable } from 'stream';\nimport { HttpRequestParameters } from './http-transport-types';\nimport { ExportResponse } from '../export-response';\nimport {\n isExportRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\nimport { OTLPExporterError } from '../types';\n\n/**\n * Sends data using http\n * @param requestFunction\n * @param params\n * @param agent\n * @param data\n * @param onDone\n * @param timeoutMillis\n */\nexport function sendWithHttp(\n request: typeof https.request | typeof http.request,\n params: HttpRequestParameters,\n agent: http.Agent | https.Agent,\n data: Uint8Array,\n onDone: (response: ExportResponse) => void,\n timeoutMillis: number\n): void {\n const parsedUrl = new URL(params.url);\n\n const options: http.RequestOptions | https.RequestOptions = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers: {\n ...params.headers(),\n },\n agent: agent,\n };\n\n const req = request(options, (res: http.IncomingMessage) => {\n const responseData: Buffer[] = [];\n res.on('data', chunk => responseData.push(chunk));\n\n res.on('end', () => {\n if (res.statusCode && res.statusCode < 299) {\n onDone({\n status: 'success',\n data: Buffer.concat(responseData),\n });\n } else if (res.statusCode && isExportRetryable(res.statusCode)) {\n onDone({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),\n });\n } else {\n const error = new OTLPExporterError(\n res.statusMessage,\n res.statusCode,\n Buffer.concat(responseData).toString()\n );\n onDone({\n status: 'failure',\n error,\n });\n }\n });\n });\n\n req.setTimeout(timeoutMillis, () => {\n req.destroy();\n onDone({\n status: 'failure',\n error: new Error('Request Timeout'),\n });\n });\n\n req.on('error', (error: Error) => {\n onDone({\n status: 'failure',\n error,\n });\n });\n\n compressAndSend(req, params.compression, data, (error: Error) => {\n onDone({\n status: 'failure',\n error,\n });\n });\n}\n\nexport function compressAndSend(\n req: http.ClientRequest,\n compression: 'gzip' | 'none',\n data: Uint8Array,\n onError: (error: Error) => void\n) {\n let dataStream = readableFromUint8Array(data);\n\n if (compression === 'gzip') {\n req.setHeader('Content-Encoding', 'gzip');\n dataStream = dataStream\n .on('error', onError)\n .pipe(zlib.createGzip())\n .on('error', onError);\n }\n\n dataStream.pipe(req).on('error', onError);\n}\n\nfunction readableFromUint8Array(buff: string | Uint8Array): Readable {\n const readable = new Readable();\n readable.push(buff);\n readable.push(null);\n\n return readable;\n}\n"]}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { IExporterTransport } from '../exporter-transport';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated favor the fetch transport
|
|
4
|
+
* @see {@link createFetchTransport}
|
|
5
|
+
*/
|
|
2
6
|
export interface XhrRequestParameters {
|
|
3
7
|
url: string;
|
|
4
8
|
headers: () => Record<string, string>;
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
11
|
+
* @deprecated use {@link createFetchTransport} instead
|
|
12
|
+
*
|
|
7
13
|
* Creates an exporter transport that uses XHR to send the data
|
|
8
14
|
* @param parameters applied to each request made by transport
|
|
9
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhr-transport.js","sourceRoot":"","sources":["../../../src/transport/xhr-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAC1C,gEAGgC;
|
|
1
|
+
{"version":3,"file":"xhr-transport.js","sourceRoot":"","sources":["../../../src/transport/xhr-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,4CAA0C;AAC1C,gEAGgC;AAahC,MAAM,YAAY;IACI;IAApB,YAAoB,WAAiC;QAAjC,gBAAW,GAAX,WAAW,CAAsB;IAAG,CAAC;IAEzD,IAAI,CAAC,IAAgB,EAAE,aAAqB;QAC1C,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3C,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,GAAG,CAAC,OAAO,GAAG,aAAa,CAAC;YAC5B,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAC3C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;gBACzC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEH,GA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AI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,2CAA2C;IAC7C,CAAC;CACF;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,UAAgC;IAEhC,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAJD,gDAIC","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 { IExporterTransport } from '../exporter-transport';\nimport { ExportResponse } from '../export-response';\nimport { diag } from '@opentelemetry/api';\nimport {\n isExportRetryable,\n parseRetryAfterToMills,\n} from '../is-export-retryable';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { createFetchTransport } from './fetch-transport';\n\n/**\n * @deprecated favor the fetch transport\n * @see {@link createFetchTransport}\n */\nexport interface XhrRequestParameters {\n url: string;\n headers: () => Record<string, string>;\n}\n\nclass XhrTransport implements IExporterTransport {\n constructor(private _parameters: XhrRequestParameters) {}\n\n send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n return new Promise<ExportResponse>(resolve => {\n const xhr = new XMLHttpRequest();\n xhr.timeout = timeoutMillis;\n xhr.open('POST', this._parameters.url);\n const headers = this._parameters.headers();\n Object.entries(headers).forEach(([k, v]) => {\n xhr.setRequestHeader(k, v);\n });\n\n xhr.ontimeout = _ => {\n resolve({\n status: 'failure',\n error: new Error('XHR request timed out'),\n });\n };\n\n xhr.onreadystatechange = () => {\n if (xhr.status >= 200 && xhr.status <= 299) {\n diag.debug('XHR success');\n resolve({\n status: 'success',\n });\n } else if (xhr.status && isExportRetryable(xhr.status)) {\n resolve({\n status: 'retryable',\n retryInMillis: parseRetryAfterToMills(\n xhr.getResponseHeader('Retry-After')\n ),\n });\n } else if (xhr.status !== 0) {\n resolve({\n status: 'failure',\n error: new Error('XHR request failed with non-retryable status'),\n });\n }\n };\n\n xhr.onabort = () => {\n resolve({\n status: 'failure',\n error: new Error('XHR request aborted'),\n });\n };\n xhr.onerror = () => {\n resolve({\n status: 'failure',\n error: new Error('XHR request errored'),\n });\n };\n\n xhr.send(data);\n });\n }\n\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n\n/**\n * @deprecated use {@link createFetchTransport} instead\n *\n * Creates an exporter transport that uses XHR to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createXhrTransport(\n parameters: XhrRequestParameters\n): IExporterTransport {\n return new XhrTransport(parameters);\n}\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.204.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,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.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,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.204.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/otlp-exporter-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.204.0",
|
|
4
4
|
"description": "OpenTelemetry OTLP Exporter base (for internal use only)",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
"types": "build/src/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"module": "./build/esm/index.js",
|
|
12
11
|
"esnext": "./build/esnext/index.js",
|
|
12
|
+
"module": "./build/esm/index.js",
|
|
13
13
|
"types": "./build/src/index.d.ts",
|
|
14
14
|
"default": "./build/src/index.js"
|
|
15
15
|
},
|
|
16
16
|
"./node-http": {
|
|
17
|
-
"module": "./build/esm/index-node-http.js",
|
|
18
17
|
"esnext": "./build/esnext/index-node-http.js",
|
|
18
|
+
"module": "./build/esm/index-node-http.js",
|
|
19
19
|
"types": "./build/src/index-node-http.d.ts",
|
|
20
20
|
"default": "./build/src/index-node-http.js"
|
|
21
21
|
},
|
|
22
22
|
"./browser-http": {
|
|
23
|
-
"module": "./build/esm/index-browser-http.js",
|
|
24
23
|
"esnext": "./build/esnext/index-browser-http.js",
|
|
24
|
+
"module": "./build/esm/index-browser-http.js",
|
|
25
25
|
"types": "./build/src/index-browser-http.d.ts",
|
|
26
26
|
"default": "./build/src/index-browser-http.js"
|
|
27
27
|
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test:browser": "karma start --single-run",
|
|
40
40
|
"version": "node ../../../scripts/version-update.js",
|
|
41
41
|
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
42
|
-
"precompile": "
|
|
42
|
+
"precompile": "lerna run version --scope @opentelemetry/otlp-exporter-base --include-dependencies",
|
|
43
43
|
"prewatch": "npm run precompile",
|
|
44
44
|
"align-api-deps": "node ../../../scripts/align-api-deps.js"
|
|
45
45
|
},
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@opentelemetry/core": "2.0
|
|
78
|
-
"@opentelemetry/otlp-transformer": "0.
|
|
77
|
+
"@opentelemetry/core": "2.1.0",
|
|
78
|
+
"@opentelemetry/otlp-transformer": "0.204.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@babel/core": "7.27.1",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"@types/node": "18.6.5",
|
|
86
86
|
"@types/sinon": "17.0.4",
|
|
87
87
|
"babel-plugin-istanbul": "7.0.0",
|
|
88
|
-
"cross-var": "1.1.0",
|
|
89
88
|
"karma": "6.4.4",
|
|
90
89
|
"karma-chrome-launcher": "3.1.0",
|
|
91
90
|
"karma-coverage": "2.2.1",
|
|
@@ -93,12 +92,12 @@
|
|
|
93
92
|
"karma-spec-reporter": "0.0.36",
|
|
94
93
|
"karma-webpack": "5.0.1",
|
|
95
94
|
"lerna": "6.6.2",
|
|
96
|
-
"mocha": "11.
|
|
95
|
+
"mocha": "11.7.2",
|
|
97
96
|
"nyc": "17.1.0",
|
|
98
97
|
"sinon": "18.0.1",
|
|
99
|
-
"ts-loader": "9.5.
|
|
98
|
+
"ts-loader": "9.5.4",
|
|
100
99
|
"typescript": "5.0.4",
|
|
101
|
-
"webpack": "5.
|
|
100
|
+
"webpack": "5.101.3",
|
|
102
101
|
"webpack-cli": "6.0.1"
|
|
103
102
|
},
|
|
104
103
|
"peerDependencies": {
|
|
@@ -106,5 +105,5 @@
|
|
|
106
105
|
},
|
|
107
106
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base",
|
|
108
107
|
"sideEffects": false,
|
|
109
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "98f9d720af84bc38074dfd4ab7760ae83a3e9826"
|
|
110
109
|
}
|