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

Validate that library scope is present when using ForwardClientCalls #28469

Merged

Conversation

JoshLove-msft
Copy link
Member

Fixes #11966

@azure-sdk
Copy link
Collaborator

API change check for Azure.Core

API changes are not detected in this pull request for Azure.Core

@JoshLove-msft JoshLove-msft merged commit ed3439e into Azure:main Apr 30, 2022
@@ -209,9 +209,14 @@ internal static async ValueTask<T> ValidateDiagnosticScope<T>(Func<ValueTask<(T
}
else
{
if (!diagnosticListener.Scopes.Any())
// If ForwardsClientCallsAttribute is being used on the method, we don't know what the name of the scope should be because there could be many
Copy link
Member

Choose a reason for hiding this comment

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

Why are Azure.Core scopes created? Scopes are supposed to correspond to customer calls of public methods. Or are these the inner HTTP scopes?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could defined "The Azure.Core scope?"

Copy link
Member

Choose a reason for hiding this comment

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

Per #27828 (comment), perhaps we could call the "nested HTTP scopes"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why are Azure.Core scopes created? Scopes are supposed to correspond to customer calls of public methods. Or are these the inner HTTP scopes?

Azure.Core creates scopes for outgoing requests - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/Pipeline/Internal/RequestActivityPolicy.cs#L57

Copy link
Member Author

Choose a reason for hiding this comment

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

, perhaps we could call the "nested HTTP scopes"?

I'm not sure what this comment is referring to.

Copy link
Member

Choose a reason for hiding this comment

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

there should be some scope created other than the Azure.Core scope.

It's a nit, but in the distributed tracing guidelines, I've heard these referred to as the "nested HTTP/REST spans", and never as Azure.Core scopes, see https://azure.github.io/azure-sdk/general_implementation.html#distributed-tracing

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I see. That is a fair point.

paterasMSFT pushed a commit that referenced this pull request Jun 15, 2022
…28469)

* Validate that library scope is present when using ForwardClientCalls

* Fix comment

* Management tests

* fix

* PR fb

* space

* Remove duplicate braces
zhihaoxue pushed a commit to zhihaoxue/azure-sdk-for-net that referenced this pull request Jul 27, 2022
…zure#28469)

* Validate that library scope is present when using ForwardClientCalls

* Fix comment

* Management tests

* fix

* PR fb

* space

* Remove duplicate braces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test for diagnostic scope doesn't seem to fail if there is no diagnostic scope
4 participants