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 metrics when the connections limit is set #38161
Add metrics when the connections limit is set #38161
Conversation
/cc @brunobat (micrometer), @ebullient (micrometer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine the maxConnections is the constant you were talking in the morning...
Do you thing you can add a test?
This comment has been minimized.
This comment has been minimized.
@brunobat I can try, but it's tricky. Our test frameworks do not use persistent connections, so we will have only one connection reported. If I want to test the number of rejections, I would need to create many connections and execute them concurrently. This is the best recipe for flakiness, as the level of concurrency and execution depends on the machine executing. I manually tested it locally because browsers, unlike our test framework, use persistent connections (and the dev UI is opening 5 connections! (I need to investigate that with @phillip-kruger when he is back)). |
Ok @cescoffier. Worst case, a test with a single connection is fine because if we test the metric doesn't go away accidentally it's something already. If you add an issue for the more complex work, I'm fine merging this now. |
When the HTTP connection limit is set: - expose a new gauge with the max number of connections - expose a new gauge with the current number of connections - expose a new counter with the number of rejected connections
428357e
to
31474fd
Compare
@brunobat I accepted the challenge and implemented a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @cescoffier
Failing Jobs - Building 31474fd
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 21 #- Failing: integration-tests/elasticsearch-java-client integration-tests/elasticsearch-rest-client integration-tests/hibernate-orm-tenancy/connection-resolver and 3 more
📦 integration-tests/elasticsearch-java-client✖ 📦 integration-tests/elasticsearch-rest-client✖ 📦 integration-tests/hibernate-orm-tenancy/connection-resolver✖
✖
📦 integration-tests/hibernate-search-orm-elasticsearch-tenancy✖ 📦 integration-tests/hibernate-search-orm-opensearch✖
📦 integration-tests/logging-gelf✖ |
When the HTTP connection limit is set: