From f4340ed85ec0ef18c459b4bda77fd310f5bd5b7b Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Tue, 12 Jul 2022 10:40:30 +0200 Subject: [PATCH] Rename PrometheusExporter properties --- .../server/lib/prometheus_exporter.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/monitoring_collection/server/lib/prometheus_exporter.ts b/x-pack/plugins/monitoring_collection/server/lib/prometheus_exporter.ts index f1d2d1ffd4fb3..fc4359609bf34 100644 --- a/x-pack/plugins/monitoring_collection/server/lib/prometheus_exporter.ts +++ b/x-pack/plugins/monitoring_collection/server/lib/prometheus_exporter.ts @@ -14,19 +14,19 @@ import { import { KibanaResponseFactory } from '@kbn/core/server'; export class PrometheusExporter extends MetricReader { - private readonly _prefix?: string; - private readonly _appendTimestamp: boolean; - private _serializer: PrometheusSerializer; + private readonly prefix?: string; + private readonly appendTimestamp: boolean; + private serializer: PrometheusSerializer; constructor(config: ExporterConfig = {}) { super(); - this._prefix = config.prefix || OpenTelemetryPrometheusExporter.DEFAULT_OPTIONS.prefix; - this._appendTimestamp = + this.prefix = config.prefix || OpenTelemetryPrometheusExporter.DEFAULT_OPTIONS.prefix; + this.appendTimestamp = typeof config.appendTimestamp === 'boolean' ? config.appendTimestamp : OpenTelemetryPrometheusExporter.DEFAULT_OPTIONS.appendTimestamp; - this._serializer = new PrometheusSerializer(this._prefix, this._appendTimestamp); + this.serializer = new PrometheusSerializer(this.prefix, this.appendTimestamp); } selectAggregationTemporality(): AggregationTemporality { @@ -54,7 +54,7 @@ export class PrometheusExporter extends MetricReader { body: `PrometheusExporter: Metrics collection errors ${errors}`, }); } - const result = this._serializer.serialize(resourceMetrics); + const result = this.serializer.serialize(resourceMetrics); if (result === '') { return res.noContent(); }