@opentelemetry/exporter-metrics-otlp-http 0.52.1 → 0.54.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/index.js +3 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/platform/browser/OTLPMetricExporter.d.ts +0 -1
- package/build/esm/platform/browser/OTLPMetricExporter.js +2 -15
- package/build/esm/platform/browser/OTLPMetricExporter.js.map +1 -1
- package/build/esm/platform/browser/index.js +3 -0
- package/build/esm/platform/browser/index.js.map +1 -1
- package/build/esm/platform/index.js +3 -0
- package/build/esm/platform/index.js.map +1 -1
- package/build/esm/platform/node/OTLPMetricExporter.d.ts +0 -1
- package/build/esm/platform/node/OTLPMetricExporter.js +2 -16
- package/build/esm/platform/node/OTLPMetricExporter.js.map +1 -1
- package/build/esm/platform/node/index.js +3 -0
- package/build/esm/platform/node/index.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/index.js +3 -0
- package/build/esnext/index.js.map +1 -1
- package/build/esnext/platform/browser/OTLPMetricExporter.d.ts +0 -1
- package/build/esnext/platform/browser/OTLPMetricExporter.js +2 -14
- package/build/esnext/platform/browser/OTLPMetricExporter.js.map +1 -1
- package/build/esnext/platform/browser/index.js +3 -0
- package/build/esnext/platform/browser/index.js.map +1 -1
- package/build/esnext/platform/index.js +3 -0
- package/build/esnext/platform/index.js.map +1 -1
- package/build/esnext/platform/node/OTLPMetricExporter.d.ts +0 -1
- package/build/esnext/platform/node/OTLPMetricExporter.js +2 -15
- package/build/esnext/platform/node/OTLPMetricExporter.js.map +1 -1
- package/build/esnext/platform/node/index.js +3 -0
- package/build/esnext/platform/node/index.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/index.js +3 -0
- package/build/src/index.js.map +1 -1
- package/build/src/platform/browser/OTLPMetricExporter.d.ts +0 -1
- package/build/src/platform/browser/OTLPMetricExporter.js +1 -13
- package/build/src/platform/browser/OTLPMetricExporter.js.map +1 -1
- package/build/src/platform/browser/index.js +3 -0
- package/build/src/platform/browser/index.js.map +1 -1
- package/build/src/platform/index.js +3 -0
- package/build/src/platform/index.js.map +1 -1
- package/build/src/platform/node/OTLPMetricExporter.d.ts +0 -1
- package/build/src/platform/node/OTLPMetricExporter.js +1 -14
- package/build/src/platform/node/OTLPMetricExporter.js.map +1 -1
- package/build/src/platform/node/index.js +3 -0
- package/build/src/platform/node/index.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 +16 -20
package/build/esm/index.js
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './platform';
|
|
17
20
|
export * from './OTLPMetricExporterOptions';
|
|
18
21
|
export * from './OTLPMetricExporterBase';
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Web
|
|
@@ -28,28 +28,15 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
28
28
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
29
29
|
};
|
|
30
30
|
})();
|
|
31
|
-
import { baggageUtils, getEnv } from '@opentelemetry/core';
|
|
32
31
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
33
|
-
import { OTLPExporterBrowserBase,
|
|
32
|
+
import { OTLPExporterBrowserBase, } from '@opentelemetry/otlp-exporter-base';
|
|
34
33
|
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
|
|
35
34
|
var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
36
|
-
var DEFAULT_COLLECTOR_URL = "http://localhost:4318/" + DEFAULT_COLLECTOR_RESOURCE_PATH;
|
|
37
35
|
var OTLPExporterBrowserProxy = /** @class */ (function (_super) {
|
|
38
36
|
__extends(OTLPExporterBrowserProxy, _super);
|
|
39
37
|
function OTLPExporterBrowserProxy(config) {
|
|
40
|
-
|
|
41
|
-
_this._headers = Object.assign(_this._headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS));
|
|
42
|
-
return _this;
|
|
38
|
+
return _super.call(this, config, JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH) || this;
|
|
43
39
|
}
|
|
44
|
-
OTLPExporterBrowserProxy.prototype.getDefaultUrl = function (config) {
|
|
45
|
-
return typeof config.url === 'string'
|
|
46
|
-
? config.url
|
|
47
|
-
: getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
48
|
-
? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
49
|
-
: getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
50
|
-
? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
51
|
-
: DEFAULT_COLLECTOR_URL;
|
|
52
|
-
};
|
|
53
40
|
return OTLPExporterBrowserProxy;
|
|
54
41
|
}(OTLPExporterBrowserBase));
|
|
55
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,uBAAuB,GAExB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,IAAM,+BAA+B,GAAG,YAAY,CAAC;AAErD;IAAuC,4CAGtC;IACC,kCAAY,MAA2D;eACrE,kBACE,MAAM,EACN,qBAAqB,EACrB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EACtC,+BAA+B,CAChC;IACH,CAAC;IACH,+BAAC;AAAD,CAAC,AAZD,CAAuC,uBAAuB,GAY7D;AAED;;GAEG;AACH;IAAwC,sCAAgD;IACtF,4BAAY,MAA2D;eACrE,kBAAM,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACrD,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,CAAwC,sBAAsB,GAI7D","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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterBrowserBase,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\n\nclass OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase) {\n super(\n config,\n JsonMetricsSerializer,\n { 'Content-Type': 'application/json' },\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterBrowserProxy(config), config);\n }\n}\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './OTLPMetricExporter';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './node';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,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 * from './node';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './node';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Node
|
|
@@ -39,32 +39,18 @@ var __assign = (this && this.__assign) || function () {
|
|
|
39
39
|
};
|
|
40
40
|
return __assign.apply(this, arguments);
|
|
41
41
|
};
|
|
42
|
-
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
43
42
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
44
|
-
import { OTLPExporterNodeBase,
|
|
43
|
+
import { OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
|
|
45
44
|
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
|
|
46
45
|
import { VERSION } from '../../version';
|
|
47
|
-
var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
48
|
-
var DEFAULT_COLLECTOR_URL = "http://localhost:4318/" + DEFAULT_COLLECTOR_RESOURCE_PATH;
|
|
49
46
|
var USER_AGENT = {
|
|
50
47
|
'User-Agent': "OTel-OTLP-Exporter-JavaScript/" + VERSION,
|
|
51
48
|
};
|
|
52
49
|
var OTLPExporterNodeProxy = /** @class */ (function (_super) {
|
|
53
50
|
__extends(OTLPExporterNodeProxy, _super);
|
|
54
51
|
function OTLPExporterNodeProxy(config) {
|
|
55
|
-
|
|
56
|
-
_this.headers = __assign(__assign(__assign(__assign({}, _this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers));
|
|
57
|
-
return _this;
|
|
52
|
+
return _super.call(this, config, JsonMetricsSerializer, __assign(__assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics') || this;
|
|
58
53
|
}
|
|
59
|
-
OTLPExporterNodeProxy.prototype.getDefaultUrl = function (config) {
|
|
60
|
-
return typeof config.url === 'string'
|
|
61
|
-
? config.url
|
|
62
|
-
: getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
63
|
-
? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
64
|
-
: getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
65
|
-
? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
66
|
-
: DEFAULT_COLLECTOR_URL;
|
|
67
|
-
};
|
|
68
54
|
return OTLPExporterNodeProxy;
|
|
69
55
|
}(OTLPExporterNodeBase));
|
|
70
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,oBAAoB,GAErB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;IAAoC,yCAGnC;IACC,+BAAY,MAA+D;eACzE,kBACE,MAAM,EACN,qBAAqB,wBAEhB,UAAU,KACb,cAAc,EAAE,kBAAkB,KAEpC,SAAS,EACT,YAAY,CACb;IACH,CAAC;IACH,4BAAC;AAAD,CAAC,AAhBD,CAAoC,oBAAoB,GAgBvD;AAED;;GAEG;AACH;IAAwC,sCAA6C;IACnF,4BAAY,MAA+D;eACzE,kBAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAClD,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,CAAwC,sBAAsB,GAI7D","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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPExporterNodeProxy extends OTLPExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n config,\n JsonMetricsSerializer,\n {\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n },\n 'METRICS',\n 'v1/metrics'\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Node\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterNodeProxy(config), config);\n }\n}\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './OTLPMetricExporter';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
package/build/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.54.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esm/version.js
CHANGED
package/build/esm/version.js.map
CHANGED
|
@@ -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.
|
|
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.54.0';\n"]}
|
package/build/esnext/index.js
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './platform';
|
|
17
20
|
export * from './OTLPMetricExporterOptions';
|
|
18
21
|
export * from './OTLPMetricExporterBase';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Web
|
|
@@ -13,25 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { baggageUtils, getEnv } from '@opentelemetry/core';
|
|
17
16
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
18
|
-
import { OTLPExporterBrowserBase,
|
|
17
|
+
import { OTLPExporterBrowserBase, } from '@opentelemetry/otlp-exporter-base';
|
|
19
18
|
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
|
|
20
19
|
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
21
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
22
20
|
class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase {
|
|
23
21
|
constructor(config) {
|
|
24
|
-
super(config, JsonMetricsSerializer, 'application/json');
|
|
25
|
-
this._headers = Object.assign(this._headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS));
|
|
26
|
-
}
|
|
27
|
-
getDefaultUrl(config) {
|
|
28
|
-
return typeof config.url === 'string'
|
|
29
|
-
? config.url
|
|
30
|
-
: getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
31
|
-
? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
32
|
-
: getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
33
|
-
? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
34
|
-
: DEFAULT_COLLECTOR_URL;
|
|
22
|
+
super(config, JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH);
|
|
35
23
|
}
|
|
36
24
|
}
|
|
37
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,uBAAuB,GAExB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,+BAA+B,GAAG,YAAY,CAAC;AAErD,MAAM,wBAAyB,SAAQ,uBAGtC;IACC,YAAY,MAA2D;QACrE,KAAK,CACH,MAAM,EACN,qBAAqB,EACrB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EACtC,+BAA+B,CAChC,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAgD;IACtF,YAAY,MAA2D;QACrE,KAAK,CAAC,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACtD,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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterBrowserBase,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\n\nclass OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase) {\n super(\n config,\n JsonMetricsSerializer,\n { 'Content-Type': 'application/json' },\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterBrowserProxy(config), config);\n }\n}\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './OTLPMetricExporter';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './node';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,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 * from './node';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './node';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Node
|
|
@@ -13,29 +13,16 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
17
16
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
18
|
-
import { OTLPExporterNodeBase,
|
|
17
|
+
import { OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
|
|
19
18
|
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
|
|
20
19
|
import { VERSION } from '../../version';
|
|
21
|
-
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
22
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
23
20
|
const USER_AGENT = {
|
|
24
21
|
'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,
|
|
25
22
|
};
|
|
26
23
|
class OTLPExporterNodeProxy extends OTLPExporterNodeBase {
|
|
27
24
|
constructor(config) {
|
|
28
|
-
super(config, JsonMetricsSerializer, 'application/json');
|
|
29
|
-
this.headers = Object.assign(Object.assign(Object.assign(Object.assign({}, this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), parseHeaders(config === null || config === void 0 ? void 0 : config.headers));
|
|
30
|
-
}
|
|
31
|
-
getDefaultUrl(config) {
|
|
32
|
-
return typeof config.url === 'string'
|
|
33
|
-
? config.url
|
|
34
|
-
: getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
35
|
-
? appendRootPathToUrlIfNeeded(getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
36
|
-
: getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
37
|
-
? appendResourcePathToUrl(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
38
|
-
: DEFAULT_COLLECTOR_URL;
|
|
25
|
+
super(config, JsonMetricsSerializer, Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics');
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,oBAAoB,GAErB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,OAAO,EAAE;CACzD,CAAC;AAEF,MAAM,qBAAsB,SAAQ,oBAGnC;IACC,YAAY,MAA+D;QACzE,KAAK,CACH,MAAM,EACN,qBAAqB,kCAEhB,UAAU,KACb,cAAc,EAAE,kBAAkB,KAEpC,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAA6C;IACnF,YAAY,MAA+D;QACzE,KAAK,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACnD,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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPExporterNodeProxy extends OTLPExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n config,\n JsonMetricsSerializer,\n {\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n },\n 'METRICS',\n 'v1/metrics'\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Node\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterNodeProxy(config), config);\n }\n}\n"]}
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
17
|
+
* TODO: Replace export * with named exports before next major version
|
|
18
|
+
*/
|
|
16
19
|
export * from './OTLPMetricExporter';
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.54.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esnext/version.js
CHANGED
|
@@ -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.
|
|
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.54.0';\n"]}
|
package/build/src/index.js
CHANGED
|
@@ -25,6 +25,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
29
|
+
* TODO: Replace export * with named exports before next major version
|
|
30
|
+
*/
|
|
28
31
|
__exportStar(require("./platform"), exports);
|
|
29
32
|
__exportStar(require("./OTLPMetricExporterOptions"), exports);
|
|
30
33
|
__exportStar(require("./OTLPMetricExporterBase"), exports);
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,8DAA4C;AAC5C,2DAAyC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH;;GAEG;AACH,6CAA2B;AAC3B,8DAA4C;AAC5C,2DAAyC","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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Web
|
|
@@ -16,25 +16,13 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OTLPMetricExporter = void 0;
|
|
19
|
-
const core_1 = require("@opentelemetry/core");
|
|
20
19
|
const OTLPMetricExporterBase_1 = require("../../OTLPMetricExporterBase");
|
|
21
20
|
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
22
21
|
const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
|
|
23
22
|
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
24
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
25
23
|
class OTLPExporterBrowserProxy extends otlp_exporter_base_1.OTLPExporterBrowserBase {
|
|
26
24
|
constructor(config) {
|
|
27
|
-
super(config, otlp_transformer_1.JsonMetricsSerializer, 'application/json');
|
|
28
|
-
this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_HEADERS));
|
|
29
|
-
}
|
|
30
|
-
getDefaultUrl(config) {
|
|
31
|
-
return typeof config.url === 'string'
|
|
32
|
-
? config.url
|
|
33
|
-
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
34
|
-
? (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
35
|
-
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
36
|
-
? (0, otlp_exporter_base_1.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
37
|
-
: DEFAULT_COLLECTOR_URL;
|
|
25
|
+
super(config, otlp_transformer_1.JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH);
|
|
38
26
|
}
|
|
39
27
|
}
|
|
40
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,yEAAsE;AACtE,0EAG2C;AAC3C,sEAGyC;AAEzC,MAAM,+BAA+B,GAAG,YAAY,CAAC;AAErD,MAAM,wBAAyB,SAAQ,4CAGtC;IACC,YAAY,MAA2D;QACrE,KAAK,CACH,MAAM,EACN,wCAAqB,EACrB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EACtC,+BAA+B,CAChC,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAAgD;IACtF,YAAY,MAA2D;QACrE,KAAK,CAAC,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;CACF;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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterBrowserBase,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\n\nclass OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase) {\n super(\n config,\n JsonMetricsSerializer,\n { 'Content-Type': 'application/json' },\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterBrowserProxy(config), config);\n }\n}\n"]}
|
|
@@ -25,5 +25,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
29
|
+
* TODO: Replace export * with named exports before next major version
|
|
30
|
+
*/
|
|
28
31
|
__exportStar(require("./OTLPMetricExporter"), exports);
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,uDAAqC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH;;GAEG;AACH,uDAAqC","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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
|
@@ -25,5 +25,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
29
|
+
* TODO: Replace export * with named exports before next major version
|
|
30
|
+
*/
|
|
28
31
|
__exportStar(require("./node"), exports);
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,yCAAuB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './node';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH;;GAEG;AACH,yCAAuB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './node';\n"]}
|
|
@@ -5,7 +5,6 @@ import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry
|
|
|
5
5
|
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
|
|
7
7
|
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
|
|
8
|
-
getDefaultUrl(config: OTLPExporterNodeConfigBase): string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Collector Metric Exporter for Node
|
|
@@ -16,29 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OTLPMetricExporter = void 0;
|
|
19
|
-
const core_1 = require("@opentelemetry/core");
|
|
20
19
|
const OTLPMetricExporterBase_1 = require("../../OTLPMetricExporterBase");
|
|
21
20
|
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
22
21
|
const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
|
|
23
22
|
const version_1 = require("../../version");
|
|
24
|
-
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
25
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
26
23
|
const USER_AGENT = {
|
|
27
24
|
'User-Agent': `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`,
|
|
28
25
|
};
|
|
29
26
|
class OTLPExporterNodeProxy extends otlp_exporter_base_1.OTLPExporterNodeBase {
|
|
30
27
|
constructor(config) {
|
|
31
|
-
super(config, otlp_transformer_1.JsonMetricsSerializer, 'application/json');
|
|
32
|
-
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_METRICS_HEADERS)), (0, otlp_exporter_base_1.parseHeaders)(config === null || config === void 0 ? void 0 : config.headers));
|
|
33
|
-
}
|
|
34
|
-
getDefaultUrl(config) {
|
|
35
|
-
return typeof config.url === 'string'
|
|
36
|
-
? config.url
|
|
37
|
-
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0
|
|
38
|
-
? (0, otlp_exporter_base_1.appendRootPathToUrlIfNeeded)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
|
|
39
|
-
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
40
|
-
? (0, otlp_exporter_base_1.appendResourcePathToUrl)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
41
|
-
: DEFAULT_COLLECTOR_URL;
|
|
28
|
+
super(config, otlp_transformer_1.JsonMetricsSerializer, Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics');
|
|
42
29
|
}
|
|
43
30
|
}
|
|
44
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,yEAAsE;AACtE,0EAG2C;AAC3C,sEAGyC;AACzC,2CAAwC;AAExC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,iBAAO,EAAE;CACzD,CAAC;AAEF,MAAM,qBAAsB,SAAQ,yCAGnC;IACC,YAAY,MAA+D;QACzE,KAAK,CACH,MAAM,EACN,wCAAqB,kCAEhB,UAAU,KACb,cAAc,EAAE,kBAAkB,KAEpC,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAA6C;IACnF,YAAY,MAA+D;QACzE,KAAK,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF;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 { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPExporterNodeProxy extends OTLPExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n config,\n JsonMetricsSerializer,\n {\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n },\n 'METRICS',\n 'v1/metrics'\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Node\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterNodeProxy(config), config);\n }\n}\n"]}
|
|
@@ -25,5 +25,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
|
|
29
|
+
* TODO: Replace export * with named exports before next major version
|
|
30
|
+
*/
|
|
28
31
|
__exportStar(require("./OTLPMetricExporter"), exports);
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,uDAAqC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPMetricExporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH;;GAEG;AACH,uDAAqC","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/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.54.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,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.
|
|
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.54.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/exporter-metrics-otlp-http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -17,19 +17,17 @@
|
|
|
17
17
|
"prepublishOnly": "npm run compile",
|
|
18
18
|
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
19
19
|
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
20
|
-
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
|
|
21
20
|
"lint": "eslint . --ext .ts",
|
|
22
21
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
23
22
|
"tdd": "npm run test -- --watch-extensions ts --watch",
|
|
24
23
|
"tdd:browser": "karma start",
|
|
25
|
-
"test": "nyc
|
|
24
|
+
"test": "nyc mocha 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
|
|
26
25
|
"test:browser": "karma start --single-run",
|
|
27
26
|
"version": "node ../../../scripts/version-update.js",
|
|
28
27
|
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
29
28
|
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
|
30
29
|
"prewatch": "npm run precompile",
|
|
31
30
|
"peer-api-check": "node ../../../scripts/peer-api-check.js",
|
|
32
|
-
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
|
|
33
31
|
"align-api-deps": "node ../../../scripts/align-api-deps.js"
|
|
34
32
|
},
|
|
35
33
|
"keywords": [
|
|
@@ -64,31 +62,29 @@
|
|
|
64
62
|
"access": "public"
|
|
65
63
|
},
|
|
66
64
|
"devDependencies": {
|
|
67
|
-
"@babel/core": "7.
|
|
68
|
-
"@babel/preset-env": "7.
|
|
65
|
+
"@babel/core": "7.25.2",
|
|
66
|
+
"@babel/preset-env": "7.25.4",
|
|
69
67
|
"@opentelemetry/api": "1.9.0",
|
|
70
|
-
"@types/mocha": "10.0.
|
|
68
|
+
"@types/mocha": "10.0.8",
|
|
71
69
|
"@types/node": "18.6.5",
|
|
72
70
|
"@types/sinon": "17.0.3",
|
|
73
71
|
"@types/webpack-env": "1.16.3",
|
|
74
|
-
"babel-loader": "8.
|
|
75
|
-
"babel-plugin-istanbul": "
|
|
76
|
-
"codecov": "3.8.3",
|
|
72
|
+
"babel-loader": "8.4.1",
|
|
73
|
+
"babel-plugin-istanbul": "7.0.0",
|
|
77
74
|
"cross-var": "1.1.0",
|
|
78
|
-
"karma": "6.4.
|
|
75
|
+
"karma": "6.4.4",
|
|
79
76
|
"karma-chrome-launcher": "3.1.0",
|
|
80
77
|
"karma-coverage": "2.2.1",
|
|
81
78
|
"karma-mocha": "2.0.1",
|
|
82
79
|
"karma-spec-reporter": "0.0.36",
|
|
83
80
|
"karma-webpack": "5.0.1",
|
|
84
81
|
"lerna": "6.6.2",
|
|
85
|
-
"mocha": "10.
|
|
82
|
+
"mocha": "10.7.3",
|
|
86
83
|
"nyc": "15.1.0",
|
|
87
84
|
"sinon": "15.1.2",
|
|
88
85
|
"ts-loader": "9.5.1",
|
|
89
|
-
"ts-mocha": "10.0.0",
|
|
90
86
|
"typescript": "4.4.4",
|
|
91
|
-
"webpack": "5.
|
|
87
|
+
"webpack": "5.94.0",
|
|
92
88
|
"webpack-cli": "5.1.4",
|
|
93
89
|
"webpack-merge": "5.10.0"
|
|
94
90
|
},
|
|
@@ -96,13 +92,13 @@
|
|
|
96
92
|
"@opentelemetry/api": "^1.3.0"
|
|
97
93
|
},
|
|
98
94
|
"dependencies": {
|
|
99
|
-
"@opentelemetry/core": "1.
|
|
100
|
-
"@opentelemetry/otlp-exporter-base": "0.
|
|
101
|
-
"@opentelemetry/otlp-transformer": "0.
|
|
102
|
-
"@opentelemetry/resources": "1.
|
|
103
|
-
"@opentelemetry/sdk-metrics": "1.
|
|
95
|
+
"@opentelemetry/core": "1.27.0",
|
|
96
|
+
"@opentelemetry/otlp-exporter-base": "0.54.0",
|
|
97
|
+
"@opentelemetry/otlp-transformer": "0.54.0",
|
|
98
|
+
"@opentelemetry/resources": "1.27.0",
|
|
99
|
+
"@opentelemetry/sdk-metrics": "1.27.0"
|
|
104
100
|
},
|
|
105
101
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http",
|
|
106
102
|
"sideEffects": false,
|
|
107
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "eb3ca4fb07ee31c62093f5fcec56575573c902ce"
|
|
108
104
|
}
|