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

Allow Trace Samplers to Modify the Activity Trace State #65530

Merged
merged 2 commits into from
Feb 19, 2022

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Feb 17, 2022

Fixes #63652

@ghost ghost assigned tarekgh Feb 17, 2022
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Feb 17, 2022

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #63652

Author: tarekgh
Assignees: tarekgh
Labels:

area-System.Diagnostics.Tracing, new-api-needs-documentation

Milestone: -

@ghost
Copy link

ghost commented Feb 17, 2022

Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #63652

Author: tarekgh
Assignees: tarekgh
Labels:

new-api-needs-documentation, area-System.Diagnostics.Activity

Milestone: -

@tarekgh tarekgh added this to the 7.0.0 milestone Feb 17, 2022
@tarekgh
Copy link
Member Author

tarekgh commented Feb 17, 2022

@noahfalk could you please help reviewing this?

CC @ericstj for the System.Runtime.CompilerServices.IsExternalInit type forward.

CC @cijothomas @reyang

Copy link

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM : )

{
if (setTraceWithStringParent)
{
activityOptions = activityOptions with { TraceState = traceStateValueWithStringParent };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a design question... if I was a developer using an earlier version of the C# compiler, would I have any way to achieve the same result?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, to use this feature must use C# compiler version 10 or later. This is not the first feature we expose in the framework using this new syntax. System.Text.Json already using it a lot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume @reyang and @cijothomas are OK with this requirement? Effectively they will have to compile OpenTelemetry SDK with a compiler version >= 10.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. OpenTelemetry SDK uses 10

@tarekgh tarekgh merged commit 5d296d0 into dotnet:main Feb 19, 2022
@tarekgh tarekgh deleted the SupportTraceStateDuringSampling branch February 19, 2022 00:46
Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Samplers should be allowed to modify tracestate
5 participants