Skip to content

Commit

Permalink
refactor(web): use MetricsInterceptor from kork, remove copy-pasted o…
Browse files Browse the repository at this point in the history
…ne (#749)

Co-authored-by: Justin Field <justin.field@armory.io>
  • Loading branch information
Anastasiia Smirnova and fieldju committed Jun 24, 2020
1 parent 235bcb2 commit 3daf184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

import com.google.common.collect.ImmutableList;
import com.netflix.kayenta.filters.KayentaCorsFilter;
import com.netflix.kayenta.interceptors.MetricsInterceptor;
import com.netflix.spectator.api.Registry;
import com.netflix.spinnaker.kork.web.interceptors.MetricsInterceptor;
import java.util.Collections;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
Expand All @@ -39,16 +41,19 @@ public class WebConfiguration implements WebMvcConfigurer {

@Override
public void addInterceptors(InterceptorRegistry registry) {
List<String> queryParamsToTag =
ImmutableList.of(
"accountName",
"configurationAccountName",
"metricsAccountName",
"storageAccountName",
"application");
registry.addInterceptor(
new MetricsInterceptor(
this.registry,
"controller.invocations",
ImmutableList.of(
"accountName",
"configurationAccountName",
"metricsAccountName",
"storageAccountName",
"application"),
Collections.emptyList(),
queryParamsToTag,
ImmutableList.of("BasicErrorController")));
}

Expand Down

This file was deleted.

0 comments on commit 3daf184

Please sign in to comment.