From f536857ac6fe8f4a22598fe048244aed78154a99 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Sun, 24 Dec 2017 11:54:33 +0100 Subject: [PATCH] Fix e2e tests after textfile custom timestamp removal (#768) --- collector/fixtures/e2e-output.txt | 4 ++-- collector/textfile.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index ca6c1c2a..41b3f162 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt @@ -3307,7 +3307,7 @@ testmetric1_1{foo="bar"} 10 testmetric1_2{foo="baz"} 20 # HELP testmetric2_1 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_1 untyped -testmetric2_1{foo="bar"} 30 1441205977284 +testmetric2_1{foo="bar"} 30 # HELP testmetric2_2 Metric read from collector/fixtures/textfile/two_metric_files/metrics2.prom # TYPE testmetric2_2 untyped -testmetric2_2{foo="baz"} 40 1441205977284 +testmetric2_2{foo="baz"} 40 diff --git a/collector/textfile.go b/collector/textfile.go index 728dbc8e..7922000f 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -77,6 +77,10 @@ func convertMetricFamily(metricFamily *dto.MetricFamily, ch chan<- prometheus.Me } for _, metric := range metricFamily.Metric { + if metric.TimestampMs != nil { + log.Warnf("Ignoring unsupported custom timestamp on textfile collector metric %v", metric) + } + labels := metric.GetLabel() var names []string var values []string