Skip to content

GH-2148: Fix MeterRegistry Detection #2151

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

Merged
merged 2 commits into from
Mar 7, 2022

Conversation

garyrussell
Copy link
Contributor

Resolves #2148

  • use Boot's AutoConfiguredCompositeMeterRegistry, if only one
    (tested with a Boot application)
  • use @Primary registry bean

cherry-pick to 2.8.x

Resolves spring-projects#2148

- use Boot's `AutoConfiguredCompositeMeterRegistry`, if only one
  (tested with a Boot application)
- use `@Primary` registry bean

**cherry-pick to 2.8.x**
.getClass()
.getName()
.equals("org.springframework.boot.actuate.autoconfigure.metrics."
+ "AutoConfiguredCompositeMeterRegistry"))
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this if it is @Primary in the auto-configuration:

	@Bean
	@Primary
	AutoConfiguredCompositeMeterRegistry compositeMeterRegistry(Clock clock, List<MeterRegistry> registries) {
		return new AutoConfiguredCompositeMeterRegistry(clock, registries);
	}

?

I mean it looks like the next logic covers this Spring Boot "pollution" as well.

Do I miss anything ?

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh; thanks; I didn't look at that; I just saw 3 beans in my test app; will test and push.

@artembilan artembilan merged commit dc47e72 into spring-projects:main Mar 7, 2022
@artembilan
Copy link
Member

... and cherry-picked to 2.8.x

@garyrussell garyrussell deleted the GH-2148 branch March 8, 2022 17:37
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.

Monitoring Listener Performance with multiple MeterRegistry beans
2 participants