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

Initialize distribution customizations even before config is applied #9547

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tjquinno
Copy link
Member

Description

Resolves #9546

We added a new data structure, DistributionCustomizations, in Helidon 4.1.4 to support an enhancement in MP metrics 5.1 to allow configuration of percentiles, buckets, etc.

Under normal conditions, the Helidon MP metrics CDI extension invokes this type's init method with an MP config object to prepare the various customizations and all is well.

A user wrote a test that used MP metrics (a timer specifically) but did not mark the test with @HelidonTest so the initialization described above did not occur. That caused an NPE.

This PR modifies the DistributionCustomizations class to initialize the static (non-final) instance variable at load-time without using config. This resolves the problem the user encountered with the test.

Subsequently the metrics CDI extension overwrites that initial value with one derived from configuration.

Documentation

No impact.

@tjquinno tjquinno self-assigned this Nov 30, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x Provide initial temp config for MP metrics DistributionCustomizations
1 participant