Skip to content

Commit

Permalink
CosmosDiagnostics: Fixes Itrace regression which caused ActivityId to…
Browse files Browse the repository at this point in the history
… not get included (#2286)
  • Loading branch information
j82w authored Mar 9, 2021
1 parent e2016ed commit 65e22f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
Expand Down Expand Up @@ -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"
}
]
Expand Down

0 comments on commit 65e22f8

Please sign in to comment.