Comments (4)
Could you consider adding a MeterRegistryPostProcessor as argument of constructor of OtlpMetricsExportAutoConfiguration
Unfortunately, I don't think we can justify doing that without fully understanding the problem as this sort of change is likely to mask an underlying issue. It sounds like something is creating the OtlpMeterRegistry
too early, and before all bean post-processors have been created. If I am right, it's this that should be addressed to resolve the problem.
Ideally, you'd share a sample that reproduces the problem. If that's not possible, please share the log output of your application when it's starting up. The default info level may be sufficient to point us in the right direction. Debug logging would be even better as it should identify the names of the beans that are being created and that are triggering the early creation of the OtlpMeterRegistry
bean.
from spring-boot.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
from spring-boot.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
from spring-boot.
sorry for not replying before.
We identified the root cause of the issue in one of our internal libraries.
A MeterRegistry was expected in constructor of one of our classes annotated with @configuration.
The registy injected via constructor was used in multiple methods to create multiple beans:
@Configuration(proxyBeanMethods = false)
class MyConfiguration(private val meterRegistry: MeterRegistry) {
@Bean
fun bean1(): MyBean {
return MyBean(meterRegistry)
}
@Bean
fun bean2(): MyBean {
return MyBean(meterRegistry);
}
}
I assume that the injection in constructor was causing the early instantiation of the MeterRegistry (before post processor).
Issue was fixed by moving MeterRegistry injection to each method:
@Configuration(proxyBeanMethods = false)
class MyConfiguration {
@Bean
fun bean1(meterRegistry: MeterRegistry): MyBean {
return MyBean(meterRegistry)
}
@Bean
fun bean2(meterRegistry: MeterRegistry): MyBean {
return MyBean(meterRegistry);
}
}
from spring-boot.
Related Issues (20)
- Upgrade to Testcontainers 1.20.1
- Upgrade to Tomcat 10.1.28
- Upgrade to Yasson 3.0.4
- Upgrade to Spring Kafka 3.3.0-M2
- Upgrade to Spring Integration 6.4.0-M2
- Upgrade to Spring AMQP 3.2.0-M2
- Upgrade to GraphQL Java 22.2 HOT 1
- Prohibit upgrades to Kotlin Serialization 1.7.x as it requires Kotlin 2
- StatusAssertions expectStatus() should use the HTTP status (not json field) HOT 2
- Upgrade to Jetty 12.0.12
- Upgrade to Jetty 12.0.12
- Allow binder to compose collections from multiple sources
- Bump jfrog/setup-jfrog-cli from 4.2.1 to 4.2.2
- Bump jfrog/setup-jfrog-cli from 4.2.1 to 4.2.2
- Bump gradle/actions from 3.5.0 to 4.0.0
- Bump gradle/actions from 3.5.0 to 4.0.0
- Add configuration support for ExponentialHistogram in OTLP Registry
- spring-boot-testcontainers causes unwanted container initialization during AOT processing HOT 4
- DynamicPropertyRegistry in @Bean-method fails with spring-boot-testcontainers dependency in classpath (3.4.0-M1) HOT 2
- Define default value for OpenTelemetry Trace Exporter in auto-configuration HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.