phet commented on code in PR #3841:
URL: https://github.com/apache/gobblin/pull/3841#discussion_r1416986052
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -313,10 +300,28 @@ protected void createMetrics() {
this.nullDagActionTypeMessagesMeter =
this.getMetricContext().contextAwareMeter(RuntimeMetrics.GOBBLIN_DAG_ACTION_STORE_MONITOR_NULL_DAG_ACTION_TYPE_MESSAGES);
this.produceToConsumeDelayMillis =
this.getMetricContext().newContextAwareGauge(RuntimeMetrics.GOBBLIN_DAG_ACTION_STORE_PRODUCE_TO_CONSUME_DELAY_MILLIS,
() -> produceToConsumeDelayValue);
this.getMetricContext().register(this.produceToConsumeDelayMillis);
+
+ // Setup proxy for launch submission metrics
+ this.ON_STARTUP = new
LaunchSubmissionMetricProxy(this.successfulLaunchSubmissionsOnStartup,
this.failedLaunchSubmissionsOnStartup);
+ this.POST_STARTUP = new
LaunchSubmissionMetricProxy(this.successfulLaunchSubmissions,
this.failedLaunchSubmissions);
Review Comment:
putting the initialization here means NPE during any invocation of
`submitFlowToDagManagerHelper` that may come prior.
if you can't rework, I suggest temporarily initializing these according to
the Null Pattern:
```
LaunchSubmissionMetricProxy ON_STARTUP = new LaunchSubmissionMetricProxy {
@Override public void markSuccess() { }
@Override public void markFailure() { }
}
```
--
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]