You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2022/05/04 22:19:23 UTC
[GitHub] [gobblin] Will-Lo commented on a diff in pull request #3500: [GOBBLIN-1639] Prevent metrics reporting if configured, clean up workunit count metric
Will-Lo commented on code in PR #3500:
URL: https://github.com/apache/gobblin/pull/3500#discussion_r865430576
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java:
##########
@@ -685,8 +674,23 @@ public void apply(JobListener jobListener, JobContext jobContext)
}
}
} finally {
- // Stop metrics reporting
+ // Register metrics then stop metrics reporting, metrics will flush and emit when the metricsContext is closed
if (this.jobContext.getJobMetricsOptional().isPresent()) {
+ if (jobState.getPropAsBoolean(ConfigurationKeys.GOBBLIN_OUTPUT_JOB_LEVEL_METRICS, true)) {
+ String workunitCreationGaugeName = MetricRegistry.name(ServiceMetricNames.GOBBLIN_JOB_METRICS_PREFIX,
+ TimingEvent.LauncherTimings.WORK_UNITS_CREATION, jobState.getJobName());
+ long workUnitsCreationTime = workUnitsCreationTimer.getDuration() / TimeUnit.SECONDS.toMillis(1);
+ ContextAwareGauge<Integer> workunitCreationGauge = this.runtimeMetricContext.get()
+ .newContextAwareGauge(workunitCreationGaugeName, () -> (int) workUnitsCreationTime);
+ this.runtimeMetricContext.get().register(workunitCreationGaugeName, workunitCreationGauge);
+
+ String workunitCountGaugeName = MetricRegistry.name(ServiceMetricNames.GOBBLIN_JOB_METRICS_PREFIX,
Review Comment:
I think the old workunit count name wasn't being actively used according to SRE since it was being emitted by multiple hosts.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org