[ 
https://issues.apache.org/jira/browse/HDDS-15552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18088652#comment-18088652
 ] 

Ethan Rose commented on HDDS-15552:
-----------------------------------

In the mean time, removing the metric annotation will resolve the issue:
{code}
diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java
index d5dab7800c..3387db5a5e 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java
@@ -180,7 +180,6 @@ public void addRatisEvent(String event) {
     }
   }
 
-  @Metric("Ratis state machine events")
   public String getRatisEvents() {
     synchronized (ratisEvents) {
       return String.join("\n", ratisEvents);
{code}

> Ratis events should not be published as metrics
> -----------------------------------------------
>
>                 Key: HDDS-15552
>                 URL: https://issues.apache.org/jira/browse/HDDS-15552
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Ethan Rose
>            Assignee: Wei-Chiu Chuang
>            Priority: Major
>
> HDDS-13133 started tracking Ratis events (arbitrary strings) as metrics. 
> These then get exposed over JMX and Prometheus. This completely prevents 
> Prometheus from scraping these endpoints because it fails when any of the 
> messages have invalid characters like " or \n. We can keep the list of events 
> in memory and maintain the web UI functionality without exposing it as a 
> metric.
> Additionally to verify this change, we should add an acceptance test call to 
> {{GET http://<prometheus-host>:9090/api/v1/targets}} and ensure that 
> {{health=up}} for each component to prevent future regressions like this.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to