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

Allow disabling of metrics by registry type and/or name patterns #3573

Merged
merged 21 commits into from
Oct 28, 2021
Merged

Allow disabling of metrics by registry type and/or name patterns #3573

merged 21 commits into from
Oct 28, 2021

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Oct 21, 2021

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:

  • whether that registry as a whole is enabled, and
  • include and exclude regex patterns for enabling or disabling metrics by name

The previously-added MetricsSettings builder now optionally accepts a RegistrySettings 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 and metrics/metrics with a few in microprofile/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 a MetricsCdiExtension 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.

@tjquinno tjquinno added this to the 2.4.0 milestone Oct 21, 2021
@tjquinno tjquinno self-assigned this Oct 21, 2021
@tjquinno 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
@tjquinno tjquinno requested a review from ljamen October 27, 2021 17:10
…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
tomas-langer previously approved these changes Oct 28, 2021
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

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

LGTM

ljamen
ljamen previously approved these changes Oct 28, 2021
Copy link
Contributor

@ljamen ljamen left a comment

Choose a reason for hiding this comment

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

LGTM

@tjquinno tjquinno requested a review from ljamen October 28, 2021 15:53
@ljamen ljamen dismissed their stale review October 28, 2021 15:55

Needs dev review.

Copy link
Contributor

@ljamen ljamen left a comment

Choose a reason for hiding this comment

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

LGTM.

@tjquinno tjquinno merged commit 91d0c52 into helidon-io:master Oct 28, 2021
@tjquinno tjquinno deleted the metrics-select branch October 28, 2021 17:31
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.

Allow users to selectively enable/disable individual metrics via config and builder
3 participants