@opentelemetry/exporter-metrics-otlp-http 0.55.0 → 0.57.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.
Files changed (73) hide show
  1. package/build/esm/OTLPMetricExporterBase.d.ts +5 -10
  2. package/build/esm/OTLPMetricExporterBase.js +24 -60
  3. package/build/esm/OTLPMetricExporterBase.js.map +1 -1
  4. package/build/esm/index.d.ts +3 -3
  5. package/build/esm/index.js +3 -6
  6. package/build/esm/index.js.map +1 -1
  7. package/build/esm/platform/browser/OTLPMetricExporter.d.ts +2 -8
  8. package/build/esm/platform/browser/OTLPMetricExporter.js +3 -11
  9. package/build/esm/platform/browser/OTLPMetricExporter.js.map +1 -1
  10. package/build/esm/platform/browser/index.d.ts +1 -1
  11. package/build/esm/platform/browser/index.js +1 -4
  12. package/build/esm/platform/browser/index.js.map +1 -1
  13. package/build/esm/platform/index.d.ts +1 -1
  14. package/build/esm/platform/index.js +1 -4
  15. package/build/esm/platform/index.js.map +1 -1
  16. package/build/esm/platform/node/OTLPMetricExporter.d.ts +3 -9
  17. package/build/esm/platform/node/OTLPMetricExporter.js +4 -11
  18. package/build/esm/platform/node/OTLPMetricExporter.js.map +1 -1
  19. package/build/esm/platform/node/index.d.ts +1 -1
  20. package/build/esm/platform/node/index.js +1 -4
  21. package/build/esm/platform/node/index.js.map +1 -1
  22. package/build/esm/version.d.ts +1 -1
  23. package/build/esm/version.js +1 -1
  24. package/build/esm/version.js.map +1 -1
  25. package/build/esnext/OTLPMetricExporterBase.d.ts +5 -10
  26. package/build/esnext/OTLPMetricExporterBase.js +4 -12
  27. package/build/esnext/OTLPMetricExporterBase.js.map +1 -1
  28. package/build/esnext/index.d.ts +3 -3
  29. package/build/esnext/index.js +3 -6
  30. package/build/esnext/index.js.map +1 -1
  31. package/build/esnext/platform/browser/OTLPMetricExporter.d.ts +2 -8
  32. package/build/esnext/platform/browser/OTLPMetricExporter.js +3 -9
  33. package/build/esnext/platform/browser/OTLPMetricExporter.js.map +1 -1
  34. package/build/esnext/platform/browser/index.d.ts +1 -1
  35. package/build/esnext/platform/browser/index.js +1 -4
  36. package/build/esnext/platform/browser/index.js.map +1 -1
  37. package/build/esnext/platform/index.d.ts +1 -1
  38. package/build/esnext/platform/index.js +1 -4
  39. package/build/esnext/platform/index.js.map +1 -1
  40. package/build/esnext/platform/node/OTLPMetricExporter.d.ts +3 -9
  41. package/build/esnext/platform/node/OTLPMetricExporter.js +4 -9
  42. package/build/esnext/platform/node/OTLPMetricExporter.js.map +1 -1
  43. package/build/esnext/platform/node/index.d.ts +1 -1
  44. package/build/esnext/platform/node/index.js +1 -4
  45. package/build/esnext/platform/node/index.js.map +1 -1
  46. package/build/esnext/version.d.ts +1 -1
  47. package/build/esnext/version.js +1 -1
  48. package/build/esnext/version.js.map +1 -1
  49. package/build/src/OTLPMetricExporterBase.d.ts +5 -10
  50. package/build/src/OTLPMetricExporterBase.js +4 -12
  51. package/build/src/OTLPMetricExporterBase.js.map +1 -1
  52. package/build/src/index.d.ts +3 -3
  53. package/build/src/index.js +10 -16
  54. package/build/src/index.js.map +1 -1
  55. package/build/src/platform/browser/OTLPMetricExporter.d.ts +2 -8
  56. package/build/src/platform/browser/OTLPMetricExporter.js +2 -8
  57. package/build/src/platform/browser/OTLPMetricExporter.js.map +1 -1
  58. package/build/src/platform/browser/index.d.ts +1 -1
  59. package/build/src/platform/browser/index.js +3 -14
  60. package/build/src/platform/browser/index.js.map +1 -1
  61. package/build/src/platform/index.d.ts +1 -1
  62. package/build/src/platform/index.js +3 -14
  63. package/build/src/platform/index.js.map +1 -1
  64. package/build/src/platform/node/OTLPMetricExporter.d.ts +3 -9
  65. package/build/src/platform/node/OTLPMetricExporter.js +3 -8
  66. package/build/src/platform/node/OTLPMetricExporter.js.map +1 -1
  67. package/build/src/platform/node/index.d.ts +1 -1
  68. package/build/src/platform/node/index.js +3 -14
  69. package/build/src/platform/node/index.js.map +1 -1
  70. package/build/src/version.d.ts +1 -1
  71. package/build/src/version.js +1 -1
  72. package/build/src/version.js.map +1 -1
  73. package/package.json +8 -8
@@ -1,18 +1,13 @@
1
- import { ExportResult } from '@opentelemetry/core';
2
1
  import { AggregationTemporality, AggregationTemporalitySelector, InstrumentType, PushMetricExporter, ResourceMetrics, Aggregation } from '@opentelemetry/sdk-metrics';
3
2
  import { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
4
- import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { IOtlpExportDelegate, OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
5
4
  export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
6
5
  export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
7
6
  export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
8
- export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics>> implements PushMetricExporter {
9
- _otlpExporter: T;
10
- private _aggregationTemporalitySelector;
11
- private _aggregationSelector;
12
- constructor(exporter: T, config?: OTLPMetricExporterOptions);
13
- export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
14
- shutdown(): Promise<void>;
15
- forceFlush(): Promise<void>;
7
+ export declare class OTLPMetricExporterBase extends OTLPExporterBase<ResourceMetrics> implements PushMetricExporter {
8
+ private readonly _aggregationTemporalitySelector;
9
+ private readonly _aggregationSelector;
10
+ constructor(delegate: IOtlpExportDelegate<ResourceMetrics>, config?: OTLPMetricExporterOptions);
16
11
  selectAggregation(instrumentType: InstrumentType): Aggregation;
17
12
  selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;
18
13
  }
@@ -13,45 +13,25 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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
+ var __extends = (this && this.__extends) || (function () {
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
+ })();
52
31
  import { getEnv } from '@opentelemetry/core';
53
32
  import { AggregationTemporality, InstrumentType, Aggregation, } from '@opentelemetry/sdk-metrics';
54
33
  import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
34
+ import { OTLPExporterBase, } from '@opentelemetry/otlp-exporter-base';
55
35
  import { diag } from '@opentelemetry/api';
56
36
  export var CumulativeTemporalitySelector = function () { return AggregationTemporality.CUMULATIVE; };
57
37
  export var DeltaTemporalitySelector = function (instrumentType) {
@@ -116,30 +96,14 @@ function chooseAggregationSelector(config) {
116
96
  return function (_instrumentType) { return Aggregation.Default(); };
117
97
  }
118
98
  }
119
- var OTLPMetricExporterBase = /** @class */ (function () {
120
- function OTLPMetricExporterBase(exporter, config) {
121
- this._otlpExporter = exporter;
122
- this._aggregationSelector = chooseAggregationSelector(config);
123
- this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
99
+ var OTLPMetricExporterBase = /** @class */ (function (_super) {
100
+ __extends(OTLPMetricExporterBase, _super);
101
+ function OTLPMetricExporterBase(delegate, config) {
102
+ var _this = _super.call(this, delegate) || this;
103
+ _this._aggregationSelector = chooseAggregationSelector(config);
104
+ _this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
105
+ return _this;
124
106
  }
125
- OTLPMetricExporterBase.prototype.export = function (metrics, resultCallback) {
126
- this._otlpExporter.export([metrics], resultCallback);
127
- };
128
- OTLPMetricExporterBase.prototype.shutdown = function () {
129
- return __awaiter(this, void 0, void 0, function () {
130
- return __generator(this, function (_a) {
131
- switch (_a.label) {
132
- case 0: return [4 /*yield*/, this._otlpExporter.shutdown()];
133
- case 1:
134
- _a.sent();
135
- return [2 /*return*/];
136
- }
137
- });
138
- });
139
- };
140
- OTLPMetricExporterBase.prototype.forceFlush = function () {
141
- return Promise.resolve();
142
- };
143
107
  OTLPMetricExporterBase.prototype.selectAggregation = function (instrumentType) {
144
108
  return this._aggregationSelector(instrumentType);
145
109
  };
@@ -147,6 +111,6 @@ var OTLPMetricExporterBase = /** @class */ (function () {
147
111
  return this._aggregationTemporalitySelector(instrumentType);
148
112
  };
149
113
  return OTLPMetricExporterBase;
150
- }());
114
+ }(OTLPExporterBase));
151
115
  export { OTLPMetricExporterBase };
152
116
  //# sourceMappingURL=OTLPMetricExporterBase.js.map
@@ -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;AAErC,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,cAA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Ac,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,AAxCD,IAwCC","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 { 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<OTLPMetricExporterOptions, ResourceMetrics>,\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,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EAEtB,cAAc,EAGd,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,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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qB,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,SAAS,yBAAyB,CAChC,MAA6C;IAE7C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,EAAE;QACjC,OAAO,MAAM,CAAC,qBAAqB,CAAC;KACrC;SAAM;QACL,OAAO,UAAC,eAAoB,IAAK,OAAA,WAAW,CAAC,OAAO,EAAE,EAArB,CAAqB,CAAC;KACxD;AACH,CAAC;AAED;IACU,0CAAiC;IAMzC,gCACE,QAA8C,EAC9C,MAAkC;QAFpC,YAIE,kBAAM,QAAQ,CAAC,SAKhB;QAJC,KAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,KAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,CAC9B,CAAC;;IACJ,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,AA3BD,CACU,gBAAgB,GA0BzB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getEnv } from '@opentelemetry/core';\nimport {\n 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 {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\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 extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\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,4 +1,4 @@
1
- export * from './platform';
2
- export * from './OTLPMetricExporterOptions';
3
- export * from './OTLPMetricExporterBase';
1
+ export { OTLPMetricExporter } from './platform';
2
+ export { OTLPMetricExporterOptions, AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
3
+ export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -13,10 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
17
- * TODO: Replace export * with named exports before next major version
18
- */
19
- export * from './platform';
20
- export * from './OTLPMetricExporterOptions';
21
- export * from './OTLPMetricExporterBase';
16
+ export { OTLPMetricExporter } from './platform';
17
+ export { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
18
+ export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
22
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAEL,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport {\n OTLPMetricExporterOptions,\n AggregationTemporalityPreference,\n} from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
@@ -1,16 +1,10 @@
1
- import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
2
1
  import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
3
2
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
4
- import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
5
- import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
6
- declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
7
- constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
8
- }
3
+ import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
9
4
  /**
10
5
  * Collector Metric Exporter for Web
11
6
  */
12
- export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {
7
+ export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
13
8
  constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions);
14
9
  }
15
- export {};
16
10
  //# sourceMappingURL=OTLPMetricExporter.d.ts.map
@@ -29,23 +29,15 @@ var __extends = (this && this.__extends) || (function () {
29
29
  };
30
30
  })();
31
31
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
32
- import { OTLPExporterBrowserBase, } from '@opentelemetry/otlp-exporter-base';
33
- import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
34
- var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
35
- var OTLPExporterBrowserProxy = /** @class */ (function (_super) {
36
- __extends(OTLPExporterBrowserProxy, _super);
37
- function OTLPExporterBrowserProxy(config) {
38
- return _super.call(this, config, JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH) || this;
39
- }
40
- return OTLPExporterBrowserProxy;
41
- }(OTLPExporterBrowserBase));
32
+ import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
33
+ import { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';
42
34
  /**
43
35
  * Collector Metric Exporter for Web
44
36
  */
45
37
  var OTLPMetricExporter = /** @class */ (function (_super) {
46
38
  __extends(OTLPMetricExporter, _super);
47
39
  function OTLPMetricExporter(config) {
48
- return _super.call(this, new OTLPExporterBrowserProxy(config), config) || this;
40
+ return _super.call(this, createLegacyOtlpBrowserExportDelegate(config !== null && config !== void 0 ? config : {}, JsonMetricsSerializer, 'v1/metrics', { 'Content-Type': 'application/json' })) || this;
49
41
  }
50
42
  return OTLPMetricExporter;
51
43
  }(OTLPMetricExporterBase));
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,uBAAuB,GAExB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,IAAM,+BAA+B,GAAG,YAAY,CAAC;AAErD;IAAuC,4CAGtC;IACC,kCAAY,MAA2D;eACrE,kBACE,MAAM,EACN,qBAAqB,EACrB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EACtC,+BAA+B,CAChC;IACH,CAAC;IACH,+BAAC;AAAD,CAAC,AAZD,CAAuC,uBAAuB,GAY7D;AAED;;GAEG;AACH;IAAwC,sCAAgD;IACtF,4BAAY,MAA2D;eACrE,kBAAM,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACrD,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,CAAwC,sBAAsB,GAI7D","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterBrowserBase,\n OTLPExporterConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';\n\nclass OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase) {\n super(\n config,\n JsonMetricsSerializer,\n { 'Content-Type': 'application/json' },\n DEFAULT_COLLECTOR_RESOURCE_PATH\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterBrowserProxy(config), config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;GAEG;AACH;IAAwC,sCAAsB;IAC5D,4BAAY,MAA2D;eACrE,kBACE,qCAAqC,CACnC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,EACZ,qBAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,CACF;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AAXD,CAAwC,sBAAsB,GAW7D","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 { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n )\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export * from './OTLPMetricExporter';
1
+ export { OTLPMetricExporter } from './OTLPMetricExporter';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -13,8 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
17
- * TODO: Replace export * with named exports before next major version
18
- */
19
- export * from './OTLPMetricExporter';
16
+ export { OTLPMetricExporter } from './OTLPMetricExporter';
20
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export * from './node';
1
+ export { OTLPMetricExporter } from './node';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -13,8 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
17
- * TODO: Replace export * with named exports before next major version
18
- */
19
- export * from './node';
16
+ export { OTLPMetricExporter } from './node';
20
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './node';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
@@ -1,16 +1,10 @@
1
- import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
2
1
  import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
3
2
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
4
- import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
5
- import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
6
- declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
7
- constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
8
- }
3
+ import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
9
4
  /**
10
- * Collector Metric Exporter for Node
5
+ * OTLP Metric Exporter for Node.js
11
6
  */
12
- export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {
7
+ export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
13
8
  constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
14
9
  }
15
- export {};
16
10
  //# sourceMappingURL=OTLPMetricExporter.d.ts.map
@@ -40,26 +40,19 @@ var __assign = (this && this.__assign) || function () {
40
40
  return __assign.apply(this, arguments);
41
41
  };
42
42
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
43
- import { OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
44
- import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
43
+ import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
45
44
  import { VERSION } from '../../version';
45
+ import { convertLegacyHttpOptions, createOtlpHttpExportDelegate, } from '@opentelemetry/otlp-exporter-base/node-http';
46
46
  var USER_AGENT = {
47
47
  'User-Agent': "OTel-OTLP-Exporter-JavaScript/" + VERSION,
48
48
  };
49
- var OTLPExporterNodeProxy = /** @class */ (function (_super) {
50
- __extends(OTLPExporterNodeProxy, _super);
51
- function OTLPExporterNodeProxy(config) {
52
- return _super.call(this, config, JsonMetricsSerializer, __assign(__assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics') || this;
53
- }
54
- return OTLPExporterNodeProxy;
55
- }(OTLPExporterNodeBase));
56
49
  /**
57
- * Collector Metric Exporter for Node
50
+ * OTLP Metric Exporter for Node.js
58
51
  */
59
52
  var OTLPMetricExporter = /** @class */ (function (_super) {
60
53
  __extends(OTLPMetricExporter, _super);
61
54
  function OTLPMetricExporter(config) {
62
- return _super.call(this, new OTLPExporterNodeProxy(config), config) || this;
55
+ return _super.call(this, createOtlpHttpExportDelegate(convertLegacyHttpOptions(config !== null && config !== void 0 ? config : {}, 'METRICS', 'v1/metrics', __assign(__assign({}, USER_AGENT), { 'Content-Type': 'application/json' })), JsonMetricsSerializer), config) || this;
63
56
  }
64
57
  return OTLPMetricExporter;
65
58
  }(OTLPMetricExporterBase));
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACL,oBAAoB,GAErB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;IAAoC,yCAGnC;IACC,+BAAY,MAA+D;eACzE,kBACE,MAAM,EACN,qBAAqB,wBAEhB,UAAU,KACb,cAAc,EAAE,kBAAkB,KAEpC,SAAS,EACT,YAAY,CACb;IACH,CAAC;IACH,4BAAC;AAAD,CAAC,AAhBD,CAAoC,oBAAoB,GAgBvD;AAED;;GAEG;AACH;IAAwC,sCAA6C;IACnF,4BAAY,MAA+D;eACzE,kBAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAClD,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,CAAwC,sBAAsB,GAI7D","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport {\n OTLPExporterNodeBase,\n OTLPExporterNodeConfigBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n IExportMetricsServiceResponse,\n JsonMetricsSerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPExporterNodeProxy extends OTLPExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n config,\n JsonMetricsSerializer,\n {\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n },\n 'METRICS',\n 'v1/metrics'\n );\n }\n}\n\n/**\n * Collector Metric Exporter for Node\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(new OTLPExporterNodeProxy(config), config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AAErD,IAAM,UAAU,GAAG;IACjB,YAAY,EAAE,mCAAiC,OAAS;CACzD,CAAC;AAEF;;GAEG;AACH;IAAwC,sCAAsB;IAC5D,4BAAY,MAA+D;eACzE,kBACE,4BAA4B,CAC1B,wBAAwB,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,EAAE,SAAS,EAAE,YAAY,wBACzD,UAAU,KACb,cAAc,EAAE,kBAAkB,IAClC,EACF,qBAAqB,CACtB,EACD,MAAM,CACP;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AAbD,CAAwC,sBAAsB,GAa7D","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 { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { VERSION } from '../../version';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n ...USER_AGENT,\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export * from './OTLPMetricExporter';
1
+ export { OTLPMetricExporter } from './OTLPMetricExporter';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -13,8 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
17
- * TODO: Replace export * with named exports before next major version
18
- */
19
- export * from './OTLPMetricExporter';
16
+ export { OTLPMetricExporter } from './OTLPMetricExporter';
20
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.55.0";
1
+ export declare const VERSION = "0.57.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export var VERSION = '0.55.0';
17
+ export var VERSION = '0.57.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -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.55.0';\n"]}
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.57.0';\n"]}
@@ -1,18 +1,13 @@
1
- import { ExportResult } from '@opentelemetry/core';
2
1
  import { AggregationTemporality, AggregationTemporalitySelector, InstrumentType, PushMetricExporter, ResourceMetrics, Aggregation } from '@opentelemetry/sdk-metrics';
3
2
  import { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
4
- import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
3
+ import { IOtlpExportDelegate, OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
5
4
  export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
6
5
  export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
7
6
  export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
8
- export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics>> implements PushMetricExporter {
9
- _otlpExporter: T;
10
- private _aggregationTemporalitySelector;
11
- private _aggregationSelector;
12
- constructor(exporter: T, config?: OTLPMetricExporterOptions);
13
- export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
14
- shutdown(): Promise<void>;
15
- forceFlush(): Promise<void>;
7
+ export declare class OTLPMetricExporterBase extends OTLPExporterBase<ResourceMetrics> implements PushMetricExporter {
8
+ private readonly _aggregationTemporalitySelector;
9
+ private readonly _aggregationSelector;
10
+ constructor(delegate: IOtlpExportDelegate<ResourceMetrics>, config?: OTLPMetricExporterOptions);
16
11
  selectAggregation(instrumentType: InstrumentType): Aggregation;
17
12
  selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;
18
13
  }
@@ -16,6 +16,7 @@
16
16
  import { getEnv } from '@opentelemetry/core';
17
17
  import { AggregationTemporality, InstrumentType, Aggregation, } from '@opentelemetry/sdk-metrics';
18
18
  import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
19
+ import { OTLPExporterBase, } from '@opentelemetry/otlp-exporter-base';
19
20
  import { diag } from '@opentelemetry/api';
20
21
  export const CumulativeTemporalitySelector = () => AggregationTemporality.CUMULATIVE;
21
22
  export const DeltaTemporalitySelector = (instrumentType) => {
@@ -80,21 +81,12 @@ function chooseAggregationSelector(config) {
80
81
  return (_instrumentType) => Aggregation.Default();
81
82
  }
82
83
  }
83
- export class OTLPMetricExporterBase {
84
- constructor(exporter, config) {
85
- this._otlpExporter = exporter;
84
+ export class OTLPMetricExporterBase extends OTLPExporterBase {
85
+ constructor(delegate, config) {
86
+ super(delegate);
86
87
  this._aggregationSelector = chooseAggregationSelector(config);
87
88
  this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
88
89
  }
89
- export(metrics, resultCallback) {
90
- this._otlpExporter.export([metrics], resultCallback);
91
- }
92
- async shutdown() {
93
- await this._otlpExporter.shutdown();
94
- }
95
- forceFlush() {
96
- return Promise.resolve();
97
- }
98
90
  selectAggregation(instrumentType) {
99
91
  return this._aggregationSelector(instrumentType);
100
92
  }
@@ -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;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,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AQ,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 { 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<OTLPMetricExporterOptions, ResourceMetrics>,\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,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EAEtB,cAAc,EAGd,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,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,EA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,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,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,sBACX,SAAQ,gBAAiC;IAMzC,YACE,QAA8C,EAC9C,MAAkC;QAElC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,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,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 { 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 {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\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 extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\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,4 +1,4 @@
1
- export * from './platform';
2
- export * from './OTLPMetricExporterOptions';
3
- export * from './OTLPMetricExporterBase';
1
+ export { OTLPMetricExporter } from './platform';
2
+ export { OTLPMetricExporterOptions, AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
3
+ export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -13,10 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
17
- * TODO: Replace export * with named exports before next major version
18
- */
19
- export * from './platform';
20
- export * from './OTLPMetricExporterOptions';
21
- export * from './OTLPMetricExporterBase';
16
+ export { OTLPMetricExporter } from './platform';
17
+ export { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
18
+ export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
22
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-restricted-syntax: [\"warn\", \"ExportAllDeclaration\"] --\n * TODO: Replace export * with named exports before next major version\n */\nexport * from './platform';\nexport * from './OTLPMetricExporterOptions';\nexport * from './OTLPMetricExporterBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAEL,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport {\n OTLPMetricExporterOptions,\n AggregationTemporalityPreference,\n} from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}