Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Make Micrometer optional #107

Closed
ttddyy opened this issue Mar 12, 2021 · 2 comments
Closed

Make Micrometer optional #107

ttddyy opened this issue Mar 12, 2021 · 2 comments
Assignees

Comments

@ttddyy
Copy link
Contributor

ttddyy commented Mar 12, 2021

One of the team I work with have an application that does not use micrometer.

In configurations, there are places referencing WavefrontConfig from micrometer.
(here, here - this one may relate to #74 )

For opentracing, they seems to be retrieving source from WavefrontConfig.

Probably, it could be replaced with a supplier bean like this:

@FunctionalInterface
public interface WavefrontSourceProvider {

	String getSource();

}

Then, conditionally create one to use WavefrontConfig if micrometer is available.

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(WavefrontConfig.class)
@ConditionalOnMissingBean(WavefrontSourceProvider.class)
static class MicrometerSourceConfiguration {

	@Bean
	WavefrontSourceProvider wavefrontSourceProvider(WavefrontConfig wavefrontConfig) {
		return wavefrontConfig::source;
	}

}

I didn't check other places, but would be nice to make the micrometer optional.

@snicoll
Copy link
Collaborator

snicoll commented Mar 13, 2021

I don't really understand what you mean by "not using micrometer". Do you mean not using metrics? This a starter for Spring Boot and micrometer is a core (i.e. non optional) for metrics.

@sushantdewan123
Copy link
Contributor

As Stephane mentioned above, we would like to make the scope of metrics/micrometer as non-optional. Closing this as wont fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants