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

Add current-outgoing-connect-attempts counter to Sockets #66651

Merged
merged 4 commits into from
May 18, 2022

Conversation

MihaZupan
Copy link
Member

Followup from #66605 (comment).

We have current-requests for HTTP, current-tls-handshakes for Security, and current-dns-lookups for name resolution, but we only have totals for Sockets.
current-outgoing-connect-attempts (feel free to suggest better names) would be the Sockets counterpart.

We also have httpXX-connections-current-total, tlsXX-sessions-open and dns-lookups-requested counters.
Any thoughts on adding something like that for Sockets (as in number of currently connected sockets for the process)?
Note that we don't currently distinguish between types of socket when counting outgoing-connections-established, even UDP socket connects count.

@MihaZupan MihaZupan added this to the 7.0.0 milestone Mar 15, 2022
@ghost ghost assigned MihaZupan Mar 15, 2022
@ghost
Copy link

ghost commented Mar 15, 2022

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

Issue Details

Followup from #66605 (comment).

We have current-requests for HTTP, current-tls-handshakes for Security, and current-dns-lookups for name resolution, but we only have totals for Sockets.
current-outgoing-connect-attempts (feel free to suggest better names) would be the Sockets counterpart.

We also have httpXX-connections-current-total, tlsXX-sessions-open and dns-lookups-requested counters.
Any thoughts on adding something like that for Sockets (as in number of currently connected sockets for the process)?
Note that we don't currently distinguish between types of socket when counting outgoing-connections-established, even UDP socket connects count.

Author: MihaZupan
Assignees: -
Labels:

area-System.Net.Sockets

Milestone: 7.0.0

@MihaZupan MihaZupan requested a review from a team March 15, 2022 12:13
@@ -216,11 +216,11 @@ private void AfterConnectAcceptTelemetry()
switch (LastOperation)
{
case SocketAsyncOperation.Accept:
SocketsTelemetry.Log.AfterAccept(SocketError);
SocketsTelemetry.AfterAccept(SocketError);
Copy link
Member

Choose a reason for hiding this comment

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

Don't these changes mean we'll no longer be able to trim out as much as we otherwise would have if EventSource trimming is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, though all the core event logic is still guarded by IsEnabled checks.
What may now remain are the Interlocked calls mentioned above and this switch method.

If we wanted those to be trimmed out completely, I think we should expose the EventSource.IsSupported flag instead (currently internal), as that is what we actually care about here, not whether someone is listening at this exact moment.
Since IsEnabled can toggle between on/off, it can't be used the same way without complicating the calling logic.

@MihaZupan
Copy link
Member Author

@stephentoub Besides the static vs. non-static differences, is there something that should change here, or are we okay with the current approach?

@MihaZupan
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MihaZupan
Copy link
Member Author

@stephentoub can you please take a look at this one again?

I've changed it back to using non-static methods/fields for consistency.
Your comment about being able to trim less is still valid, but do you think something should be changed as part of this PR?

@MihaZupan
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MihaZupan
Copy link
Member Author

This test failure is related, looking into it ...

@MihaZupan
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MihaZupan
Copy link
Member Author

Networking failures are #69432 and #69493

@MihaZupan MihaZupan merged commit 0a62b65 into dotnet:main May 18, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 17, 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.

3 participants