-
Notifications
You must be signed in to change notification settings - Fork 580
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
Allow disabling of metrics by registry type and/or name patterns #3573
Merged
Conversation
This file contains 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
…d impl because we need to be able to proxy NoOpMetric so it has to be an interface
…e/disable entire registry and/or selected metric names)
…app-scoped init is done; this way runtime config can be properly used to initialize the RegistryFactory and the registries it provides
…ntime config to set up the RegistryFactory; add tests
tjquinno
changed the title
WIP Allow disabling of metrics by registry type and/or name patterns
Allow disabling of metrics by registry type and/or name patterns
Oct 27, 2021
…tests used to assume that metrics presented to the MetricsCdiExtension method were registered immediately. That is no longer the case to make sure registries are set up with runtime configuration.
tomas-langer
previously approved these changes
Oct 28, 2021
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.
LGTM
ljamen
previously approved these changes
Oct 28, 2021
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.
LGTM
metrics/api/src/main/java/io/helidon/metrics/api/RegistryFilterSettings.java
Outdated
Show resolved
Hide resolved
ljamen
approved these changes
Oct 28, 2021
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.
LGTM.
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.
Resolves #3537
Allows users to enable/disable metrics by registry type (application, vendor, base) and by regex patterns applied to metric names.
Each registry instance now has a
RegistrySettings
that records:include
andexclude
regex patterns for enabling or disabling metrics by nameThe previously-added
MetricsSettings
builder now optionally accepts aRegistrySettings
for each registry type (app, base, vendor).All these new and updated settings can be set explicitly from SE apps and via config for SE and MP apps.
I grouped the changes into separate, somewhat coherent commits for ease of review.
Most coding changes are confined to
metrics/api
andmetrics/metrics
with a few inmicroprofile/metrics
mostly to defer registration of metrics until late so the runtime config can influence metrics enabling/disabling properly. There are small changes in a gRPC integration test which assumed that metrics it registered via aMetricsCdiExtension
static method were available immediately. That is no longer the case so that runtime configuration can influence how registries behave.The PR also includes updates to the SE and MP metrics guides and new examples.