Skip to content

Commit b316f44

Browse files
committed
chore: add connection id tag to state persistence traces (#16960)
1 parent dd3d5a9 commit b316f44

File tree

1 file changed

+4
-0
lines changed
  • airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers

1 file changed

+4
-0
lines changed

airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/StateHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
import io.airbyte.commons.server.errors.SyncIsRunningException;
1212
import io.airbyte.config.StateWrapper;
1313
import io.airbyte.config.persistence.StatePersistence;
14+
import io.airbyte.metrics.lib.ApmTraceUtils;
15+
import io.airbyte.metrics.lib.MetricTags;
1416
import jakarta.inject.Singleton;
1517
import java.io.IOException;
18+
import java.util.Map;
1619
import java.util.Optional;
1720
import java.util.UUID;
1821

@@ -38,6 +41,7 @@ public ConnectionState getState(final ConnectionIdRequestBody connectionIdReques
3841

3942
public ConnectionState createOrUpdateState(final ConnectionStateCreateOrUpdate connectionStateCreateOrUpdate) throws IOException {
4043
final UUID connectionId = connectionStateCreateOrUpdate.getConnectionId();
44+
ApmTraceUtils.addTagsToTrace(Map.of(MetricTags.CONNECTION_ID, connectionId));
4145

4246
final StateWrapper convertedCreateOrUpdate = StateConverter.toInternal(connectionStateCreateOrUpdate.getConnectionState());
4347
statePersistence.updateOrCreateState(connectionId, convertedCreateOrUpdate);

0 commit comments

Comments
 (0)