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

Remove micrometer metrics on close #1700

Merged
merged 1 commit into from Jan 7, 2021

Conversation

igouss
Copy link
Contributor

@igouss igouss commented Nov 25, 2020

No description provided.

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #1700 (8b15e1c) into dev (8217f20) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##                dev    #1700   +/-   ##
=========================================
  Coverage     70.11%   70.11%           
  Complexity      561      561           
=========================================
  Files            26       26           
  Lines          2118     2118           
  Branches        296      296           
=========================================
  Hits           1485     1485           
  Misses          487      487           
  Partials        146      146           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8217f20...8b15e1c. Read the comment docs.

@brettwooldridge
Copy link
Owner

@checketts @shakuzen Hey, can I ask you guys to review this? Looks ok to me, but not being a Micrometers user I don't know about side-effects. Any? Issues with multiple pools in the same VM, etc?

Copy link
Contributor

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me. I would just note that the remove method was added in Micrometer 1.1.0, which means this change would require at least that version, but that is probably okay given how old that version already is (we don't even support the 1.0.x or 1.1.x line anymore).

I suppose the motivation here is to no longer report metrics for HikariCP instances that are closed. If so, this seems like the right way to achieve it.

@shakuzen
Copy link
Contributor

shakuzen commented Jan 7, 2021

Any? Issues with multiple pools in the same VM, etc?

As long as each pool is using a different poolName, they will be tagged uniquely, creating unique metrics. If they had the same poolName, they would not make unique metrics.

@checketts
Copy link
Contributor

I agree with @shakuzen . The only risk this adds is if there were 2 pools with the same name they would be sharing the meters, and the removal of the first would remove the meters even if the second is still in use.

I personally haven't used any of the remove methods so I'm not certain how the 2nd pool's usage of removed meters would behave. I'm guessing they would likely just be orphaned and stop reporting.

@brettwooldridge
Copy link
Owner

@checketts @shakuzen Thanks for the feedback guys. Yes, I understand that two pools with the same name could present a theoretical issue. In this case, it would be incumbent upon the user to ensure uniquely named pools. For explicitly unnamed pools, HikariCP itself will generate unique names via an incrementing integer suffix, so "default" configurations with multiple pools would not run into that edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants