Repository navigation
[HTTP] Share observable metrics per meter - #136493
Open
asad24-dev wants to merge 1 commit into
Open
asad24-dev wants to merge 1 commit into
asad24-dev wants to merge 1 commit into
Conversation
Observable HTTP instruments are not cached by Meter, so each handler registers additional callbacks on the shared meter. Share the instruments and their trackers per meter instead. Fixes dotnet#136418
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
Contributor
|
@asad24-dev, if you're interested in working on this, please take a look at my changes in #136849. Your current PR is failing the build and tests for WASI. Adding a lock here seems excessive. Please backport my changes, and I'll close my PR. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #136418.
Summary
Each
SocketsHttpHandlercurrently creates separatehttp.client.active_requestsandhttp.client.open_connectionsobservable instruments, even when the handlers share a meter. Since observable instruments are not cached byMeter, this registers additional callbacks for each handler.This change shares the observable instruments and their trackers per meter. Instrument initialization is synchronized to avoid duplicate registrations when handlers are created concurrently.
The existing metric names, tags, units, descriptions, and histograms are unchanged.
Tests
Added regression coverage for:
Validated against current main:
The functional-test project builds successfully.
The full functional suite was not rerun. A previous run encountered MsQuic loading failures in HTTP/3 tests and a separate timeout in the test environment.