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

Micrometer configuration lifecycle violation #224

Closed
jonatan-ivanov opened this issue Aug 1, 2024 · 5 comments
Closed

Micrometer configuration lifecycle violation #224

jonatan-ivanov opened this issue Aug 1, 2024 · 5 comments
Assignees
Labels
documentation enhancement New feature or request
Milestone

Comments

@jonatan-ivanov
Copy link

Micrometer's MeterRegistry should be "configured" (see MeterRegistry.Config) before registering Meter instances to it. For example MeterFilters should be configured before a Meter has been registered to the registry.

Historically, Micrometer has allowed configuring MeterFilters after meters have been registered but due to certain performance optimizations with micrometer-metrics/micrometer#4917 we took a step toward warning users about this situation.

See:

It seems in certain cases Vert.x configures a MeterFilter after a Meter has been registered to the registry causing the warning mentioned above. See micrometer-metrics/micrometer#4920 (comment) by @sanyarnd with a reproducer.

@sanyarnd could you please provide the Vert.x version you are using and any additional details you have?

@tsegismont
Copy link
Contributor

I'll look into it

@tsegismont tsegismont removed this from the 4.5.10 milestone Aug 28, 2024
@tsegismont tsegismont added invalid This doesn't seem right and removed bug Something isn't working labels Aug 28, 2024
@tsegismont
Copy link
Contributor

I read the logs in the comment posted by @sanyarnd in micrometer-metrics/micrometer#4920

The warning is logged when the Vert.x Metrics instance is created. No meter is registered by Vert.x at this stage. Users must either:

  • delay meters registration until Vert.x has set up its Metrics instance, or
  • enable all labels (MicrometerMetricsOptions#setLabels) and configure no matcher (with MicrometerMetricsOptions addLabelMatch)

Feel free to reach out if more info is needed

@tsegismont tsegismont closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
@jonatan-ivanov
Copy link
Author

@tsegismont Is there a way to guide the users towards how to register heir own Meters at startup? E.g.: a section in the docs?

@tsegismont tsegismont added enhancement New feature or request documentation and removed invalid This doesn't seem right labels Aug 29, 2024
@tsegismont tsegismont added this to the 4.5.10 milestone Aug 29, 2024
@tsegismont
Copy link
Contributor

@jonatan-ivanov I don't believe we should document how to register their own meters, the Micrometer doc is does it well. But thanks for mentioning docs, I think it would be nice to have a note that explains that Vert.x can register meter filters and, for this reason, they can see Micrometer's warning in the logs.

@tsegismont tsegismont reopened this Aug 29, 2024
tsegismont added a commit that referenced this issue Aug 29, 2024
See #224

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont added a commit that referenced this issue Aug 29, 2024
See #224

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
Copy link
Contributor

Closed by caca2d7

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Development

No branches or pull requests

3 participants