Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/exporter-metrics-otlp-http

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/exporter-metrics-otlp-http - npm Package Compare versions

Comparing version 0.55.0 to 0.56.0

6

build/esm/index.d.ts

@@ -1,4 +0,4 @@

export * from './platform';
export * from './OTLPMetricExporterOptions';
export * from './OTLPMetricExporterBase';
export { OTLPMetricExporter } from './platform';
export { OTLPMetricExporterOptions, AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
//# sourceMappingURL=index.d.ts.map

@@ -16,8 +16,5 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './platform';
export * from './OTLPMetricExporterOptions';
export * from './OTLPMetricExporterBase';
export { OTLPMetricExporter } from './platform';
export { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,11 @@

import { ExportResult } from '@opentelemetry/core';
import { AggregationTemporality, AggregationTemporalitySelector, InstrumentType, PushMetricExporter, ResourceMetrics, Aggregation } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
import { IOtlpExportDelegate, OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics>> implements PushMetricExporter {
_otlpExporter: T;
private _aggregationTemporalitySelector;
private _aggregationSelector;
constructor(exporter: T, config?: OTLPMetricExporterOptions);
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
shutdown(): Promise<void>;
forceFlush(): Promise<void>;
export declare class OTLPMetricExporterBase extends OTLPExporterBase<ResourceMetrics> implements PushMetricExporter {
private readonly _aggregationTemporalitySelector;
private readonly _aggregationSelector;
constructor(delegate: IOtlpExportDelegate<ResourceMetrics>, config?: OTLPMetricExporterOptions);
selectAggregation(instrumentType: InstrumentType): Aggregation;

@@ -17,0 +12,0 @@ selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;

@@ -16,41 +16,21 @@ /*

*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { getEnv } from '@opentelemetry/core';
import { AggregationTemporality, InstrumentType, Aggregation, } from '@opentelemetry/sdk-metrics';
import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
import { OTLPExporterBase, } from '@opentelemetry/otlp-exporter-base';
import { diag } from '@opentelemetry/api';

@@ -120,26 +100,10 @@ export var CumulativeTemporalitySelector = function () { return AggregationTemporality.CUMULATIVE; };

}
var OTLPMetricExporterBase = /** @class */ (function () {
function OTLPMetricExporterBase(exporter, config) {
this._otlpExporter = exporter;
this._aggregationSelector = chooseAggregationSelector(config);
this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
var OTLPMetricExporterBase = /** @class */ (function (_super) {
__extends(OTLPMetricExporterBase, _super);
function OTLPMetricExporterBase(delegate, config) {
var _this = _super.call(this, delegate) || this;
_this._aggregationSelector = chooseAggregationSelector(config);
_this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
return _this;
}
OTLPMetricExporterBase.prototype.export = function (metrics, resultCallback) {
this._otlpExporter.export([metrics], resultCallback);
};
OTLPMetricExporterBase.prototype.shutdown = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._otlpExporter.shutdown()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
OTLPMetricExporterBase.prototype.forceFlush = function () {
return Promise.resolve();
};
OTLPMetricExporterBase.prototype.selectAggregation = function (instrumentType) {

@@ -152,4 +116,4 @@ return this._aggregationSelector(instrumentType);

return OTLPMetricExporterBase;
}());
}(OTLPExporterBase));
export { OTLPMetricExporterBase };
//# sourceMappingURL=OTLPMetricExporterBase.js.map

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
}
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Web
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -32,12 +32,4 @@ /*

import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterBrowserBase, } from '@opentelemetry/otlp-exporter-base';
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
var DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
var OTLPExporterBrowserProxy = /** @class */ (function (_super) {
__extends(OTLPExporterBrowserProxy, _super);
function OTLPExporterBrowserProxy(config) {
return _super.call(this, config, JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH) || this;
}
return OTLPExporterBrowserProxy;
}(OTLPExporterBrowserBase));
import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
import { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';
/**

@@ -49,3 +41,3 @@ * Collector Metric Exporter for Web

function OTLPMetricExporter(config) {
return _super.call(this, new OTLPExporterBrowserProxy(config), config) || this;
return _super.call(this, createLegacyOtlpBrowserExportDelegate(config !== null && config !== void 0 ? config : {}, JsonMetricsSerializer, 'v1/metrics', { 'Content-Type': 'application/json' })) || this;
}

@@ -52,0 +44,0 @@ return OTLPMetricExporter;

@@ -1,2 +0,2 @@

export * from './node';
export { OTLPMetricExporter } from './node';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './node';
export { OTLPMetricExporter } from './node';
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -43,17 +43,10 @@ /*

import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
import { VERSION } from '../../version';
import { convertLegacyHttpOptions, createOtlpHttpExportDelegate, } from '@opentelemetry/otlp-exporter-base/node-http';
var USER_AGENT = {
'User-Agent': "OTel-OTLP-Exporter-JavaScript/" + VERSION,
};
var OTLPExporterNodeProxy = /** @class */ (function (_super) {
__extends(OTLPExporterNodeProxy, _super);
function OTLPExporterNodeProxy(config) {
return _super.call(this, config, JsonMetricsSerializer, __assign(__assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics') || this;
}
return OTLPExporterNodeProxy;
}(OTLPExporterNodeBase));
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/

@@ -63,3 +56,3 @@ var OTLPMetricExporter = /** @class */ (function (_super) {

function OTLPMetricExporter(config) {
return _super.call(this, new OTLPExporterNodeProxy(config), config) || this;
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;
}

@@ -66,0 +59,0 @@ return OTLPMetricExporter;

@@ -1,2 +0,2 @@

export declare const VERSION = "0.55.0";
export declare const VERSION = "0.56.0";
//# sourceMappingURL=version.d.ts.map

@@ -17,3 +17,3 @@ /*

// this is autogenerated file, see scripts/version-update.js
export var VERSION = '0.55.0';
export var VERSION = '0.56.0';
//# sourceMappingURL=version.js.map

@@ -1,4 +0,4 @@

export * from './platform';
export * from './OTLPMetricExporterOptions';
export * from './OTLPMetricExporterBase';
export { OTLPMetricExporter } from './platform';
export { OTLPMetricExporterOptions, AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
//# sourceMappingURL=index.d.ts.map

@@ -16,8 +16,5 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './platform';
export * from './OTLPMetricExporterOptions';
export * from './OTLPMetricExporterBase';
export { OTLPMetricExporter } from './platform';
export { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,11 @@

import { ExportResult } from '@opentelemetry/core';
import { AggregationTemporality, AggregationTemporalitySelector, InstrumentType, PushMetricExporter, ResourceMetrics, Aggregation } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
import { IOtlpExportDelegate, OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics>> implements PushMetricExporter {
_otlpExporter: T;
private _aggregationTemporalitySelector;
private _aggregationSelector;
constructor(exporter: T, config?: OTLPMetricExporterOptions);
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
shutdown(): Promise<void>;
forceFlush(): Promise<void>;
export declare class OTLPMetricExporterBase extends OTLPExporterBase<ResourceMetrics> implements PushMetricExporter {
private readonly _aggregationTemporalitySelector;
private readonly _aggregationSelector;
constructor(delegate: IOtlpExportDelegate<ResourceMetrics>, config?: OTLPMetricExporterOptions);
selectAggregation(instrumentType: InstrumentType): Aggregation;

@@ -17,0 +12,0 @@ selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;

@@ -19,2 +19,3 @@ /*

import { AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
import { OTLPExporterBase, } from '@opentelemetry/otlp-exporter-base';
import { diag } from '@opentelemetry/api';

@@ -84,17 +85,8 @@ export const CumulativeTemporalitySelector = () => AggregationTemporality.CUMULATIVE;

}
export class OTLPMetricExporterBase {
constructor(exporter, config) {
this._otlpExporter = exporter;
export class OTLPMetricExporterBase extends OTLPExporterBase {
constructor(delegate, config) {
super(delegate);
this._aggregationSelector = chooseAggregationSelector(config);
this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
}
export(metrics, resultCallback) {
this._otlpExporter.export([metrics], resultCallback);
}
async shutdown() {
await this._otlpExporter.shutdown();
}
forceFlush() {
return Promise.resolve();
}
selectAggregation(instrumentType) {

@@ -101,0 +93,0 @@ return this._aggregationSelector(instrumentType);

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
}
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Web
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -17,10 +17,4 @@ /*

import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterBrowserBase, } from '@opentelemetry/otlp-exporter-base';
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase {
constructor(config) {
super(config, JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH);
}
}
import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
import { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';
/**

@@ -31,5 +25,5 @@ * Collector Metric Exporter for Web

constructor(config) {
super(new OTLPExporterBrowserProxy(config), config);
super(createLegacyOtlpBrowserExportDelegate(config !== null && config !== void 0 ? config : {}, JsonMetricsSerializer, 'v1/metrics', { 'Content-Type': 'application/json' }));
}
}
//# sourceMappingURL=OTLPMetricExporter.js.map

@@ -1,2 +0,2 @@

export * from './node';
export { OTLPMetricExporter } from './node';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './node';
export { OTLPMetricExporter } from './node';
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -16,6 +16,3 @@ /*

*/
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -17,21 +17,16 @@ /*

import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterNodeBase, } from '@opentelemetry/otlp-exporter-base';
import { JsonMetricsSerializer, } from '@opentelemetry/otlp-transformer';
import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
import { VERSION } from '../../version';
import { convertLegacyHttpOptions, createOtlpHttpExportDelegate, } from '@opentelemetry/otlp-exporter-base/node-http';
const USER_AGENT = {
'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,
};
class OTLPExporterNodeProxy extends OTLPExporterNodeBase {
constructor(config) {
super(config, JsonMetricsSerializer, Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics');
}
}
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/
export class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config) {
super(new OTLPExporterNodeProxy(config), config);
super(createOtlpHttpExportDelegate(convertLegacyHttpOptions(config !== null && config !== void 0 ? config : {}, 'METRICS', 'v1/metrics', Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' })), JsonMetricsSerializer), config);
}
}
//# sourceMappingURL=OTLPMetricExporter.js.map

@@ -1,2 +0,2 @@

export declare const VERSION = "0.55.0";
export declare const VERSION = "0.56.0";
//# sourceMappingURL=version.d.ts.map

@@ -17,3 +17,3 @@ /*

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.55.0';
export const VERSION = '0.56.0';
//# sourceMappingURL=version.js.map

@@ -1,4 +0,4 @@

export * from './platform';
export * from './OTLPMetricExporterOptions';
export * from './OTLPMetricExporterBase';
export { OTLPMetricExporter } from './platform';
export { OTLPMetricExporterOptions, AggregationTemporalityPreference, } from './OTLPMetricExporterOptions';
export { CumulativeTemporalitySelector, DeltaTemporalitySelector, LowMemoryTemporalitySelector, OTLPMetricExporterBase, } from './OTLPMetricExporterBase';
//# sourceMappingURL=index.d.ts.map

@@ -17,19 +17,13 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
__exportStar(require("./platform"), exports);
__exportStar(require("./OTLPMetricExporterOptions"), exports);
__exportStar(require("./OTLPMetricExporterBase"), exports);
exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = exports.AggregationTemporalityPreference = exports.OTLPMetricExporter = void 0;
var platform_1 = require("./platform");
Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function () { return platform_1.OTLPMetricExporter; } });
var OTLPMetricExporterOptions_1 = require("./OTLPMetricExporterOptions");
Object.defineProperty(exports, "AggregationTemporalityPreference", { enumerable: true, get: function () { return OTLPMetricExporterOptions_1.AggregationTemporalityPreference; } });
var OTLPMetricExporterBase_1 = require("./OTLPMetricExporterBase");
Object.defineProperty(exports, "CumulativeTemporalitySelector", { enumerable: true, get: function () { return OTLPMetricExporterBase_1.CumulativeTemporalitySelector; } });
Object.defineProperty(exports, "DeltaTemporalitySelector", { enumerable: true, get: function () { return OTLPMetricExporterBase_1.DeltaTemporalitySelector; } });
Object.defineProperty(exports, "LowMemoryTemporalitySelector", { enumerable: true, get: function () { return OTLPMetricExporterBase_1.LowMemoryTemporalitySelector; } });
Object.defineProperty(exports, "OTLPMetricExporterBase", { enumerable: true, get: function () { return OTLPMetricExporterBase_1.OTLPMetricExporterBase; } });
//# sourceMappingURL=index.js.map

@@ -1,16 +0,11 @@

import { ExportResult } from '@opentelemetry/core';
import { AggregationTemporality, AggregationTemporalitySelector, InstrumentType, PushMetricExporter, ResourceMetrics, Aggregation } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
import { IOtlpExportDelegate, OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
export declare const CumulativeTemporalitySelector: AggregationTemporalitySelector;
export declare const DeltaTemporalitySelector: AggregationTemporalitySelector;
export declare const LowMemoryTemporalitySelector: AggregationTemporalitySelector;
export declare class OTLPMetricExporterBase<T extends OTLPExporterBase<OTLPMetricExporterOptions, ResourceMetrics>> implements PushMetricExporter {
_otlpExporter: T;
private _aggregationTemporalitySelector;
private _aggregationSelector;
constructor(exporter: T, config?: OTLPMetricExporterOptions);
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
shutdown(): Promise<void>;
forceFlush(): Promise<void>;
export declare class OTLPMetricExporterBase extends OTLPExporterBase<ResourceMetrics> implements PushMetricExporter {
private readonly _aggregationTemporalitySelector;
private readonly _aggregationSelector;
constructor(delegate: IOtlpExportDelegate<ResourceMetrics>, config?: OTLPMetricExporterOptions);
selectAggregation(instrumentType: InstrumentType): Aggregation;

@@ -17,0 +12,0 @@ selectAggregationTemporality(instrumentType: InstrumentType): AggregationTemporality;

@@ -22,2 +22,3 @@ "use strict";

const OTLPMetricExporterOptions_1 = require("./OTLPMetricExporterOptions");
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
const api_1 = require("@opentelemetry/api");

@@ -90,17 +91,8 @@ const CumulativeTemporalitySelector = () => sdk_metrics_1.AggregationTemporality.CUMULATIVE;

}
class OTLPMetricExporterBase {
constructor(exporter, config) {
this._otlpExporter = exporter;
class OTLPMetricExporterBase extends otlp_exporter_base_1.OTLPExporterBase {
constructor(delegate, config) {
super(delegate);
this._aggregationSelector = chooseAggregationSelector(config);
this._aggregationTemporalitySelector = chooseTemporalitySelector(config === null || config === void 0 ? void 0 : config.temporalityPreference);
}
export(metrics, resultCallback) {
this._otlpExporter.export([metrics], resultCallback);
}
async shutdown() {
await this._otlpExporter.shutdown();
}
forceFlush() {
return Promise.resolve();
}
selectAggregation(instrumentType) {

@@ -107,0 +99,0 @@ return this._aggregationSelector(instrumentType);

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -17,17 +17,6 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
__exportStar(require("./OTLPMetricExporter"), exports);
exports.OTLPMetricExporter = void 0;
var OTLPMetricExporter_1 = require("./OTLPMetricExporter");
Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function () { return OTLPMetricExporter_1.OTLPMetricExporter; } });
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterBrowserBase, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterBrowserProxy extends OTLPExporterBrowserBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPMetricExporterOptions & OTLPExporterConfigBase);
}
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Web
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterBrowserProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -20,10 +20,4 @@ "use strict";

const OTLPMetricExporterBase_1 = require("../../OTLPMetricExporterBase");
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics';
class OTLPExporterBrowserProxy extends otlp_exporter_base_1.OTLPExporterBrowserBase {
constructor(config) {
super(config, otlp_transformer_1.JsonMetricsSerializer, { 'Content-Type': 'application/json' }, DEFAULT_COLLECTOR_RESOURCE_PATH);
}
}
const browser_http_1 = require("@opentelemetry/otlp-exporter-base/browser-http");
/**

@@ -34,3 +28,3 @@ * Collector Metric Exporter for Web

constructor(config) {
super(new OTLPExporterBrowserProxy(config), config);
super((0, browser_http_1.createLegacyOtlpBrowserExportDelegate)(config !== null && config !== void 0 ? config : {}, otlp_transformer_1.JsonMetricsSerializer, 'v1/metrics', { 'Content-Type': 'application/json' }));
}

@@ -37,0 +31,0 @@ }

@@ -1,2 +0,2 @@

export * from './node';
export { OTLPMetricExporter } from './node';
//# sourceMappingURL=index.d.ts.map

@@ -17,17 +17,6 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
__exportStar(require("./node"), exports);
exports.OTLPMetricExporter = void 0;
var node_1 = require("./node");
Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function () { return node_1.OTLPMetricExporter; } });
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export * from './OTLPMetricExporter';
export { OTLPMetricExporter } from './OTLPMetricExporter';
//# sourceMappingURL=index.d.ts.map

@@ -17,17 +17,6 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint no-restricted-syntax: ["warn", "ExportAllDeclaration"] --
* TODO: Replace export * with named exports before next major version
*/
__exportStar(require("./OTLPMetricExporter"), exports);
exports.OTLPMetricExporter = void 0;
var OTLPMetricExporter_1 = require("./OTLPMetricExporter");
Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function () { return OTLPMetricExporter_1.OTLPMetricExporter; } });
//# sourceMappingURL=index.js.map

@@ -1,16 +0,10 @@

import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import { OTLPExporterNodeBase, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
declare class OTLPExporterNodeProxy extends OTLPExporterNodeBase<ResourceMetrics, IExportMetricsServiceResponse> {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/
export declare class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPExporterNodeProxy> {
export declare class OTLPMetricExporter extends OTLPMetricExporterBase {
constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions);
}
export {};
//# sourceMappingURL=OTLPMetricExporter.d.ts.map

@@ -20,19 +20,14 @@ "use strict";

const OTLPMetricExporterBase_1 = require("../../OTLPMetricExporterBase");
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
const version_1 = require("../../version");
const node_http_1 = require("@opentelemetry/otlp-exporter-base/node-http");
const USER_AGENT = {
'User-Agent': `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`,
};
class OTLPExporterNodeProxy extends otlp_exporter_base_1.OTLPExporterNodeBase {
constructor(config) {
super(config, otlp_transformer_1.JsonMetricsSerializer, Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' }), 'METRICS', 'v1/metrics');
}
}
/**
* Collector Metric Exporter for Node
* OTLP Metric Exporter for Node.js
*/
class OTLPMetricExporter extends OTLPMetricExporterBase_1.OTLPMetricExporterBase {
constructor(config) {
super(new OTLPExporterNodeProxy(config), config);
super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config !== null && config !== void 0 ? config : {}, 'METRICS', 'v1/metrics', Object.assign(Object.assign({}, USER_AGENT), { 'Content-Type': 'application/json' })), otlp_transformer_1.JsonMetricsSerializer), config);
}

@@ -39,0 +34,0 @@ }

@@ -1,2 +0,2 @@

export declare const VERSION = "0.55.0";
export declare const VERSION = "0.56.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.55.0';
exports.VERSION = '0.56.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/exporter-metrics-otlp-http",
"version": "0.55.0",
"version": "0.56.0",
"description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector",

@@ -68,3 +68,3 @@ "main": "build/src/index.js",

"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",

@@ -96,11 +96,11 @@ "@types/sinon": "17.0.3",

"dependencies": {
"@opentelemetry/core": "1.28.0",
"@opentelemetry/otlp-exporter-base": "0.55.0",
"@opentelemetry/otlp-transformer": "0.55.0",
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-metrics": "1.28.0"
"@opentelemetry/core": "1.29.0",
"@opentelemetry/otlp-exporter-base": "0.56.0",
"@opentelemetry/otlp-transformer": "0.56.0",
"@opentelemetry/resources": "1.29.0",
"@opentelemetry/sdk-metrics": "1.29.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http",
"sideEffects": false,
"gitHead": "4b1ad3fda0cde58907e30fab25c3c767546708e5"
"gitHead": "85dcbc7c55f002837f1bf1bf01145dbb34a55b40"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc