diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index 8ed355e95a..144b5fee5b 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -278,6 +278,16 @@ private static void VisitStoreResponseStatistics( if (storeResponseStatistics.StoreResult != null) { + jsonWriter.WriteFieldName("ActivityId"); + if (storeResponseStatistics.StoreResult.ActivityId == null) + { + jsonWriter.WriteNullValue(); + } + else + { + jsonWriter.WriteStringValue(storeResponseStatistics.StoreResult.ActivityId); + } + jsonWriter.WriteFieldName("StoreResult"); jsonWriter.WriteStringValue(storeResponseStatistics.StoreResult.ToString()); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index 419a550fe8..a6c4cd071e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -348,6 +348,7 @@ "ResourceType": "Document", "OperationType": "Query", "LocationEndpoint": "http://someuri1.com/", + "ActivityId": "00000000-0000-0000-0000-000000000000", "StoreResult": "StorePhysicalAddress: http://storephysicaladdress.com/, LSN: 1337, GlobalCommittedLsn: 1234, PartitionKeyRangeId: 42, IsValid: True, StatusCode: 0, SubStatusCode: 0, RequestCharge: 3.14, ItemLSN: 15, SessionToken: 42, UsingLocalLSN: True, TransportException: null" } ] @@ -489,6 +490,7 @@ "ResourceType": "Database", "OperationType": "Create", "LocationEndpoint": null, + "ActivityId": null, "StoreResult": "StorePhysicalAddress: , LSN: 0, GlobalCommittedLsn: 0, PartitionKeyRangeId: , IsValid: False, StatusCode: 0, SubStatusCode: 0, RequestCharge: 0, ItemLSN: 0, SessionToken: , UsingLocalLSN: False, TransportException: null" } ]