diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java index 019442df1911..2582eee235a5 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java @@ -259,8 +259,6 @@ public void jobSuccessWithAttemptNumber(final JobSuccessInputWithAttemptNumber i @Override public void jobFailure(final JobFailureInput input) { try { - ApmTraceUtils.addTagsToTrace(Map.of(JOB_ID_KEY, input.getJobId())); - final long jobId = input.getJobId(); jobPersistence.failJob(jobId); final Job job = jobPersistence.getJob(jobId); @@ -269,6 +267,7 @@ public void jobFailure(final JobFailureInput input) { emitJobIdToReleaseStagesMetric(OssMetricsRegistry.JOB_FAILED_BY_RELEASE_STAGE, jobId); final UUID connectionId = UUID.fromString(job.getScope()); + ApmTraceUtils.addTagsToTrace(Map.of(CONNECTION_ID_KEY, connectionId, JOB_ID_KEY, jobId)); final JobSyncConfig jobSyncConfig = job.getConfig().getSync(); final SyncJobReportingContext jobContext = new SyncJobReportingContext(jobId, jobSyncConfig.getSourceDockerImage(), jobSyncConfig.getDestinationDockerImage());