Skip to content

Commit

Permalink
Avoid NPE when adding connection ID to trace (airbytehq#18856)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpgrailsdev authored and drewrasm committed Nov 2, 2022
1 parent d830b27 commit 0153cfa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,10 @@ public WorkflowState getState() {
@Trace(operationName = WORKFLOW_TRACE_OPERATION_NAME)
@Override
public JobInformation getJobInformation() {
traceConnectionId();
final Long jobId = workflowInternalState.getJobId() != null ? workflowInternalState.getJobId() : NON_RUNNING_JOB_ID;
final Integer attemptNumber = workflowInternalState.getAttemptNumber();
ApmTraceUtils.addTagsToTrace(Map.of(CONNECTION_ID_KEY, connectionId, JOB_ID_KEY, jobId));
ApmTraceUtils.addTagsToTrace(Map.of(JOB_ID_KEY, jobId));
return new JobInformation(
jobId,
attemptNumber == null ? NON_RUNNING_ATTEMPT_ID : attemptNumber);
Expand Down

0 comments on commit 0153cfa

Please sign in to comment.