Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ private void EnsureSerialized()
string currentActivityId = null;
string traceState = null;
Activity currentActivity = Activity.Current;
if (currentActivity != null && currentActivity.IsW3CFormat())
if (currentActivity != null && (currentActivity.IdFormat == ActivityIdFormat.W3C))
{
currentActivityId = currentActivity.Id;
traceState = currentActivity.GetTraceState();
traceState = currentActivity.TraceStateString;
}

foreach (CloudEvent cloudEvent in _cloudEvents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task SetsTraceParentExtension(bool inclTraceparent, bool inclTraces

// simulating some other activity already being started before doing operations with the client
var activity = new Activity("ParentEvent");
activity.SetW3CFormat();
activity.SetIdFormat(ActivityIdFormat.W3C);
activity.Start();
activity.TraceStateString = "tracestatevalue";
List<CloudEvent> eventsList = new List<CloudEvent>();
Expand Down Expand Up @@ -135,7 +135,7 @@ public async Task DoesNotSetTraceParentExtensionWhenTracingIsDisabled()

// simulating some other activity already being started before doing operations with the client
var activity = new Activity("ParentEvent");
activity.SetW3CFormat();
activity.SetIdFormat(ActivityIdFormat.W3C);
activity.Start();

CloudEvent cloudEvent = new CloudEvent(
Expand Down Expand Up @@ -195,7 +195,7 @@ public async Task SetsTraceParentExtensionRetries(bool inclTraceparent, bool inc

// simulating some other activity already being started before doing operations with the client
var activity = new Activity("ParentEvent");
activity.SetW3CFormat();
activity.SetIdFormat(ActivityIdFormat.W3C);
activity.Start();
activity.TraceStateString = "tracestatevalue";
List<CloudEvent> eventsList = new List<CloudEvent>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ private static async Task<Response> SendCloudEventsInternalAsync(
string activityId = null;
string traceState = null;
Activity currentActivity = Activity.Current;
if (currentActivity != null && currentActivity.IsW3CFormat())
if (currentActivity != null && (currentActivity.IdFormat == ActivityIdFormat.W3C))
{
activityId = currentActivity.Id;
traceState = currentActivity.GetTraceState();
traceState = currentActivity.TraceStateString;
}

using var stream = new MemoryStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public async Task SetsTraceParentExtension(bool inclTraceparent, bool inclTraces
new AzureKeyCredential("fakeKey"),
options);
var activity = new Activity($"{nameof(EventGridPublisherClient)}.{nameof(EventGridPublisherClient.SendEvents)}");
activity.SetW3CFormat();
activity.SetIdFormat(ActivityIdFormat.W3C);
activity.Start();
List<CloudEvent> inputEvents = new List<CloudEvent>();
for (int i = 0; i < 10; i++)
Expand Down