@opentelemetry/exporter-metrics-otlp-http 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/build/esm/OTLPMetricExporterBase.d.ts +2 -1
- package/build/esm/OTLPMetricExporterBase.js +21 -37
- package/build/esm/OTLPMetricExporterBase.js.map +1 -1
- package/build/esm/OTLPMetricExporterOptions.d.ts +7 -2
- package/build/esm/OTLPMetricExporterOptions.js +6 -1
- package/build/esm/OTLPMetricExporterOptions.js.map +1 -1
- package/build/esm/platform/browser/OTLPMetricExporter.js +1 -15
- package/build/esm/platform/browser/OTLPMetricExporter.js.map +1 -1
- package/build/esm/platform/node/OTLPMetricExporter.js +1 -26
- package/build/esm/platform/node/OTLPMetricExporter.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/OTLPMetricExporterBase.d.ts +2 -1
- package/build/esnext/OTLPMetricExporterBase.js +20 -1
- package/build/esnext/OTLPMetricExporterBase.js.map +1 -1
- package/build/esnext/OTLPMetricExporterOptions.d.ts +7 -2
- package/build/esnext/OTLPMetricExporterOptions.js +6 -1
- package/build/esnext/OTLPMetricExporterOptions.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/OTLPMetricExporterBase.d.ts +2 -1
- package/build/src/OTLPMetricExporterBase.js +22 -2
- package/build/src/OTLPMetricExporterBase.js.map +1 -1
- package/build/src/OTLPMetricExporterOptions.d.ts +7 -2
- package/build/src/OTLPMetricExporterOptions.js +7 -0
- package/build/src/OTLPMetricExporterOptions.js.map +1 -1
- package/build/src/index.js +4 -13
- package/build/src/index.js.map +1 -1
- package/build/src/platform/browser/index.js +2 -11
- package/build/src/platform/browser/index.js.map +1 -1
- package/build/src/platform/index.js +2 -11
- package/build/src/platform/index.js.map +1 -1
- package/build/src/platform/node/index.js +2 -11
- 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 +21 -18
package/README.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
**Note: This is an experimental package under active development. New releases may include breaking changes.**
|
|
7
7
|
|
|
8
|
-
This module provides exporter for
|
|
9
|
-
Compatible with [opentelemetry-collector][opentelemetry-collector-url] versions `>=0.52 <=0.53`.
|
|
8
|
+
This module provides a metrics-exporter for OTLP (http/json) using protocol version `v0.20.0`.
|
|
10
9
|
|
|
11
10
|
## Installation
|
|
12
11
|
|
|
@@ -81,7 +80,7 @@ In addition to settings passed to the constructor, the exporter also supports co
|
|
|
81
80
|
|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
82
81
|
| OTEL_EXPORTER_OTLP_ENDPOINT | The endpoint to send metrics to. This will also be used for the traces exporter if `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` is not configured. By default `http://localhost:4318` will be used. `/v1/metrics` will be automatically appended to configured values. |
|
|
83
82
|
| OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | The endpoint to send metrics to. By default `https://localhost:4318/v1/metrics` will be used. `v1/metrics` will not be appended automatically and has to be added explicitly. |
|
|
84
|
-
| OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | The exporters aggregation temporality preference. Valid values are `cumulative`, and `
|
|
83
|
+
| OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | The exporters aggregation temporality preference. Valid values are `cumulative`, `delta`, and `lowmemory`. `cumulative` selects cumulative temporality for all instrument kinds. `delta` selects delta aggregation temporality for Counter, Asynchronous Counter and Histogram instrument kinds, and selects cumulative aggregation for UpDownCounter and Asynchronous UpDownCounter instrument kinds. `lowmemory` selects delta aggregation temporality for Counter and Histogram instrument kinds, and selects cumulative aggregation for UpDownCounter, Asynchronous Counter and Asynchronous UpDownCounter instrument kinds. By default `cumulative` is used. |
|
|
85
84
|
|
|
86
85
|
> Settings configured programmatically take precedence over environment variables. Per-signal environment variables take
|
|
87
86
|
> precedence over non-per-signal environment variables.
|
|
@@ -5,9 +5,10 @@ import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
|
|
|
5
5
|
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
|
|
7
7
|
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
|
|
8
|
+
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
|
|
8
9
|
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics, IExportMetricsServiceRequest>> implements PushMetricExporter {
|
|
9
10
|
_otlpExporter: T;
|
|
10
|
-
|
|
11
|
+
private _aggregationTemporalitySelector;
|
|
11
12
|
constructor(exporter: T, config?: OTLPMetricExporterOptions);
|
|
12
13
|
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
|
|
13
14
|
shutdown(): Promise<void>;
|
|
@@ -13,44 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
16
|
+
import { __awaiter, __generator } from "tslib";
|
|
52
17
|
import { getEnv } from '@opentelemetry/core';
|
|
53
18
|
import { AggregationTemporality, InstrumentType, } from '@opentelemetry/sdk-metrics';
|
|
19
|
+
import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
|
|
54
20
|
import { diag } from '@opentelemetry/api';
|
|
55
21
|
export var CumulativeTemporalitySelector = function () { return AggregationTemporality.CUMULATIVE; };
|
|
56
22
|
export var DeltaTemporalitySelector = function (instrumentType) {
|
|
@@ -65,6 +31,18 @@ export var DeltaTemporalitySelector = function (instrumentType) {
|
|
|
65
31
|
return AggregationTemporality.CUMULATIVE;
|
|
66
32
|
}
|
|
67
33
|
};
|
|
34
|
+
export var LowMemoryTemporalitySelector = function (instrumentType) {
|
|
35
|
+
switch (instrumentType) {
|
|
36
|
+
case InstrumentType.COUNTER:
|
|
37
|
+
case InstrumentType.HISTOGRAM:
|
|
38
|
+
return AggregationTemporality.DELTA;
|
|
39
|
+
case InstrumentType.UP_DOWN_COUNTER:
|
|
40
|
+
case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
41
|
+
case InstrumentType.OBSERVABLE_COUNTER:
|
|
42
|
+
case InstrumentType.OBSERVABLE_GAUGE:
|
|
43
|
+
return AggregationTemporality.CUMULATIVE;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
68
46
|
function chooseTemporalitySelectorFromEnvironment() {
|
|
69
47
|
var env = getEnv();
|
|
70
48
|
var configuredTemporality = env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();
|
|
@@ -74,15 +52,21 @@ function chooseTemporalitySelectorFromEnvironment() {
|
|
|
74
52
|
if (configuredTemporality === 'delta') {
|
|
75
53
|
return DeltaTemporalitySelector;
|
|
76
54
|
}
|
|
55
|
+
if (configuredTemporality === 'lowmemory') {
|
|
56
|
+
return LowMemoryTemporalitySelector;
|
|
57
|
+
}
|
|
77
58
|
diag.warn("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '" + env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + "', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.");
|
|
78
59
|
return CumulativeTemporalitySelector;
|
|
79
60
|
}
|
|
80
61
|
function chooseTemporalitySelector(temporalityPreference) {
|
|
81
62
|
// Directly passed preference has priority.
|
|
82
63
|
if (temporalityPreference != null) {
|
|
83
|
-
if (temporalityPreference ===
|
|
64
|
+
if (temporalityPreference === AggregationTemporalityPreference.DELTA) {
|
|
84
65
|
return DeltaTemporalitySelector;
|
|
85
66
|
}
|
|
67
|
+
else if (temporalityPreference === AggregationTemporalityPreference.LOWMEMORY) {
|
|
68
|
+
return LowMemoryTemporalitySelector;
|
|
69
|
+
}
|
|
86
70
|
return CumulativeTemporalitySelector;
|
|
87
71
|
}
|
|
88
72
|
return chooseTemporalitySelectorFromEnvironment();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,OAAO,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAEtB,cAAc,GAGf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,IAAM,6BAA6B,GACxC,cAAM,OAAA,sBAAsB,CAAC,UAAU,EAAjC,CAAiC,CAAC;AAE1C,MAAM,CAAC,IAAM,wBAAwB,GAAmC,UACtE,cAA8B;IAE9B,QAAQ,cAAc,EAAE;QACtB,KAAK,cAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,cAAc,CAAC,kBAAkB,CAAC;QACvC,KAAK,cAAc,CAAC,SAAS,CAAC;QAC9B,KAAK,cAAc,CAAC,gBAAgB;YAClC,OAAO,sBAAsB,CAAC,KAAK,CAAC;QACtC,KAAK,cAAc,CAAC,eAAe,CAAC;QACpC,KAAK,cAAc,CAAC,0BAA0B;YAC5C,OAAO,sBAAsB,CAAC,UAAU,CAAC;KAC5C;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,4BAA4B,GAAmC,UAC1E,cAA8B;IAE9B,QAAQ,cAAc,EAAE;QACtB,KAAK,cAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,cAAc,CAAC,SAAS;YAC3B,OAAO,sBAAsB,CAAC,KAAK,CAAC;QACtC,KAAK,cAAc,CAAC,eAAe,CAAC;QACpC,KAAK,cAAc,CAAC,0BAA0B,CAAC;QAC/C,KAAK,cAAc,CAAC,kBAAkB,CAAC;QACvC,KAAK,cAAc,CAAC,gBAAgB;YAClC,OAAO,sBAAsB,CAAC,UAAU,CAAC;KAC5C;AACH,CAAC,CAAC;AAEF,SAAS,wCAAwC;IAC/C,IAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,IAAM,qBAAqB,GACzB,GAAG,CAAC,iDAAiD,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE7E,IAAI,qBAAqB,KAAK,YAAY,EAAE;QAC1C,OAAO,6BAA6B,CAAC;KACtC;IACD,IAAI,qBAAqB,KAAK,OAAO,EAAE;QACrC,OAAO,wBAAwB,CAAC;KACjC;IACD,IAAI,qBAAqB,KAAK,WAAW,EAAE;QACzC,OAAO,4BAA4B,CAAC;KACrC;IAED,IAAI,CAAC,IAAI,CACP,kEAAgE,GAAG,CAAC,iDAAiD,4FAAyF,CAC/M,CAAC;IACF,OAAO,6BAA6B,CAAC;AACvC,CAAC;AAED,SAAS,yBAAyB,CAChC,qBAE0B;IAE1B,2CAA2C;IAC3C,IAAI,qBAAqB,IAAI,IAAI,EAAE;QACjC,IAAI,qBAAqB,KAAK,gCAAgC,CAAC,KAAK,EAAE;YACpE,OAAO,wBAAwB,CAAC;SACjC;aAAM,IACL,qBAAqB,KAAK,gCAAgC,CAAC,SAAS,EACpE;YACA,OAAO,4BAA4B,CAAC;SACrC;QACD,OAAO,6BAA6B,CAAC;KACtC;IAED,OAAO,wCAAwC,EAAE,CAAC;AACpD,CAAC;AAED;IAWE,gCAAY,QAAW,EAAE,MAAkC;QACzD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC9B,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,uCAAM,GAAN,UACE,OAAwB,EACxB,cAA8C;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAEK,yCAAQ,GAAd;;;;4BACE,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAA;;wBAAnC,SAAmC,CAAC;;;;;KACrC;IAED,2CAAU,GAAV;QACE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,6DAA4B,GAA5B,UACE,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IACH,6BAAC;AAAD,CAAC,AAtCD,IAsCC","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 { ExportResult, getEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';\nimport { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const env = getEnv();\n const configuredTemporality =\n env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nexport class OTLPMetricExporterBase<\n T extends OTLPExporterBase<\n OTLPMetricExporterOptions,\n ResourceMetrics,\n IExportMetricsServiceRequest\n >\n> implements PushMetricExporter\n{\n public _otlpExporter: T;\n private _aggregationTemporalitySelector: AggregationTemporalitySelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n export(\n metrics: ResourceMetrics,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._otlpExporter.export([metrics], resultCallback);\n }\n\n async shutdown(): Promise<void> {\n await this._otlpExporter.shutdown();\n }\n\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
2
1
|
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
2
|
+
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
3
3
|
export interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {
|
|
4
|
-
temporalityPreference?: AggregationTemporality;
|
|
4
|
+
temporalityPreference?: AggregationTemporalityPreference | AggregationTemporality;
|
|
5
|
+
}
|
|
6
|
+
export declare enum AggregationTemporalityPreference {
|
|
7
|
+
DELTA = 0,
|
|
8
|
+
CUMULATIVE = 1,
|
|
9
|
+
LOWMEMORY = 2
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=OTLPMetricExporterOptions.d.ts.map
|
|
@@ -13,5 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export var AggregationTemporalityPreference;
|
|
17
|
+
(function (AggregationTemporalityPreference) {
|
|
18
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["DELTA"] = 0] = "DELTA";
|
|
19
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["CUMULATIVE"] = 1] = "CUMULATIVE";
|
|
20
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["LOWMEMORY"] = 2] = "LOWMEMORY";
|
|
21
|
+
})(AggregationTemporalityPreference || (AggregationTemporalityPreference = {}));
|
|
17
22
|
//# sourceMappingURL=OTLPMetricExporterOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 {
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","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 { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { AggregationTemporality } from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
|
|
@@ -13,21 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
var extendStatics = function (d, b) {
|
|
18
|
-
extendStatics = Object.setPrototypeOf ||
|
|
19
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
20
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
21
|
-
return extendStatics(d, b);
|
|
22
|
-
};
|
|
23
|
-
return function (d, b) {
|
|
24
|
-
if (typeof b !== "function" && b !== null)
|
|
25
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
-
extendStatics(d, b);
|
|
27
|
-
function __() { this.constructor = d; }
|
|
28
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
16
|
+
import { __extends } from "tslib";
|
|
31
17
|
import { baggageUtils, getEnv } from '@opentelemetry/core';
|
|
32
18
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
33
19
|
import { OTLPExporterBrowserBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
|
|
@@ -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;;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,uBAAuB,EAEvB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iCAAiC,GAElC,MAAM,iCAAiC,CAAC;AAEzC,IAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AAEzF;IAAuC,4CAGtC;IACC,kCAAY,MAA2D;QAAvE,YACE,kBAAM,MAAM,CAAC,SAOd;QANC,KAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,KAAI,CAAC,QAAQ,EACb,YAAY,CAAC,uBAAuB,CAClC,MAAM,EAAE,CAAC,kCAAkC,CAC5C,CACF,CAAC;;IACJ,CAAC;IAED,gDAAa,GAAb,UAAc,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,MAAM,EAAE,CAAC,mCAAmC,CAAC,MAAM,GAAG,CAAC;gBACzD,CAAC,CAAC,2BAA2B,CACzB,MAAM,EAAE,CAAC,mCAAmC,CAC7C;gBACH,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IAED,0CAAO,GAAP,UAAQ,OAA0B;QAChC,OAAO,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IACH,+BAAC;AAAD,CAAC,AAhCD,CAAuC,uBAAuB,GAgC7D;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 { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterBrowserBase,\n OTLPExporterConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n createExportMetricsServiceRequest,\n IExportMetricsServiceRequest,\n} from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\nclass OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<\n ResourceMetrics,\n IExportMetricsServiceRequest\n> {\n constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase) {\n super(config);\n this._headers = Object.assign(\n this._headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS\n )\n );\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT\n )\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics);\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,32 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
var extendStatics = function (d, b) {
|
|
18
|
-
extendStatics = Object.setPrototypeOf ||
|
|
19
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
20
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
21
|
-
return extendStatics(d, b);
|
|
22
|
-
};
|
|
23
|
-
return function (d, b) {
|
|
24
|
-
if (typeof b !== "function" && b !== null)
|
|
25
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
-
extendStatics(d, b);
|
|
27
|
-
function __() { this.constructor = d; }
|
|
28
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
31
|
-
var __assign = (this && this.__assign) || function () {
|
|
32
|
-
__assign = Object.assign || function(t) {
|
|
33
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
34
|
-
s = arguments[i];
|
|
35
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
36
|
-
t[p] = s[p];
|
|
37
|
-
}
|
|
38
|
-
return t;
|
|
39
|
-
};
|
|
40
|
-
return __assign.apply(this, arguments);
|
|
41
|
-
};
|
|
16
|
+
import { __assign, __extends } from "tslib";
|
|
42
17
|
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
43
18
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
44
19
|
import { OTLPExporterNodeBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
|
|
@@ -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;;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,oBAAoB,EAEpB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iCAAiC,GAElC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,IAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,IAAM,qBAAqB,GAAG,2BAAyB,+BAAiC,CAAC;AACzF,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;IAAoC,yCAGnC;IACC,+BAAY,MAA+D;QAA3E,YACE,kBAAM,MAAM,CAAC,SAQd;QAPC,KAAI,CAAC,OAAO,kCACP,KAAI,CAAC,OAAO,GACZ,UAAU,GACV,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,kCAAkC,CAC5C,CACF,CAAC;;IACJ,CAAC;IAED,uCAAO,GAAP,UAAQ,OAA0B;QAChC,OAAO,iCAAiC,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,6CAAa,GAAb,UAAc,MAAkC;QAC9C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,MAAM,EAAE,CAAC,mCAAmC,CAAC,MAAM,GAAG,CAAC;gBACzD,CAAC,CAAC,2BAA2B,CACzB,MAAM,EAAE,CAAC,mCAAmC,CAC7C;gBACH,CAAC,CAAC,MAAM,EAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,uBAAuB,CACrB,MAAM,EAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;IACH,4BAAC;AAAD,CAAC,AAjCD,CAAoC,oBAAoB,GAiCvD;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 { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n createExportMetricsServiceRequest,\n IExportMetricsServiceRequest,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPExporterNodeProxy extends OTLPExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceRequest\n> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(config);\n this.headers = {\n ...this.headers,\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS\n ),\n };\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics);\n }\n\n getDefaultUrl(config: OTLPExporterNodeConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0\n ? appendRootPathToUrlIfNeeded(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT\n )\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrl(\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT,\n DEFAULT_COLLECTOR_RESOURCE_PATH\n )\n : DEFAULT_COLLECTOR_URL;\n }\n}\n\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"]}
|
package/build/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.41.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.41.0';\n"]}
|
|
@@ -5,9 +5,10 @@ import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
|
|
|
5
5
|
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
|
|
7
7
|
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
|
|
8
|
+
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
|
|
8
9
|
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics, IExportMetricsServiceRequest>> implements PushMetricExporter {
|
|
9
10
|
_otlpExporter: T;
|
|
10
|
-
|
|
11
|
+
private _aggregationTemporalitySelector;
|
|
11
12
|
constructor(exporter: T, config?: OTLPMetricExporterOptions);
|
|
12
13
|
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
|
|
13
14
|
shutdown(): Promise<void>;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { getEnv } from '@opentelemetry/core';
|
|
17
17
|
import { AggregationTemporality, InstrumentType, } from '@opentelemetry/sdk-metrics';
|
|
18
|
+
import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
|
|
18
19
|
import { diag } from '@opentelemetry/api';
|
|
19
20
|
export const CumulativeTemporalitySelector = () => AggregationTemporality.CUMULATIVE;
|
|
20
21
|
export const DeltaTemporalitySelector = (instrumentType) => {
|
|
@@ -29,6 +30,18 @@ export const DeltaTemporalitySelector = (instrumentType) => {
|
|
|
29
30
|
return AggregationTemporality.CUMULATIVE;
|
|
30
31
|
}
|
|
31
32
|
};
|
|
33
|
+
export const LowMemoryTemporalitySelector = (instrumentType) => {
|
|
34
|
+
switch (instrumentType) {
|
|
35
|
+
case InstrumentType.COUNTER:
|
|
36
|
+
case InstrumentType.HISTOGRAM:
|
|
37
|
+
return AggregationTemporality.DELTA;
|
|
38
|
+
case InstrumentType.UP_DOWN_COUNTER:
|
|
39
|
+
case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
40
|
+
case InstrumentType.OBSERVABLE_COUNTER:
|
|
41
|
+
case InstrumentType.OBSERVABLE_GAUGE:
|
|
42
|
+
return AggregationTemporality.CUMULATIVE;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
32
45
|
function chooseTemporalitySelectorFromEnvironment() {
|
|
33
46
|
const env = getEnv();
|
|
34
47
|
const configuredTemporality = env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();
|
|
@@ -38,15 +51,21 @@ function chooseTemporalitySelectorFromEnvironment() {
|
|
|
38
51
|
if (configuredTemporality === 'delta') {
|
|
39
52
|
return DeltaTemporalitySelector;
|
|
40
53
|
}
|
|
54
|
+
if (configuredTemporality === 'lowmemory') {
|
|
55
|
+
return LowMemoryTemporalitySelector;
|
|
56
|
+
}
|
|
41
57
|
diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`);
|
|
42
58
|
return CumulativeTemporalitySelector;
|
|
43
59
|
}
|
|
44
60
|
function chooseTemporalitySelector(temporalityPreference) {
|
|
45
61
|
// Directly passed preference has priority.
|
|
46
62
|
if (temporalityPreference != null) {
|
|
47
|
-
if (temporalityPreference ===
|
|
63
|
+
if (temporalityPreference === AggregationTemporalityPreference.DELTA) {
|
|
48
64
|
return DeltaTemporalitySelector;
|
|
49
65
|
}
|
|
66
|
+
else if (temporalityPreference === AggregationTemporalityPreference.LOWMEMORY) {
|
|
67
|
+
return LowMemoryTemporalitySelector;
|
|
68
|
+
}
|
|
50
69
|
return CumulativeTemporalitySelector;
|
|
51
70
|
}
|
|
52
71
|
return chooseTemporalitySelectorFromEnvironment();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAEtB,cAAc,GAGf,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"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","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 { ExportResult, getEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';\nimport { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const env = getEnv();\n const configuredTemporality =\n env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nexport class OTLPMetricExporterBase<\n T extends OTLPExporterBase<\n OTLPMetricExporterOptions,\n ResourceMetrics,\n IExportMetricsServiceRequest\n >\n> implements PushMetricExporter\n{\n public _otlpExporter: T;\n private _aggregationTemporalitySelector: AggregationTemporalitySelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n export(\n metrics: ResourceMetrics,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._otlpExporter.export([metrics], resultCallback);\n }\n\n async shutdown(): Promise<void> {\n await this._otlpExporter.shutdown();\n }\n\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
2
1
|
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
2
|
+
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
3
3
|
export interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {
|
|
4
|
-
temporalityPreference?: AggregationTemporality;
|
|
4
|
+
temporalityPreference?: AggregationTemporalityPreference | AggregationTemporality;
|
|
5
|
+
}
|
|
6
|
+
export declare enum AggregationTemporalityPreference {
|
|
7
|
+
DELTA = 0,
|
|
8
|
+
CUMULATIVE = 1,
|
|
9
|
+
LOWMEMORY = 2
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=OTLPMetricExporterOptions.d.ts.map
|
|
@@ -13,5 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export var AggregationTemporalityPreference;
|
|
17
|
+
(function (AggregationTemporalityPreference) {
|
|
18
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["DELTA"] = 0] = "DELTA";
|
|
19
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["CUMULATIVE"] = 1] = "CUMULATIVE";
|
|
20
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["LOWMEMORY"] = 2] = "LOWMEMORY";
|
|
21
|
+
})(AggregationTemporalityPreference || (AggregationTemporalityPreference = {}));
|
|
17
22
|
//# sourceMappingURL=OTLPMetricExporterOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 {
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","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 { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { AggregationTemporality } from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.41.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.41.0';\n"]}
|
|
@@ -5,9 +5,10 @@ import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
|
|
|
5
5
|
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
6
6
|
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
|
|
7
7
|
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
|
|
8
|
+
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
|
|
8
9
|
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics, IExportMetricsServiceRequest>> implements PushMetricExporter {
|
|
9
10
|
_otlpExporter: T;
|
|
10
|
-
|
|
11
|
+
private _aggregationTemporalitySelector;
|
|
11
12
|
constructor(exporter: T, config?: OTLPMetricExporterOptions);
|
|
12
13
|
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
|
|
13
14
|
shutdown(): Promise<void>;
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.OTLPMetricExporterBase = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = void 0;
|
|
18
|
+
exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = void 0;
|
|
19
19
|
const core_1 = require("@opentelemetry/core");
|
|
20
20
|
const sdk_metrics_1 = require("@opentelemetry/sdk-metrics");
|
|
21
|
+
const OTLPMetricExporterOptions_1 = require("./OTLPMetricExporterOptions");
|
|
21
22
|
const api_1 = require("@opentelemetry/api");
|
|
22
23
|
const CumulativeTemporalitySelector = () => sdk_metrics_1.AggregationTemporality.CUMULATIVE;
|
|
23
24
|
exports.CumulativeTemporalitySelector = CumulativeTemporalitySelector;
|
|
@@ -34,6 +35,19 @@ const DeltaTemporalitySelector = (instrumentType) => {
|
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
exports.DeltaTemporalitySelector = DeltaTemporalitySelector;
|
|
38
|
+
const LowMemoryTemporalitySelector = (instrumentType) => {
|
|
39
|
+
switch (instrumentType) {
|
|
40
|
+
case sdk_metrics_1.InstrumentType.COUNTER:
|
|
41
|
+
case sdk_metrics_1.InstrumentType.HISTOGRAM:
|
|
42
|
+
return sdk_metrics_1.AggregationTemporality.DELTA;
|
|
43
|
+
case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER:
|
|
44
|
+
case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
45
|
+
case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER:
|
|
46
|
+
case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE:
|
|
47
|
+
return sdk_metrics_1.AggregationTemporality.CUMULATIVE;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.LowMemoryTemporalitySelector = LowMemoryTemporalitySelector;
|
|
37
51
|
function chooseTemporalitySelectorFromEnvironment() {
|
|
38
52
|
const env = (0, core_1.getEnv)();
|
|
39
53
|
const configuredTemporality = env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();
|
|
@@ -43,15 +57,21 @@ function chooseTemporalitySelectorFromEnvironment() {
|
|
|
43
57
|
if (configuredTemporality === 'delta') {
|
|
44
58
|
return exports.DeltaTemporalitySelector;
|
|
45
59
|
}
|
|
60
|
+
if (configuredTemporality === 'lowmemory') {
|
|
61
|
+
return exports.LowMemoryTemporalitySelector;
|
|
62
|
+
}
|
|
46
63
|
api_1.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`);
|
|
47
64
|
return exports.CumulativeTemporalitySelector;
|
|
48
65
|
}
|
|
49
66
|
function chooseTemporalitySelector(temporalityPreference) {
|
|
50
67
|
// Directly passed preference has priority.
|
|
51
68
|
if (temporalityPreference != null) {
|
|
52
|
-
if (temporalityPreference ===
|
|
69
|
+
if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.DELTA) {
|
|
53
70
|
return exports.DeltaTemporalitySelector;
|
|
54
71
|
}
|
|
72
|
+
else if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.LOWMEMORY) {
|
|
73
|
+
return exports.LowMemoryTemporalitySelector;
|
|
74
|
+
}
|
|
55
75
|
return exports.CumulativeTemporalitySelector;
|
|
56
76
|
}
|
|
57
77
|
return chooseTemporalitySelectorFromEnvironment();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAA2D;AAC3D,4DAMoC;
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"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","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 { ExportResult, getEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';\nimport { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const env = getEnv();\n const configuredTemporality =\n env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nexport class OTLPMetricExporterBase<\n T extends OTLPExporterBase<\n OTLPMetricExporterOptions,\n ResourceMetrics,\n IExportMetricsServiceRequest\n >\n> implements PushMetricExporter\n{\n public _otlpExporter: T;\n private _aggregationTemporalitySelector: AggregationTemporalitySelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n export(\n metrics: ResourceMetrics,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._otlpExporter.export([metrics], resultCallback);\n }\n\n async shutdown(): Promise<void> {\n await this._otlpExporter.shutdown();\n }\n\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
2
1
|
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
2
|
+
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
|
|
3
3
|
export interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {
|
|
4
|
-
temporalityPreference?: AggregationTemporality;
|
|
4
|
+
temporalityPreference?: AggregationTemporalityPreference | AggregationTemporality;
|
|
5
|
+
}
|
|
6
|
+
export declare enum AggregationTemporalityPreference {
|
|
7
|
+
DELTA = 0,
|
|
8
|
+
CUMULATIVE = 1,
|
|
9
|
+
LOWMEMORY = 2
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=OTLPMetricExporterOptions.d.ts.map
|
|
@@ -15,4 +15,11 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AggregationTemporalityPreference = void 0;
|
|
19
|
+
var AggregationTemporalityPreference;
|
|
20
|
+
(function (AggregationTemporalityPreference) {
|
|
21
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["DELTA"] = 0] = "DELTA";
|
|
22
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["CUMULATIVE"] = 1] = "CUMULATIVE";
|
|
23
|
+
AggregationTemporalityPreference[AggregationTemporalityPreference["LOWMEMORY"] = 2] = "LOWMEMORY";
|
|
24
|
+
})(AggregationTemporalityPreference = exports.AggregationTemporalityPreference || (exports.AggregationTemporalityPreference = {}));
|
|
18
25
|
//# sourceMappingURL=OTLPMetricExporterOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 {
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAWH,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,GAAhC,wCAAgC,KAAhC,wCAAgC,QAI3C","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 { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { AggregationTemporality } from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
|
package/build/src/index.js
CHANGED
|
@@ -14,18 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
-
__exportStar(require("./
|
|
30
|
-
__exportStar(require("./
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./platform"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./OTLPMetricExporterOptions"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./OTLPMetricExporterBase"), exports);
|
|
31
22
|
//# sourceMappingURL=index.js.map
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0DAA2B;AAC3B,2EAA4C;AAC5C,wEAAyC","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"]}
|
|
@@ -14,16 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./OTLPMetricExporter"), exports);
|
|
29
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,oEAAqC","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"]}
|
|
@@ -14,16 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./node"), exports);
|
|
29
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sDAAuB","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"]}
|
|
@@ -14,16 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./OTLPMetricExporter"), exports);
|
|
29
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,oEAAqC","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"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.41.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.41.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.41.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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:browser": "nyc karma start --single-run",
|
|
27
27
|
"version": "node ../../../scripts/version-update.js",
|
|
28
28
|
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
29
|
-
"precompile": "lerna run version --scope $
|
|
29
|
+
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
|
30
30
|
"prewatch": "npm run precompile",
|
|
31
31
|
"peer-api-check": "node ../../../scripts/peer-api-check.js",
|
|
32
32
|
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../"
|
|
@@ -63,43 +63,46 @@
|
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@babel/core": "7.
|
|
66
|
+
"@babel/core": "7.22.6",
|
|
67
67
|
"@opentelemetry/api": "1.4.1",
|
|
68
|
-
"@types/mocha": "10.0.
|
|
68
|
+
"@types/mocha": "10.0.1",
|
|
69
69
|
"@types/node": "18.6.5",
|
|
70
|
-
"@types/sinon": "10.0.
|
|
70
|
+
"@types/sinon": "10.0.15",
|
|
71
71
|
"@types/webpack-env": "1.16.3",
|
|
72
|
-
"babel-loader": "8.
|
|
72
|
+
"babel-loader": "8.3.0",
|
|
73
73
|
"codecov": "3.8.3",
|
|
74
74
|
"cpx": "1.5.0",
|
|
75
|
+
"cross-var": "1.1.0",
|
|
75
76
|
"istanbul-instrumenter-loader": "3.0.1",
|
|
76
|
-
"karma": "6.
|
|
77
|
+
"karma": "6.4.2",
|
|
77
78
|
"karma-chrome-launcher": "3.1.0",
|
|
78
79
|
"karma-coverage-istanbul-reporter": "3.0.3",
|
|
79
80
|
"karma-mocha": "2.0.1",
|
|
80
|
-
"karma-spec-reporter": "0.0.
|
|
81
|
+
"karma-spec-reporter": "0.0.36",
|
|
81
82
|
"karma-webpack": "4.0.2",
|
|
82
|
-
"
|
|
83
|
+
"lerna": "7.1.1",
|
|
84
|
+
"mocha": "10.2.0",
|
|
83
85
|
"nyc": "15.1.0",
|
|
84
|
-
"sinon": "15.
|
|
86
|
+
"sinon": "15.1.2",
|
|
85
87
|
"ts-loader": "8.4.0",
|
|
86
88
|
"ts-mocha": "10.0.0",
|
|
87
89
|
"typescript": "4.4.4",
|
|
88
90
|
"webpack": "4.46.0",
|
|
89
|
-
"webpack-cli": "4.
|
|
90
|
-
"webpack-merge": "5.
|
|
91
|
+
"webpack-cli": "4.10.0",
|
|
92
|
+
"webpack-merge": "5.9.0"
|
|
91
93
|
},
|
|
92
94
|
"peerDependencies": {
|
|
93
95
|
"@opentelemetry/api": "^1.3.0"
|
|
94
96
|
},
|
|
95
97
|
"dependencies": {
|
|
96
|
-
"@opentelemetry/core": "1.
|
|
97
|
-
"@opentelemetry/otlp-exporter-base": "0.
|
|
98
|
-
"@opentelemetry/otlp-transformer": "0.
|
|
99
|
-
"@opentelemetry/resources": "1.
|
|
100
|
-
"@opentelemetry/sdk-metrics": "1.
|
|
98
|
+
"@opentelemetry/core": "1.15.0",
|
|
99
|
+
"@opentelemetry/otlp-exporter-base": "0.41.0",
|
|
100
|
+
"@opentelemetry/otlp-transformer": "0.41.0",
|
|
101
|
+
"@opentelemetry/resources": "1.15.0",
|
|
102
|
+
"@opentelemetry/sdk-metrics": "1.15.0",
|
|
103
|
+
"tslib": "^2.3.1"
|
|
101
104
|
},
|
|
102
105
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http",
|
|
103
106
|
"sideEffects": false,
|
|
104
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "06e919d6c909e8cc8e28b6624d9843f401d9b059"
|
|
105
108
|
}
|