nada-attia commented on code in PR #18133:
URL: https://github.com/apache/hudi/pull/18133#discussion_r2805181794
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/versioning/v2/TimelineArchiverV2.java:
##########
@@ -125,14 +131,40 @@ public int archiveIfRequired(HoodieEngineContext context,
boolean acquireLock) t
} else {
log.info("No Instants to archive");
}
+ metrics.put(ArchivalMetrics.ARCHIVAL_STATUS, success ? 1L : -1L);
return instantsToArchive.size();
+ } catch (OutOfMemoryError oom) {
+ metrics.put(ArchivalMetrics.ARCHIVAL_OOM_FAILURE, 1L);
+ throw oom;
+ } catch (Exception e) {
+ String failureMetricName = String.join(".",
ArchivalMetrics.ARCHIVAL_FAILURE, e.getClass().getSimpleName());
+ metrics.put(failureMetricName, 1L);
+ throw e;
} finally {
if (acquireLock) {
txnManager.endStateChange(Option.empty());
}
}
}
+ @Override
+ public Map<String, Long> getMetrics() {
+ return metrics;
+ }
+
+ private void addArchivalCommitMetrics(List<ActiveAction> instantsToArchive) {
Review Comment:
moved this to ArchivalMetrics class
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/HoodieMetrics.java:
##########
@@ -360,6 +361,19 @@ public void updateArchiveMetrics(long durationInMs, int
numInstantsArchived) {
}
}
+ public void updateArchivalMetrics(Map<String, Long> archivalMetrics) {
+ if (config.isMetricsOn()) {
+ log.info(String.format("Sending archival metrics %s", archivalMetrics));
+ archivalMetrics.forEach((metricName, metricValue) ->
metrics.registerGauge(getMetricsName("archival", metricName), metricValue));
+ }
+ }
+
+ public void emitCleanFailure() {
Review Comment:
removed
--
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]