diff --git a/packages/opentelemetry-exporter-prometheus/package.json b/packages/opentelemetry-exporter-prometheus/package.json index 25470d4c28..cc7b480e1a 100644 --- a/packages/opentelemetry-exporter-prometheus/package.json +++ b/packages/opentelemetry-exporter-prometheus/package.json @@ -55,6 +55,6 @@ "@opentelemetry/api": "^0.8.3", "@opentelemetry/core": "^0.8.3", "@opentelemetry/metrics": "^0.8.3", - "prom-client": "^11.5.3" + "prom-client": "^12.0.0" } } diff --git a/packages/opentelemetry-exporter-prometheus/src/prometheus.ts b/packages/opentelemetry-exporter-prometheus/src/prometheus.ts index 84c2fed821..0e00b1651b 100644 --- a/packages/opentelemetry-exporter-prometheus/src/prometheus.ts +++ b/packages/opentelemetry-exporter-prometheus/src/prometheus.ts @@ -14,11 +14,7 @@ * limitations under the License. */ -import { - ExportResult, - NoopLogger, - hrTimeToMilliseconds, -} from '@opentelemetry/core'; +import { ExportResult, NoopLogger } from '@opentelemetry/core'; import { CounterSumAggregator, LastValue, @@ -31,7 +27,7 @@ import { } from '@opentelemetry/metrics'; import * as api from '@opentelemetry/api'; import { createServer, IncomingMessage, Server, ServerResponse } from 'http'; -import { Counter, Gauge, labelValues, Metric, Registry } from 'prom-client'; +import { Counter, Gauge, LabelValues, Metric, Registry } from 'prom-client'; import * as url from 'url'; import { ExporterConfig } from './export/types'; @@ -140,7 +136,6 @@ export class PrometheusExporter implements MetricExporter { metric.inc( labelValues, point.value as Sum, - hrTimeToMilliseconds(point.timestamp) ); } @@ -151,7 +146,6 @@ export class PrometheusExporter implements MetricExporter { metric.set( labelValues, point.value as LastValue, - hrTimeToMilliseconds(point.timestamp) ); } } @@ -160,7 +154,7 @@ export class PrometheusExporter implements MetricExporter { } private _getLabelValues(keys: string[], labels: api.Labels) { - const labelValues: labelValues = {}; + const labelValues: LabelValues = {}; for (let i = 0; i < keys.length; i++) { if (labels[keys[i]] !== null) { labelValues[keys[i]] = labels[keys[i]];