Skip to content

Commit

Permalink
fix(misc): adding explicit dependency between the registry,metrics in…
Browse files Browse the repository at this point in the history
…terceptor and web mvc configurer (#3854)
  • Loading branch information
srekapalli committed Aug 10, 2020
1 parent 5f4b2ed commit 707d449
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.netflix.spinnaker.orca.web.config

import groovy.util.logging.Slf4j

import javax.servlet.Filter
import javax.servlet.FilterChain
import javax.servlet.FilterConfig
Expand Down Expand Up @@ -44,19 +46,22 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@ComponentScan(['com.netflix.spinnaker.orca.controllers', 'com.netflix.spinnaker.orca.util'])
@CompileStatic
@EnableFiatAutoConfig
class WebConfiguration implements WebMvcConfigurer {

@Autowired
Registry registry
@Slf4j
class WebConfiguration {

@Bean
MetricsInterceptor metricsInterceptor() {
return new MetricsInterceptor(this.registry, "controller.invocations", ["application"], ["BasicErrorController"])
MetricsInterceptor metricsInterceptor(Registry registry) {
return new MetricsInterceptor(registry, "controller.invocations", ["application"], ["BasicErrorController"])
}

@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(metricsInterceptor())
@Bean
WebMvcConfigurer webMvcConfigurer(MetricsInterceptor metricsInterceptor) {
return new WebMvcConfigurer() {
@Override
void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(metricsInterceptor)
}
}
}

@Bean(name = "objectMapper", autowire = Autowire.BY_TYPE) ObjectMapper orcaObjectMapper() {
Expand Down

0 comments on commit 707d449

Please sign in to comment.