EdColeman commented on code in PR #3297:
URL: https://github.com/apache/accumulo/pull/3297#discussion_r1168769353
##########
test/src/main/java/org/apache/accumulo/test/metrics/MetricsIT.java:
##########
@@ -158,4 +174,25 @@ public void registerMetrics(MeterRegistry registry) {
// unused; this class only extends MetricsProducer to easily reference its
methods/constants
}
+ @Test
+ public void metricTags() throws Exception {
+
+ doWorkToGenerateMetrics();
+ cluster.stop();
+
+ List<String> statsDMetrics;
+
+ // loop until we run out of lines or until we see all expected metrics
+ while (!(statsDMetrics = sink.getLines()).isEmpty()) {
+ statsDMetrics.stream().filter(line -> line.startsWith("accumulo"))
+ .map(TestStatsDSink::parseStatsDMetric).forEach(a -> {
+ var t = a.getTags();
+ log.trace("METRICS, name: '{}' num tags: {}, tags: {}",
a.getName(), t.size(), t);
+ // check hostname is always set and is valid
+ assertNotEquals("0.0.0.0", a.getTags().get("host"));
+ // check the length of the tag value is sane
+ a.getTags().forEach((k, v) -> assertTrue(v.length() < 128));
Review Comment:
addressed in aed77f8e67
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]