From 10b9205e5a7723be15d9200fab1ce5a5b792074e Mon Sep 17 00:00:00 2001 From: Marcel May Date: Wed, 29 Jul 2020 11:27:50 +0200 Subject: [PATCH] Change fsimage_exporter_app_info to fsimage_exporter_build_info (fixes #32) --- README.md | 6 +++--- .../m3y/prometheus/exporter/fsimage/BuildInfoExporter.java | 2 +- .../prometheus/exporter/fsimage/BuildInfoExporterTest.java | 2 +- .../de/m3y/prometheus/exporter/fsimage/WebServerIT.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ae47814..f3bfeb5 100644 --- a/README.md +++ b/README.md @@ -357,9 +357,9 @@ fsimage_replication_sum 22.0 fsimage_user_blocks{user_name="foo",} 2.0 fsimage_user_blocks{user_name="root",} 1.0 fsimage_user_blocks{user_name="mm",} 14.0 -# HELP fsimage_exporter_app_info Application build info -# TYPE fsimage_exporter_app_info gauge -fsimage_exporter_app_info{appName="fsimage_exporter",appVersion="1.1-SNAPSHOT",buildTime="2017-10-17/19:13",buildScmVersion="491d70f88c6bc96c6a0d19fca27af07519534782",buildScmBranch="master",} 1.0 +# HELP fsimage_exporter_build_info Application build info +# TYPE fsimage_exporter_build_info gauge +fsimage_exporter_build_info{appName="fsimage_exporter",appVersion="1.1-SNAPSHOT",buildTime="2017-10-17/19:13",buildScmVersion="491d70f88c6bc96c6a0d19fca27af07519534782",buildScmBranch="master",} 1.0 # HELP fsimage_scrape_requests_total Exporter requests made # TYPE fsimage_scrape_requests_total counter fsimage_scrape_requests_total 2.0 diff --git a/src/main/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporter.java b/src/main/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporter.java index d22ad41..f874051 100644 --- a/src/main/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporter.java +++ b/src/main/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporter.java @@ -22,7 +22,7 @@ public BuildInfoExporter(String metricPrefix, String appName) { super(); this.appName = appName; - metricFamily = new GaugeMetricFamily(metricPrefix + "app_info", + metricFamily = new GaugeMetricFamily(metricPrefix + "build_info", "Application build info", Arrays.asList("appName", "appVersion", "buildTime", "buildScmVersion", "buildScmBranch")); metricFamily.addMetric( diff --git a/src/test/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporterTest.java b/src/test/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporterTest.java index 67a0c56..ecd9478 100644 --- a/src/test/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporterTest.java +++ b/src/test/java/de/m3y/prometheus/exporter/fsimage/BuildInfoExporterTest.java @@ -14,7 +14,7 @@ public class BuildInfoExporterTest { public void testCollect() { BuildInfoExporter buildInfoExporter = new BuildInfoExporter("my_fsimage_", "foo"); final List collect = buildInfoExporter.collect(); - assertThat(getMetricFamilySamples(collect, "my_fsimage_app_info")) + assertThat(getMetricFamilySamples(collect, "my_fsimage_build_info")) .hasTypeOfGauge() .hasSampleLabelNames("appName", "appVersion", "buildTime", "buildScmVersion", "buildScmBranch") .hasSampleValue(Arrays.asList( diff --git a/src/test/java/de/m3y/prometheus/exporter/fsimage/WebServerIT.java b/src/test/java/de/m3y/prometheus/exporter/fsimage/WebServerIT.java index 9e8df62..74de89c 100644 --- a/src/test/java/de/m3y/prometheus/exporter/fsimage/WebServerIT.java +++ b/src/test/java/de/m3y/prometheus/exporter/fsimage/WebServerIT.java @@ -78,7 +78,7 @@ public void testMetrics() throws Exception { // App info assertThat(body) - .contains("fsimage_exporter_app_info{appName=\"fsimage_exporter\",appVersion=\"") + .contains("fsimage_exporter_build_info{appName=\"fsimage_exporter\",appVersion=\"") .contains("fsimage_scrape_requests_total ") .contains("fsimage_compute_stats_duration_seconds_count ") .contains("fsimage_compute_stats_duration_seconds_sum ")