Skip to content

Commit

Permalink
pass connection_id to replication activity apm tags (#21949)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens authored Jan 27, 2023
1 parent bb0ce26 commit 0bf9f19
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ public TemporalResponse<StandardSyncOutput> submitSync(final long jobId, final i
.withState(config.getState())
.withResourceRequirements(config.getResourceRequirements())
.withSourceResourceRequirements(config.getSourceResourceRequirements())
.withDestinationResourceRequirements(config.getDestinationResourceRequirements());
.withDestinationResourceRequirements(config.getDestinationResourceRequirements())
.withConnectionId(connectionId)
.withWorkspaceId(config.getWorkspaceId());

return execute(jobRunConfig,
() -> getWorkflowStub(SyncWorkflow.class, TemporalJobType.SYNC).run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ properties:
description: The id of the workspace associated with this sync
type: string
format: uuid
connectionId:
description: The id of the connection associated with this sync
type: string
format: uuid
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public GeneratedJobInput getSyncWorkflowInput(final SyncInput input) {
.withResourceRequirements(config.getResourceRequirements())
.withSourceResourceRequirements(config.getSourceResourceRequirements())
.withDestinationResourceRequirements(config.getDestinationResourceRequirements())
.withConnectionId(standardSync.getConnectionId())
.withWorkspaceId(config.getWorkspaceId());

return new GeneratedJobInput(jobRunConfig, sourceLauncherConfig, destinationLauncherConfig, syncInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import static io.airbyte.metrics.lib.ApmTraceConstants.ACTIVITY_TRACE_OPERATION_NAME;
import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.ATTEMPT_NUMBER_KEY;
import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.CONNECTION_ID_KEY;
import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.DESTINATION_DOCKER_IMAGE_KEY;
import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.JOB_ID_KEY;
import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.REPLICATION_BYTES_SYNCED_KEY;
Expand Down Expand Up @@ -149,8 +150,12 @@ public StandardSyncOutput replicate(final JobRunConfig jobRunConfig,
final StandardSyncInput syncInput,
@Nullable final String taskQueue) {
final Map<String, Object> traceAttributes =
Map.of(ATTEMPT_NUMBER_KEY, jobRunConfig.getAttemptId(), JOB_ID_KEY, jobRunConfig.getJobId(), DESTINATION_DOCKER_IMAGE_KEY,
destinationLauncherConfig.getDockerImage(), SOURCE_DOCKER_IMAGE_KEY, sourceLauncherConfig.getDockerImage());
Map.of(
ATTEMPT_NUMBER_KEY, jobRunConfig.getAttemptId(),
CONNECTION_ID_KEY, syncInput.getConnectionId(),
JOB_ID_KEY, jobRunConfig.getJobId(),
DESTINATION_DOCKER_IMAGE_KEY, destinationLauncherConfig.getDockerImage(),
SOURCE_DOCKER_IMAGE_KEY, sourceLauncherConfig.getDockerImage());
ApmTraceUtils
.addTagsToTrace(traceAttributes);
if (isResetJob(sourceLauncherConfig.getDockerImage())) {
Expand Down

0 comments on commit 0bf9f19

Please sign in to comment.