12
12
import datadog .trace .api .Trace ;
13
13
import io .airbyte .commons .features .FeatureFlags ;
14
14
import io .airbyte .commons .json .Jsons ;
15
+ import io .airbyte .commons .logging .MdcScope ;
15
16
import io .airbyte .commons .protocol .AirbyteMessageSerDeProvider ;
16
17
import io .airbyte .commons .protocol .AirbyteMessageVersionedMigratorFactory ;
17
18
import io .airbyte .commons .temporal .TemporalUtils ;
@@ -120,7 +121,8 @@ public Optional<String> runJob() throws Exception {
120
121
final AirbyteSource airbyteSource =
121
122
WorkerConstants .RESET_JOB_SOURCE_DOCKER_IMAGE_STUB .equals (sourceLauncherConfig .getDockerImage ()) ? new EmptyAirbyteSource (
122
123
featureFlags .useStreamCapableState ())
123
- : new DefaultAirbyteSource (sourceLauncher , getStreamFactory (sourceLauncherConfig .getProtocolVersion ()));
124
+ : new DefaultAirbyteSource (sourceLauncher ,
125
+ getStreamFactory (sourceLauncherConfig .getProtocolVersion (), DefaultAirbyteSource .CONTAINER_LOG_MDC_BUILDER ));
124
126
125
127
MetricClientFactory .initialize (MetricEmittingApps .WORKER );
126
128
final MetricClient metricClient = MetricClientFactory .getMetricClient ();
@@ -132,7 +134,8 @@ public Optional<String> runJob() throws Exception {
132
134
Math .toIntExact (jobRunConfig .getAttemptId ()),
133
135
airbyteSource ,
134
136
new NamespacingMapper (syncInput .getNamespaceDefinition (), syncInput .getNamespaceFormat (), syncInput .getPrefix ()),
135
- new DefaultAirbyteDestination (destinationLauncher , getStreamFactory (destinationLauncherConfig .getProtocolVersion ()),
137
+ new DefaultAirbyteDestination (destinationLauncher , getStreamFactory (destinationLauncherConfig .getProtocolVersion (),
138
+ DefaultAirbyteDestination .CONTAINER_LOG_MDC_BUILDER ),
136
139
new VersionedAirbyteMessageBufferedWriterFactory (serDeProvider , migratorFactory , destinationLauncherConfig .getProtocolVersion ())),
137
140
new AirbyteMessageTracker (),
138
141
new RecordSchemaValidator (WorkerUtils .mapStreamNamesToSchemas (syncInput )),
@@ -146,10 +149,10 @@ public Optional<String> runJob() throws Exception {
146
149
return Optional .of (Jsons .serialize (replicationOutput ));
147
150
}
148
151
149
- private AirbyteStreamFactory getStreamFactory (final Version protocolVersion ) {
152
+ private AirbyteStreamFactory getStreamFactory (final Version protocolVersion , final MdcScope . Builder mdcScope ) {
150
153
return protocolVersion != null
151
- ? new VersionedAirbyteStreamFactory <> (serDeProvider , migratorFactory , protocolVersion )
152
- : new DefaultAirbyteStreamFactory ();
154
+ ? new VersionedAirbyteStreamFactory (serDeProvider , migratorFactory , protocolVersion , mdcScope )
155
+ : new DefaultAirbyteStreamFactory (mdcScope );
153
156
}
154
157
155
158
}
0 commit comments