@opentelemetry/exporter-metrics-otlp-http 0.49.0 → 0.50.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/OTLPMetricExporterBase.js +2 -0
- package/build/esm/OTLPMetricExporterBase.js.map +1 -1
- package/build/esm/platform/node/OTLPMetricExporter.js +2 -2
- 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.js +2 -0
- package/build/esnext/OTLPMetricExporterBase.js.map +1 -1
- package/build/esnext/platform/node/OTLPMetricExporter.js +2 -2
- package/build/esnext/platform/node/OTLPMetricExporter.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.js +2 -0
- package/build/src/OTLPMetricExporterBase.js.map +1 -1
- package/build/src/platform/node/OTLPMetricExporter.js +1 -1
- package/build/src/platform/node/OTLPMetricExporter.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 +7 -7
|
@@ -58,6 +58,7 @@ export var DeltaTemporalitySelector = function (instrumentType) {
|
|
|
58
58
|
switch (instrumentType) {
|
|
59
59
|
case InstrumentType.COUNTER:
|
|
60
60
|
case InstrumentType.OBSERVABLE_COUNTER:
|
|
61
|
+
case InstrumentType.GAUGE:
|
|
61
62
|
case InstrumentType.HISTOGRAM:
|
|
62
63
|
case InstrumentType.OBSERVABLE_GAUGE:
|
|
63
64
|
return AggregationTemporality.DELTA;
|
|
@@ -71,6 +72,7 @@ export var LowMemoryTemporalitySelector = function (instrumentType) {
|
|
|
71
72
|
case InstrumentType.COUNTER:
|
|
72
73
|
case InstrumentType.HISTOGRAM:
|
|
73
74
|
return AggregationTemporality.DELTA;
|
|
75
|
+
case InstrumentType.GAUGE:
|
|
74
76
|
case InstrumentType.UP_DOWN_COUNTER:
|
|
75
77
|
case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
76
78
|
case InstrumentType.OBSERVABLE_COUNTER:
|
|
@@ -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,EAGd,WAAW,GAEZ,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,sBA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AW,CAAC,OAAO,EAAE,EAArB,CAAqB,CAAC;KACxD;AACH,CAAC;AAED;IAYE,gCAAY,QAAW,EAAE,MAAkC;QACzD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,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,kDAAiB,GAAjB,UAAkB,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,6DAA4B,GAA5B,UACE,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IACH,6BAAC;AAAD,CAAC,AA5CD,IA4CC","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 Aggregation,\n AggregationSelector,\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\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n) {\n if (config?.aggregationPreference) {\n return config.aggregationPreference;\n } else {\n return (_instrumentType: any) => Aggregation.Default();\n }\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 private _aggregationSelector: AggregationSelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationSelector = chooseAggregationSelector(config);\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 selectAggregation(instrumentType: InstrumentType): Aggregation {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
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,EAGd,WAAW,GAEZ,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,KAAK,CAAC;QAC1B,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,KAAK,CAAC;QAC1B,KAAK,cAA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C;KACxD;AACH,CAAC;AAED;IAYE,gCAAY,QAAW,EAAE,MAAkC;QACzD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,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,kDAAiB,GAAjB,UAAkB,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,6DAA4B,GAA5B,UACE,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IACH,6BAAC;AAAD,CAAC,AA5CD,IA4CC","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 Aggregation,\n AggregationSelector,\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.GAUGE:\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.GAUGE:\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\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n) {\n if (config?.aggregationPreference) {\n return config.aggregationPreference;\n } else {\n return (_instrumentType: any) => Aggregation.Default();\n }\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 private _aggregationSelector: AggregationSelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationSelector = chooseAggregationSelector(config);\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 selectAggregation(instrumentType: InstrumentType): Aggregation {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -41,7 +41,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
41
41
|
};
|
|
42
42
|
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
43
43
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
44
|
-
import { OTLPExporterNodeBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
|
|
44
|
+
import { OTLPExporterNodeBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, parseHeaders, } from '@opentelemetry/otlp-exporter-base';
|
|
45
45
|
import { createExportMetricsServiceRequest, } from '@opentelemetry/otlp-transformer';
|
|
46
46
|
import { VERSION } from '../../version';
|
|
47
47
|
var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
@@ -53,7 +53,7 @@ var OTLPExporterNodeProxy = /** @class */ (function (_super) {
|
|
|
53
53
|
__extends(OTLPExporterNodeProxy, _super);
|
|
54
54
|
function OTLPExporterNodeProxy(config) {
|
|
55
55
|
var _this = _super.call(this, config) || this;
|
|
56
|
-
_this.headers = __assign(__assign(__assign(__assign({}, _this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), config === null || config === void 0 ? void 0 : config.headers);
|
|
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
57
|
return _this;
|
|
58
58
|
}
|
|
59
59
|
OTLPExporterNodeProxy.prototype.convert = function (metrics) {
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAC3B,YAAY,GACb,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,SASd;QARC,KAAI,CAAC,OAAO,2CACP,KAAI,CAAC,OAAO,GACZ,UAAU,GACV,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,kCAAkC,CAC5C,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;;IACJ,CAAC;IAED,uCAAO,GAAP,UAAQ,OAA0B;QAChC,OAAO,iCAAiC,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,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,AAlCD,CAAoC,oBAAoB,GAkCvD;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 parseHeaders,\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 ...parseHeaders(config?.headers),\n };\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics, { useLongBits: false });\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.50.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.50.0';\n"]}
|
|
@@ -22,6 +22,7 @@ export const DeltaTemporalitySelector = (instrumentType) => {
|
|
|
22
22
|
switch (instrumentType) {
|
|
23
23
|
case InstrumentType.COUNTER:
|
|
24
24
|
case InstrumentType.OBSERVABLE_COUNTER:
|
|
25
|
+
case InstrumentType.GAUGE:
|
|
25
26
|
case InstrumentType.HISTOGRAM:
|
|
26
27
|
case InstrumentType.OBSERVABLE_GAUGE:
|
|
27
28
|
return AggregationTemporality.DELTA;
|
|
@@ -35,6 +36,7 @@ export const LowMemoryTemporalitySelector = (instrumentType) => {
|
|
|
35
36
|
case InstrumentType.COUNTER:
|
|
36
37
|
case InstrumentType.HISTOGRAM:
|
|
37
38
|
return AggregationTemporality.DELTA;
|
|
39
|
+
case InstrumentType.GAUGE:
|
|
38
40
|
case InstrumentType.UP_DOWN_COUNTER:
|
|
39
41
|
case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
40
42
|
case InstrumentType.OBSERVABLE_COUNTER:
|
|
@@ -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,EAGd,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,cAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,cAAc,CAAC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AAC,CAAC;IAC9D,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 { ExportResult, getEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n Aggregation,\n AggregationSelector,\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\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n) {\n if (config?.aggregationPreference) {\n return config.aggregationPreference;\n } else {\n return (_instrumentType: any) => Aggregation.Default();\n }\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 private _aggregationSelector: AggregationSelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationSelector = chooseAggregationSelector(config);\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 selectAggregation(instrumentType: InstrumentType): Aggregation {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
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,EAGd,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,cAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,cAAc,CAAC,kBAAkB,CAAC;QACvC,KAAK,cAAc,CAAC,KAAK,CAAC;QAC1B,KAAK,cAAc,CAAC,SAAS,CAAC;QAC9B,KAAK,cAAc,CAAC,gBAAgB;YAClC,OAAO,sBAAsB,CAAC,KAAK,CAAC;QACtC,KAAK,cAAc,CAAC,eAAe,CAAC;QACpC,KAAK,cAA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;YACA,OAAO,4BAA4B,CAAC;SACrC;QACD,OAAO,6BAA6B,CAAC;KACtC;IAED,OAAO,wCAAwC,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,yBAAyB,CAChC,MAA6C;IAE7C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,EAAE;QACjC,OAAO,MAAM,CAAC,qBAAqB,CAAC;KACrC;SAAM;QACL,OAAO,CAAC,eAAoB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;KACxD;AACH,CAAC;AAED,MAAM,OAAO,sBAAsB;IAYjC,YAAY,QAAW,EAAE,MAAkC;QACzD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,MAAM,CACJ,OAAwB,EACxB,cAA8C;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,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 { ExportResult, getEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n Aggregation,\n AggregationSelector,\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.GAUGE:\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.GAUGE:\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\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n) {\n if (config?.aggregationPreference) {\n return config.aggregationPreference;\n } else {\n return (_instrumentType: any) => Aggregation.Default();\n }\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 private _aggregationSelector: AggregationSelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationSelector = chooseAggregationSelector(config);\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 selectAggregation(instrumentType: InstrumentType): Aggregation {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { getEnv, baggageUtils } from '@opentelemetry/core';
|
|
17
17
|
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
|
|
18
|
-
import { OTLPExporterNodeBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, } from '@opentelemetry/otlp-exporter-base';
|
|
18
|
+
import { OTLPExporterNodeBase, appendResourcePathToUrl, appendRootPathToUrlIfNeeded, parseHeaders, } from '@opentelemetry/otlp-exporter-base';
|
|
19
19
|
import { createExportMetricsServiceRequest, } from '@opentelemetry/otlp-transformer';
|
|
20
20
|
import { VERSION } from '../../version';
|
|
21
21
|
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
|
|
@@ -26,7 +26,7 @@ const USER_AGENT = {
|
|
|
26
26
|
class OTLPExporterNodeProxy extends OTLPExporterNodeBase {
|
|
27
27
|
constructor(config) {
|
|
28
28
|
super(config);
|
|
29
|
-
this.headers = Object.assign(Object.assign(Object.assign(Object.assign({}, this.headers), USER_AGENT), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), config === null || config === void 0 ? void 0 : config.headers);
|
|
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
30
|
}
|
|
31
31
|
convert(metrics) {
|
|
32
32
|
return createExportMetricsServiceRequest(metrics, { useLongBits: false });
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAC3B,YAAY,GACb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iCAAiC,GAElC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AACzF,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,OAAO,EAAE;CACzD,CAAC;AAEF,MAAM,qBAAsB,SAAQ,oBAGnC;IACC,YAAY,MAA+D;QACzE,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,+DACP,IAAI,CAAC,OAAO,GACZ,UAAU,GACV,YAAY,CAAC,uBAAuB,CACrC,MAAM,EAAE,CAAC,kCAAkC,CAC5C,GACE,YAAY,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,OAA0B;QAChC,OAAO,iCAAiC,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,aAAa,CAAC,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;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 { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n parseHeaders,\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 ...parseHeaders(config?.headers),\n };\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics, { useLongBits: false });\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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.50.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.50.0';\n"]}
|
|
@@ -26,6 +26,7 @@ const DeltaTemporalitySelector = (instrumentType) => {
|
|
|
26
26
|
switch (instrumentType) {
|
|
27
27
|
case sdk_metrics_1.InstrumentType.COUNTER:
|
|
28
28
|
case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER:
|
|
29
|
+
case sdk_metrics_1.InstrumentType.GAUGE:
|
|
29
30
|
case sdk_metrics_1.InstrumentType.HISTOGRAM:
|
|
30
31
|
case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE:
|
|
31
32
|
return sdk_metrics_1.AggregationTemporality.DELTA;
|
|
@@ -40,6 +41,7 @@ const LowMemoryTemporalitySelector = (instrumentType) => {
|
|
|
40
41
|
case sdk_metrics_1.InstrumentType.COUNTER:
|
|
41
42
|
case sdk_metrics_1.InstrumentType.HISTOGRAM:
|
|
42
43
|
return sdk_metrics_1.AggregationTemporality.DELTA;
|
|
44
|
+
case sdk_metrics_1.InstrumentType.GAUGE:
|
|
43
45
|
case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER:
|
|
44
46
|
case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
|
|
45
47
|
case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAA2D;AAC3D,4DAQoC;AACpC,2EAGqC;AAGrC,4CAA0C;AAEnC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,oCAAsB,CAAC,UAAU,CAAC;AAD7B,QAAA,6BAA6B,iCACA;AAEnC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,4BAAc,CAAC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AAC,qBAAqB,CAAC;KACrC;SAAM;QACL,OAAO,CAAC,eAAoB,EAAE,EAAE,CAAC,yBAAW,CAAC,OAAO,EAAE,CAAC;KACxD;AACH,CAAC;AAED,MAAa,sBAAsB;IAYjC,YAAY,QAAW,EAAE,MAAkC;QACzD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,MAAM,CACJ,OAAwB,EACxB,cAA8C;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;AA5CD,wDA4CC","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 Aggregation,\n AggregationSelector,\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.GAUGE:\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.GAUGE:\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\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n) {\n if (config?.aggregationPreference) {\n return config.aggregationPreference;\n } else {\n return (_instrumentType: any) => Aggregation.Default();\n }\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 private _aggregationSelector: AggregationSelector;\n\n constructor(exporter: T, config?: OTLPMetricExporterOptions) {\n this._otlpExporter = exporter;\n this._aggregationSelector = chooseAggregationSelector(config);\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 selectAggregation(instrumentType: InstrumentType): Aggregation {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
|
|
@@ -29,7 +29,7 @@ const USER_AGENT = {
|
|
|
29
29
|
class OTLPExporterNodeProxy extends otlp_exporter_base_1.OTLPExporterNodeBase {
|
|
30
30
|
constructor(config) {
|
|
31
31
|
super(config);
|
|
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)), config === null || config === void 0 ? void 0 : config.headers);
|
|
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
33
|
}
|
|
34
34
|
convert(metrics) {
|
|
35
35
|
return (0, otlp_transformer_1.createExportMetricsServiceRequest)(metrics, { useLongBits: false });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAE3D,yEAAsE;AACtE,
|
|
1
|
+
{"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8CAA2D;AAE3D,yEAAsE;AACtE,0EAM2C;AAC3C,sEAGyC;AACzC,2CAAwC;AAExC,MAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,MAAM,qBAAqB,GAAG,yBAAyB,+BAA+B,EAAE,CAAC;AACzF,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,iBAAO,EAAE;CACzD,CAAC;AAEF,MAAM,qBAAsB,SAAQ,yCAGnC;IACC,YAAY,MAA+D;QACzE,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,+DACP,IAAI,CAAC,OAAO,GACZ,UAAU,GACV,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAC5C,GACE,IAAA,iCAAY,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,OAA0B;QAChC,OAAO,IAAA,oDAAiC,EAAC,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,mCAAmC,CAAC,MAAM,GAAG,CAAC;gBACzD,CAAC,CAAC,IAAA,gDAA2B,EACzB,IAAA,aAAM,GAAE,CAAC,mCAAmC,CAC7C;gBACH,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,IAAA,4CAAuB,EACrB,IAAA,aAAM,GAAE,CAAC,2BAA2B,EACpC,+BAA+B,CAChC;oBACH,CAAC,CAAC,qBAAqB,CAAC;IAC5B,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 { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n appendResourcePathToUrl,\n appendRootPathToUrlIfNeeded,\n parseHeaders,\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 ...parseHeaders(config?.headers),\n };\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics, { useLongBits: false });\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/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.50.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.50.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.50.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",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"@opentelemetry/api": "^1.3.0"
|
|
97
97
|
},
|
|
98
98
|
"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.
|
|
99
|
+
"@opentelemetry/core": "1.23.0",
|
|
100
|
+
"@opentelemetry/otlp-exporter-base": "0.50.0",
|
|
101
|
+
"@opentelemetry/otlp-transformer": "0.50.0",
|
|
102
|
+
"@opentelemetry/resources": "1.23.0",
|
|
103
|
+
"@opentelemetry/sdk-metrics": "1.23.0"
|
|
104
104
|
},
|
|
105
105
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http",
|
|
106
106
|
"sideEffects": false,
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "5231aa255047fbc6ee3d6a299f4423ab2f8a5fbc"
|
|
108
108
|
}
|