You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR separates HikariCP datasource metrics by category to avoid mixing connection-count metrics with time-based configuration metrics in the same metric family.
Previously, these metrics had different units and scales, which could distort line-chart visualization and make connection-related trends difficult to interpret. Separating the metrics ensures consistent units and improves the accuracy and readability of datasource metric visualization.
Thanks for the PR. The mixed-unit chart is a real problem, but I don't think a new metric is the right fix.
OAP's only MAL rule for this is meter-analyzer-config/datasource.yaml, and it reads just datasource (datasource.sum(['service', 'instance', 'name', 'status'])). Nothing consumes datasource_time, so the agent would keep collecting these four values and OAP would silently drop them. They'd never be stored or queryable.
connectionTimeout, validationTimeout, idleTimeout and leakDetectionThreshold are pool configuration, not runtime metrics. They're flat lines. HikariCP's own Micrometer tracker doesn't export them either.
So I'd suggest we stop collecting them instead of adding a new metric:
Remove the four timeout gauges from PoolingSealInterceptor. Keep minimumIdle and maximumPoolSize in datasource: they're counted in connections, and they serve as limit lines for the active/total connection counts.
Remove the four entries from hikaricp-scenario/config/expectedData.yaml, rather than renaming them.
Update the CHANGES.md line to say these config values are no longer reported.
No OAP MAL or UI changes are needed. The datasource rule sums over every status value, so it keeps working unchanged. The UI's datasource chart will then show only connection counts, which fixes the chart you showed.
For consistency, please do the same for dbcp's maxWaitMillis and c3p0's maxIdleTime, which are the same kind of time-based config in the same metric family. That means updating dbcp-2.x-scenario and both c3p0 scenarios. Either this PR or a follow-up works.
The runtime signals about connection timeouts are already covered:
threadsAwaitingConnection greater than 0 shows the pool is running out of connections.
An actual getConnection() timeout marks the HikariCP/Connection/getConnection span as an error, with the exception attached.
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
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.
CHANGESlog.This PR separates HikariCP datasource metrics by category to avoid mixing connection-count metrics with time-based configuration metrics in the same metric family.
Previously, these metrics had different units and scales, which could distort line-chart visualization and make connection-related trends difficult to interpret. Separating the metrics ensures consistent units and improves the accuracy and readability of datasource metric visualization.
old

new
