Support for @Timed in any Spring-managed bean
See original GitHub issueAs of v1.0.0-rc.7 @Timed
put on a method of an arbitrary Spring-managed bean is silently ignored. It would be useful to be able to generate metrics for any kind of beans (e.g. Service
s with non-RestTemplate
remote system calls) without writing a custom AOP logic.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to instantiate Spring managed beans at runtime?
here is the solution to create multiple prototype beans in one method, not pretty looking but should work, I autowired container in RuntimeBean...
Read more >Super simple approach to accessing Spring beans from non ...
method which returns the Spring managed bean instance of a service class (in this case) that any POJO class can access. In the...
Read more >33. Task Execution and Scheduling - Spring
The Spring Framework provides abstractions for asynchronous execution and scheduling of tasks with the TaskExecutor and TaskScheduler interfaces, ...
Read more >Managed beans using @Component, @Repository, @Service
Learn managed beans or components in Spring using @Component, ... The @Component annotation declares any class as a managed spring bean.
Read more >Using the Timer Service - The Java EE 6 Tutorial
An enterprise bean can have multiple automatic timeout methods, unlike a programmatic timer, which allows only one method annotated with the @Timeout annotation ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
TimedAspect
aspect now exists inmicrometer-core
, but will not be autoconfigured in Spring Boot 2 ormicrometer-spring-legacy
. We can revisit application of@Timed
via AOP or a BPP in Boot 2.1, depending on how the community reacts to the feature.To configure manually:
Is there a reason why AspectJ was used instead of AOP Alliance? Both are supported by Spring, but only AOP Alliance is by Guice. Spring Transactions uses AOP Alliance (
TransactionInterceptor
), making it easy to leverage in Guice w/o Spring IoC.