Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.NET7.0] Update HttpClient instrumentation to enable activity creation using ActivitySource #3018

Closed
vishweshbankwar opened this issue Mar 10, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vishweshbankwar
Copy link
Member

vishweshbankwar commented Mar 10, 2022

Starting .NET7.0, HttpClient will be able to create activities using ActivitySource if there is a listener present. We need to update the instrumentation library to make use of this approach.

At present, due to legacy way of creating activity i.e. new Activity(OperationName), SDK and instrumentation library needs to perform extra operations such as running the sampler after the activity is created and setting TraceFlags, IsAllDataRecorded and Kind properties on activity. By adding HttpClient's activitySource to SDK's listener we can avoid all these extra operations.

Since this change will only be supported in apps targeting .NET7.0 and above, we will need to first detect the targetframework at runtime and take different code path accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants