jbonofre commented on code in PR #337:
URL: https://github.com/apache/karaf-decanter/pull/337#discussion_r1853644847


##########
pom.xml:
##########
@@ -538,6 +538,7 @@
                                 <exclude>**/*.svg</exclude>
                                 <exclude>**/*.less</exclude>
                                 <exclude>**/build.txt</exclude>
+                                <exclude>**/sample.txt</exclude>

Review Comment:
   OK fair enough.



##########
collector/prometheus/src/main/java/org/apache/karaf/decanter/collector/prometheus/PrometheusCollector.java:
##########
@@ -71,28 +73,39 @@ public void activate(Dictionary<String, Object> properties) 
throws Exception {
     public void run() {
         try {
             URLConnection connection = prometheusURL.openConnection();
-            Map<String, Object> data = new HashMap<>();
-            data.put("type", "prometheus");
+            String topic = (properties.get(EventConstants.EVENT_TOPIC) != 
null) ? (String) properties.get(EventConstants.EVENT_TOPIC) : 
"decanter/collect/prometheus";

Review Comment:
   Just a reminder:  it's possible to override via configuration, in 
`etc/org.apache.karaf.decanter.collector.prometheus.cfg`:
   
   ```
   event.topics=/foo/bar
   ```
   
   It's documented here 
https://karaf.apache.org/manual/decanter/latest-2/html/#_alerters in the "Using 
existing appenders".



##########
collector/prometheus/src/main/java/org/apache/karaf/decanter/collector/prometheus/PrometheusCollector.java:
##########
@@ -71,28 +73,39 @@ public void activate(Dictionary<String, Object> properties) 
throws Exception {
     public void run() {
         try {
             URLConnection connection = prometheusURL.openConnection();
-            Map<String, Object> data = new HashMap<>();
-            data.put("type", "prometheus");
+            String topic = (properties.get(EventConstants.EVENT_TOPIC) != 
null) ? (String) properties.get(EventConstants.EVENT_TOPIC) : 
"decanter/collect/prometheus";
+            String type = (properties.get("type") != null) ? (String) 
properties.get("type") : "prometheus";

Review Comment:
   Same, already possible.
   
   That said, I think it's important to have consistency in `type`, so why not 
having hardcoded `type` here.



##########
collector/prometheus/src/test/resources/sample.txt:
##########
@@ -1,27 +1,13 @@
-<!--

Review Comment:
   rat won't be happy without the ASF header here, or we have to exclude it.



-- 
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]

Reply via email to