autumnust commented on a change in pull request #2967:
URL: https://github.com/apache/incubator-gobblin/pull/2967#discussion_r415419227
##########
File path:
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
##########
@@ -309,9 +322,22 @@ public void start() {
// Start metric reporting
if (this.containerMetrics.isPresent()) {
- this.containerMetrics.get()
-
.startMetricReportingWithFileSuffix(ConfigUtils.configToState(this.clusterConfig),
- this.taskRunnerId);
+ try {
+ this.containerMetrics.get()
+
.startMetricReportingWithFileSuffix(ConfigUtils.configToState(this.clusterConfig),
this.taskRunnerId);
+ } catch (MetricReporterException e) {
+ logger.error("Failed to start {} metric reporter", e.getType().name(),
e);
+ if (this.isMetricReportingFailureFatal) {
+ logger.error("Failing TaskRunner since metric reporting failure is
FATAL.");
+ Throwables.propagate(e);
Review comment:
Shall we avoid logging + throwing exception if failure is fatal? This
might make the stack trace hard to read.
##########
File path:
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactor.java
##########
@@ -364,7 +366,13 @@ private GobblinMetrics initializeMetrics() {
tags.addAll(Tag.fromMap(ClusterNameTags.getClusterNameTags()));
GobblinMetrics gobblinMetrics =
GobblinMetrics.get(this.state.getProp(ConfigurationKeys.JOB_NAME_KEY),
null, tags.build());
- gobblinMetrics.startMetricReporting(this.state.getProperties());
+ try {
Review comment:
Just FYI, this file is deprecated and not being used anywhere internally
AFAIK.
##########
File path:
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
##########
@@ -309,9 +322,22 @@ public void start() {
// Start metric reporting
if (this.containerMetrics.isPresent()) {
Review comment:
Can this be packaged into a method like `initMetricReporter` ? And
`isMetricReportingFailureFatal `, `isEventReportingFailureFatal ` are all local
variables that only relevant to this part. We just need to pass `clusterConfig`
to init method.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]