@opentelemetry/exporter-collector
Advanced tools
Comparing version 0.24.1-alpha.31 to 0.25.1-alpha.21
@@ -72,24 +72,17 @@ /* | ||
var body = JSON.stringify(serviceRequest); | ||
var promise = new Promise(function (resolve) { | ||
var _onSuccess = function () { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
var _onError = function (error) { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
var _onFinish = function () { | ||
resolve(); | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
var promise = new Promise(function (resolve, reject) { | ||
if (_this._useXHR) { | ||
sendWithXhr(body, _this.url, _this._headers, _onSuccess, _onError); | ||
sendWithXhr(body, _this.url, _this._headers, resolve, reject); | ||
} | ||
else { | ||
sendWithBeacon(body, _this.url, _onSuccess, _onError); | ||
sendWithBeacon(body, _this.url, { type: 'application/json' }, resolve, reject); | ||
} | ||
}); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
var popPromise = function () { | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
}; | ||
@@ -96,0 +89,0 @@ return CollectorExporterBrowserBase; |
@@ -1,2 +0,2 @@ | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/metrics'; | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/sdk-metrics-base'; | ||
import { CollectorExporterConfigBase } from '../../types'; | ||
@@ -3,0 +3,0 @@ import * as collectorTypes from '../../types'; |
import { CollectorExporterConfigBase } from '../../types'; | ||
import { CollectorExporterBrowserBase } from './CollectorExporterBrowserBase'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'; | ||
import * as collectorTypes from '../../types'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -8,3 +8,3 @@ import * as collectorTypes from '../../types'; | ||
*/ | ||
export declare function sendWithBeacon(body: string, url: string, onSuccess: () => void, onError: (error: collectorTypes.CollectorExporterError) => void): void; | ||
export declare function sendWithBeacon(body: string, url: string, blobPropertyBag: BlobPropertyBag, onSuccess: () => void, onError: (error: collectorTypes.CollectorExporterError) => void): void; | ||
/** | ||
@@ -11,0 +11,0 @@ * function to send metrics/spans using browser XMLHttpRequest |
@@ -35,4 +35,4 @@ var __assign = (this && this.__assign) || function () { | ||
*/ | ||
export function sendWithBeacon(body, url, onSuccess, onError) { | ||
if (navigator.sendBeacon(url, body)) { | ||
export function sendWithBeacon(body, url, blobPropertyBag, onSuccess, onError) { | ||
if (navigator.sendBeacon(url, new Blob([body], blobPropertyBag))) { | ||
diag.debug('sendBeacon - can send', body); | ||
@@ -39,0 +39,0 @@ onSuccess(); |
@@ -64,19 +64,12 @@ /* | ||
var serviceRequest = this.convert(objects); | ||
var promise = new Promise(function (resolve) { | ||
var _onSuccess = function () { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
var _onError = function (error) { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
var _onFinish = function () { | ||
resolve(); | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
sendWithHttp(_this, JSON.stringify(serviceRequest), 'application/json', _onSuccess, _onError); | ||
}); | ||
var promise = new Promise(function (resolve, reject) { | ||
sendWithHttp(_this, JSON.stringify(serviceRequest), 'application/json', resolve, reject); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
var popPromise = function () { | ||
var index = _this._sendingPromises.indexOf(promise); | ||
_this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
}; | ||
@@ -83,0 +76,0 @@ CollectorExporterNodeBase.prototype.onShutdown = function () { }; |
@@ -1,2 +0,2 @@ | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/metrics'; | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/sdk-metrics-base'; | ||
import * as collectorTypes from '../../types'; | ||
@@ -3,0 +3,0 @@ import { CollectorExporterNodeConfigBase } from './types'; |
@@ -1,2 +0,2 @@ | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'; | ||
import { CollectorExporterNodeBase } from './CollectorExporterNodeBase'; | ||
@@ -3,0 +3,0 @@ import { CollectorExporterNodeConfigBase } from './types'; |
import { SpanAttributes, SpanKind, SpanStatus, TraceState } from '@opentelemetry/api'; | ||
import * as core from '@opentelemetry/core'; | ||
import { Resource } from '@opentelemetry/resources'; | ||
import { ReadableSpan, TimedEvent } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base'; | ||
import { CollectorExporterBase } from './CollectorExporterBase'; | ||
@@ -6,0 +6,0 @@ import { opentelemetryProto, CollectorExporterConfigBase } from './types'; |
import { Labels } from '@opentelemetry/api-metrics'; | ||
import * as core from '@opentelemetry/core'; | ||
import { MetricRecord } from '@opentelemetry/metrics'; | ||
import { MetricRecord } from '@opentelemetry/sdk-metrics-base'; | ||
import { Resource } from '@opentelemetry/resources'; | ||
@@ -5,0 +5,0 @@ import { CollectorExporterBase } from './CollectorExporterBase'; |
@@ -18,3 +18,3 @@ /* | ||
import * as core from '@opentelemetry/core'; | ||
import { AggregatorKind, MetricKind, } from '@opentelemetry/metrics'; | ||
import { AggregatorKind, MetricKind, } from '@opentelemetry/sdk-metrics-base'; | ||
import { toCollectorResource } from './transform'; | ||
@@ -21,0 +21,0 @@ import { opentelemetryProto } from './types'; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.24.0"; | ||
export declare const VERSION = "0.25.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '0.24.0'; | ||
export var VERSION = '0.25.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -56,24 +56,17 @@ "use strict"; | ||
const body = JSON.stringify(serviceRequest); | ||
const promise = new Promise(resolve => { | ||
const _onSuccess = () => { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
const _onError = (error) => { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
const _onFinish = () => { | ||
resolve(); | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
const promise = new Promise((resolve, reject) => { | ||
if (this._useXHR) { | ||
util_2.sendWithXhr(body, this.url, this._headers, _onSuccess, _onError); | ||
util_2.sendWithXhr(body, this.url, this._headers, resolve, reject); | ||
} | ||
else { | ||
util_2.sendWithBeacon(body, this.url, _onSuccess, _onError); | ||
util_2.sendWithBeacon(body, this.url, { type: 'application/json' }, resolve, reject); | ||
} | ||
}); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
const popPromise = () => { | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
} | ||
@@ -80,0 +73,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/metrics'; | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/sdk-metrics-base'; | ||
import { CollectorExporterConfigBase } from '../../types'; | ||
@@ -3,0 +3,0 @@ import * as collectorTypes from '../../types'; |
import { CollectorExporterConfigBase } from '../../types'; | ||
import { CollectorExporterBrowserBase } from './CollectorExporterBrowserBase'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'; | ||
import * as collectorTypes from '../../types'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -8,3 +8,3 @@ import * as collectorTypes from '../../types'; | ||
*/ | ||
export declare function sendWithBeacon(body: string, url: string, onSuccess: () => void, onError: (error: collectorTypes.CollectorExporterError) => void): void; | ||
export declare function sendWithBeacon(body: string, url: string, blobPropertyBag: BlobPropertyBag, onSuccess: () => void, onError: (error: collectorTypes.CollectorExporterError) => void): void; | ||
/** | ||
@@ -11,0 +11,0 @@ * function to send metrics/spans using browser XMLHttpRequest |
@@ -27,4 +27,4 @@ "use strict"; | ||
*/ | ||
function sendWithBeacon(body, url, onSuccess, onError) { | ||
if (navigator.sendBeacon(url, body)) { | ||
function sendWithBeacon(body, url, blobPropertyBag, onSuccess, onError) { | ||
if (navigator.sendBeacon(url, new Blob([body], blobPropertyBag))) { | ||
api_1.diag.debug('sendBeacon - can send', body); | ||
@@ -31,0 +31,0 @@ onSuccess(); |
@@ -48,19 +48,12 @@ "use strict"; | ||
const serviceRequest = this.convert(objects); | ||
const promise = new Promise(resolve => { | ||
const _onSuccess = () => { | ||
onSuccess(); | ||
_onFinish(); | ||
}; | ||
const _onError = (error) => { | ||
onError(error); | ||
_onFinish(); | ||
}; | ||
const _onFinish = () => { | ||
resolve(); | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', _onSuccess, _onError); | ||
}); | ||
const promise = new Promise((resolve, reject) => { | ||
util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', resolve, reject); | ||
}) | ||
.then(onSuccess, onError); | ||
this._sendingPromises.push(promise); | ||
const popPromise = () => { | ||
const index = this._sendingPromises.indexOf(promise); | ||
this._sendingPromises.splice(index, 1); | ||
}; | ||
promise.then(popPromise, popPromise); | ||
} | ||
@@ -67,0 +60,0 @@ onShutdown() { } |
@@ -1,2 +0,2 @@ | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/metrics'; | ||
import { MetricRecord, MetricExporter } from '@opentelemetry/sdk-metrics-base'; | ||
import * as collectorTypes from '../../types'; | ||
@@ -3,0 +3,0 @@ import { CollectorExporterNodeConfigBase } from './types'; |
@@ -1,2 +0,2 @@ | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'; | ||
import { CollectorExporterNodeBase } from './CollectorExporterNodeBase'; | ||
@@ -3,0 +3,0 @@ import { CollectorExporterNodeConfigBase } from './types'; |
import { SpanAttributes, SpanKind, SpanStatus, TraceState } from '@opentelemetry/api'; | ||
import * as core from '@opentelemetry/core'; | ||
import { Resource } from '@opentelemetry/resources'; | ||
import { ReadableSpan, TimedEvent } from '@opentelemetry/tracing'; | ||
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base'; | ||
import { CollectorExporterBase } from './CollectorExporterBase'; | ||
@@ -6,0 +6,0 @@ import { opentelemetryProto, CollectorExporterConfigBase } from './types'; |
import { Labels } from '@opentelemetry/api-metrics'; | ||
import * as core from '@opentelemetry/core'; | ||
import { MetricRecord } from '@opentelemetry/metrics'; | ||
import { MetricRecord } from '@opentelemetry/sdk-metrics-base'; | ||
import { Resource } from '@opentelemetry/resources'; | ||
@@ -5,0 +5,0 @@ import { CollectorExporterBase } from './CollectorExporterBase'; |
@@ -21,3 +21,3 @@ "use strict"; | ||
const core = require("@opentelemetry/core"); | ||
const metrics_1 = require("@opentelemetry/metrics"); | ||
const sdk_metrics_base_1 = require("@opentelemetry/sdk-metrics-base"); | ||
const transform_1 = require("./transform"); | ||
@@ -40,3 +40,3 @@ const types_1 = require("./types"); | ||
function toAggregationTemporality(metric) { | ||
if (metric.descriptor.metricKind === metrics_1.MetricKind.VALUE_OBSERVER) { | ||
if (metric.descriptor.metricKind === sdk_metrics_base_1.MetricKind.VALUE_OBSERVER) { | ||
return types_1.opentelemetryProto.metrics.v1.AggregationTemporality | ||
@@ -91,9 +91,9 @@ .AGGREGATION_TEMPORALITY_UNSPECIFIED; | ||
}; | ||
if (metric.aggregator.kind === metrics_1.AggregatorKind.SUM || | ||
metric.descriptor.metricKind === metrics_1.MetricKind.SUM_OBSERVER || | ||
metric.descriptor.metricKind === metrics_1.MetricKind.UP_DOWN_SUM_OBSERVER) { | ||
if (metric.aggregator.kind === sdk_metrics_base_1.AggregatorKind.SUM || | ||
metric.descriptor.metricKind === sdk_metrics_base_1.MetricKind.SUM_OBSERVER || | ||
metric.descriptor.metricKind === sdk_metrics_base_1.MetricKind.UP_DOWN_SUM_OBSERVER) { | ||
const result = { | ||
dataPoints: [toDataPoint(metric, startTime)], | ||
isMonotonic: metric.descriptor.metricKind === metrics_1.MetricKind.COUNTER || | ||
metric.descriptor.metricKind === metrics_1.MetricKind.SUM_OBSERVER, | ||
isMonotonic: metric.descriptor.metricKind === sdk_metrics_base_1.MetricKind.COUNTER || | ||
metric.descriptor.metricKind === sdk_metrics_base_1.MetricKind.SUM_OBSERVER, | ||
aggregationTemporality: toAggregationTemporality(metric), | ||
@@ -108,3 +108,3 @@ }; | ||
} | ||
else if (metric.aggregator.kind === metrics_1.AggregatorKind.LAST_VALUE) { | ||
else if (metric.aggregator.kind === sdk_metrics_base_1.AggregatorKind.LAST_VALUE) { | ||
const result = { | ||
@@ -120,3 +120,3 @@ dataPoints: [toDataPoint(metric, startTime)], | ||
} | ||
else if (metric.aggregator.kind === metrics_1.AggregatorKind.HISTOGRAM) { | ||
else if (metric.aggregator.kind === sdk_metrics_base_1.AggregatorKind.HISTOGRAM) { | ||
const result = { | ||
@@ -123,0 +123,0 @@ dataPoints: [toHistogramPoint(metric, startTime)], |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.24.0"; | ||
export declare const VERSION = "0.25.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.24.0'; | ||
exports.VERSION = '0.25.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/exporter-collector", | ||
"version": "0.24.1-alpha.31+fd2410cc", | ||
"version": "0.25.1-alpha.21+0ef1fc28", | ||
"description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector", | ||
@@ -56,6 +56,6 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@babel/core": "7.14.8", | ||
"@opentelemetry/api": "^1.0.1", | ||
"@babel/core": "7.15.0", | ||
"@opentelemetry/api": "^1.0.2", | ||
"@types/mocha": "8.2.3", | ||
"@types/node": "14.17.5", | ||
"@types/node": "14.17.9", | ||
"@types/sinon": "10.0.2", | ||
@@ -81,16 +81,16 @@ "@types/webpack-env": "1.16.2", | ||
"webpack": "4.46.0", | ||
"webpack-cli": "4.7.2", | ||
"webpack-cli": "4.8.0", | ||
"webpack-merge": "5.8.0" | ||
}, | ||
"peerDependencies": { | ||
"@opentelemetry/api": "^1.0.1" | ||
"@opentelemetry/api": "^1.0.2" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/api-metrics": "^0.24.1-alpha.31+fd2410cc", | ||
"@opentelemetry/core": "^0.24.1-alpha.31+fd2410cc", | ||
"@opentelemetry/metrics": "^0.24.1-alpha.31+fd2410cc", | ||
"@opentelemetry/resources": "^0.24.1-alpha.31+fd2410cc", | ||
"@opentelemetry/tracing": "^0.24.1-alpha.31+fd2410cc" | ||
"@opentelemetry/api-metrics": "^0.25.1-alpha.21+0ef1fc28", | ||
"@opentelemetry/core": "^0.25.1-alpha.21+0ef1fc28", | ||
"@opentelemetry/resources": "^0.25.1-alpha.21+0ef1fc28", | ||
"@opentelemetry/sdk-metrics-base": "^0.25.1-alpha.21+0ef1fc28", | ||
"@opentelemetry/sdk-trace-base": "^0.25.1-alpha.21+0ef1fc28" | ||
}, | ||
"gitHead": "fd2410cc9e8d43210b6ea44b8193fa70ee900499" | ||
"gitHead": "0ef1fc28d366b74d98b73b5d6334ffdc75342fe2" | ||
} |
@@ -26,4 +26,4 @@ # OpenTelemetry Collector Exporter for web and node | ||
```js | ||
import { BatchSpanProcessor } from '@opentelemetry/tracing'; | ||
import { WebTracerProvider } from '@opentelemetry/web'; | ||
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base'; | ||
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; | ||
import { CollectorTraceExporter } from '@opentelemetry/exporter-collector'; | ||
@@ -59,3 +59,3 @@ | ||
```js | ||
import { MeterProvider } from '@opentelemetry/metrics'; | ||
import { MeterProvider } from '@opentelemetry/sdk-metrics-base'; | ||
import { CollectorMetricExporter } from '@opentelemetry/exporter-collector'; | ||
@@ -84,3 +84,3 @@ const collectorOptions = { | ||
```js | ||
const { BasicTracerProvider, BatchSpanProcessor } = require('@opentelemetry/tracing'); | ||
const { BasicTracerProvider, BatchSpanProcessor } = require('@opentelemetry/sdk-trace-base'); | ||
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector'); | ||
@@ -112,3 +112,3 @@ | ||
```js | ||
const { MeterProvider } = require('@opentelemetry/metrics'); | ||
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base'); | ||
const { CollectorMetricExporter } = require('@opentelemetry/exporter-collector'); | ||
@@ -115,0 +115,0 @@ const collectorOptions = { |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
247964
4003
+ Added@opentelemetry/sdk-metrics-base@^0.25.1-alpha.21+0ef1fc28
+ Added@opentelemetry/sdk-trace-base@^0.25.1-alpha.21+0ef1fc28
+ Added@opentelemetry/api-metrics@0.25.00.25.1-alpha.21(transitive)
+ Added@opentelemetry/core@0.25.1-alpha.23(transitive)
+ Added@opentelemetry/resources@0.25.1-alpha.23(transitive)
+ Added@opentelemetry/sdk-metrics-base@0.25.1-alpha.23(transitive)
+ Added@opentelemetry/sdk-trace-base@0.25.1-alpha.23(transitive)
+ Added@opentelemetry/semantic-conventions@0.25.0(transitive)
- Removed@opentelemetry/api-metrics@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/core@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/metrics@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/resources@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/semantic-conventions@0.24.1-alpha.31(transitive)
- Removed@opentelemetry/tracing@0.24.1-alpha.31(transitive)