errose28 commented on code in PR #10034:
URL: https://github.com/apache/ozone/pull/10034#discussion_r3406654507
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java:
##########
@@ -155,6 +171,22 @@ public void decrContainerStat(ContainerStat deltaStat) {
this.containerReportWriteCount.incr(-1 * deltaStat.getWriteCount().get());
}
+ public void addRatisEvent(String event) {
+ synchronized (ratisEvents) {
+ if (ratisEvents.size() >= maxRatisEvents) {
+ ratisEvents.removeFirst();
+ }
+ ratisEvents.add(Time.formatTime(Time.now()) + "|" + event);
+ }
+ }
+
+ @Metric("Ratis state machine events")
+ public String getRatisEvents() {
+ synchronized (ratisEvents) {
+ return String.join("\n", ratisEvents);
Review Comment:
Newlines are invalid separators in Prometheus. This change prevents all SCM
metrics from being ingested into Prometheus. @jojochuang we should:
- Convert this to a different separator like `|`
- Add a command to our acceptance tests to check that all nodes' Prometheus
instances have registered metrics.
- Probably `GET http://localhost:9090/api/v1/targets` and ensure that
`health=up` for each component.
<img width="1855" height="251" alt="Image"
src="https://github.com/user-attachments/assets/12439069-f0ce-4460-9328-2e7239150ccf"
/>
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]