From 91a92b2b141c7a52306301265000b6dccdef4a1f Mon Sep 17 00:00:00 2001 From: James Hartig Date: Mon, 11 Sep 2017 21:15:02 -0400 Subject: [PATCH] Switch DELTA to gauge from counter A Counter is defined as a cumulative metric that only ever goes up. The DELTA value could go up or down depending on the minute of time and what is measured. --- README.md | 2 +- collectors/monitoring_collector.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c21c482..6ce08432 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Metrics gathered from Google Stackdriver Monitoring are converted to Prometheus 3. the metric type labels (see [Metrics List][metrics-list]) 4. the monitored resource labels (see [Monitored Resource Types][monitored-resources]) * For each timeseries, only the most recent data point is exported. -* Stackdriver `GAUGE` metric kinds are reported as Prometheus `Gauge` metrics; Stackdriver `DELTA` and `CUMULATIVE` metric kinds are reported as Prometheus `Counter` metrics. +* Stackdriver `GAUGE` and `DELTA` metric kinds are reported as Prometheus `Gauge` metrics; Stackdriver `CUMULATIVE` metric kinds are reported as Prometheus `Counter` metrics. * Only `BOOL`, `INT64`, `DOUBLE` and `DISTRIBUTION` metric types are supported, other types (`STRING` and `MONEY`) are discarded. * `DISTRIBUTION` metric type is reported as a Prometheus `Histogram`, except the `_sum` time series is not supported. diff --git a/collectors/monitoring_collector.go b/collectors/monitoring_collector.go index 22178f1e..f56dd95a 100644 --- a/collectors/monitoring_collector.go +++ b/collectors/monitoring_collector.go @@ -278,7 +278,7 @@ func (c *MonitoringCollector) reportTimeSeriesMetrics( case "GAUGE": metricValueType = prometheus.GaugeValue case "DELTA": - metricValueType = prometheus.CounterValue + metricValueType = prometheus.GaugeValue case "CUMULATIVE": metricValueType = prometheus.CounterValue default: