Skip to content

Add remaining System.Net.Http Telemetry #40838

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

Merged
merged 4 commits into from
Aug 16, 2020

Conversation

MihaZupan
Copy link
Member

@MihaZupan MihaZupan commented Aug 14, 2020

Adds the following events:

  • Http11ConnectionEstablished
  • Http11ConnectionClosed
  • Http20ConnectionEstablished
  • Http20ConnectionClosed
  • Http11RequestLeftQueue
  • ResponseHeadersBegin

Adds the following counters:

  • http11-connections-current-total
  • http20-connections-current-total
  • http11-requests-queue-duration

Contributes to #37428

@MihaZupan MihaZupan added this to the 5.0.0 milestone Aug 14, 2020
@MihaZupan MihaZupan requested a review from a team August 14, 2020 13:49
@ghost
Copy link

ghost commented Aug 14, 2020

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

@ghost
Copy link

ghost commented Aug 14, 2020

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

@MihaZupan
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

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

I got up until HttpConnection. So far looks good, just some questions.
I will finish tomorrow unless somebody else takes over.

@@ -148,6 +157,8 @@ public Http2Connection(HttpConnectionPool pool, Connection connection)
}
}

~Http2Connection() => Dispose();
Copy link
Member

Choose a reason for hiding this comment

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

Q: Do we really need this?
Http2Connection is internal. Do we have complete control over its life-cycle or not? If yes, we should be Disposing properly already.

Copy link
Member Author

@MihaZupan MihaZupan Aug 16, 2020

Choose a reason for hiding this comment

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

We have complete ownership of it at all times, but it's not guaranteed that Dispose will ever be called if the HttpClient/Handler is never disposed of as there is no finalizer higher up in the chain.

We could instead introduce a finalizer higher in the chain (for example on ConnectionPoolManager) to avoid having one per Http2Connection, but such a finalizer isn't needed for any other use-case / for HTTP/1 at the moment afaik.

Copy link
Contributor

@scalablecory scalablecory 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

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

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

LGTM

_totalHttp20StreamsCounter ??= new PollingCounter("http20-streams-current-total", this, () => Interlocked.Read(ref _openedHttp20Streams))
{
DisplayName = "Current Http 2.0 Streams"
};
Copy link
Member

Choose a reason for hiding this comment

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

An HTTP/2 stream is the same as a request. Do we need this counter? And if so, what's the 1.1 equivalent?

Copy link
Member Author

Choose a reason for hiding this comment

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

I see this counter isn't actually listed in David's tracking issue (#37428), removed.

I added it coming from discussions around the usefulness of "single-pool-max" counters in #38686.

I realize such counters ("http11-current", "http20-current") can be implemented in a much simpler manner than was done in this PR, as we already have guarantees around Start/Stop being called on an HttpRequestMessage exactly once and we have the version info available there.

Copy link
Member

Choose a reason for hiding this comment

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

I see this counter isn't actually listed in David's tracking issue

Are there others you added that weren't previously discussed and should be removed, too?

@MihaZupan
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MihaZupan
Copy link
Member Author

Regex and X509Cert test failures unrelated.

@MihaZupan MihaZupan merged commit 1382a34 into dotnet:master Aug 16, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
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.

4 participants