diff --git a/integrasjon/rest-klient/src/main/java/no/nav/vedtak/felles/integrasjon/rest/jersey/AbstractJerseyRestClient.java b/integrasjon/rest-klient/src/main/java/no/nav/vedtak/felles/integrasjon/rest/jersey/AbstractJerseyRestClient.java index 8002a79ea..43b6434f3 100644 --- a/integrasjon/rest-klient/src/main/java/no/nav/vedtak/felles/integrasjon/rest/jersey/AbstractJerseyRestClient.java +++ b/integrasjon/rest-klient/src/main/java/no/nav/vedtak/felles/integrasjon/rest/jersey/AbstractJerseyRestClient.java @@ -42,6 +42,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.binder.httpcomponents.MicrometerHttpRequestExecutor; import io.micrometer.prometheus.PrometheusMeterRegistry; import no.nav.foreldrepenger.konfig.Environment; @@ -70,9 +71,11 @@ */ public abstract class AbstractJerseyRestClient { + public static final PrometheusMeterRegistry REGISTRY = new PrometheusMeterRegistry(DEFAULT); private static final Environment ENV = Environment.current(); static { + Metrics.addRegistry(REGISTRY); LogManager.getLogManager().reset(); SLF4JBridgeHandler.install(); } @@ -82,7 +85,6 @@ public abstract class AbstractJerseyRestClient { public static final String NAV_CONSUMER_TOKEN_HEADER = "Nav-Consumer-Token"; public static final String DEFAULT_NAV_CALLID = "Nav-Callid"; public static final String ALT_NAV_CALL_ID = "nav-call-id"; - public static final String HEADER_CORRELATION_ID = "X-Correlation-ID"; private static final Logger LOG = LoggerFactory.getLogger(AbstractJerseyRestClient.class); @@ -109,7 +111,6 @@ private AbstractJerseyRestClient(URI proxy, Set f Optional.ofNullable(proxy) .ifPresent(p -> cfg.property(PROXY_URI, p)); cfg.register(jacksonProvider(MAPPER)); - cfg.connectorProvider(new ApacheConnectorProvider()); cfg.register((ApacheHttpClientBuilderConfigurator) (b) -> { return b.addInterceptorFirst(new StandardHeadersRequestInterceptor()) @@ -117,7 +118,7 @@ private AbstractJerseyRestClient(URI proxy, Set f .setDefaultRequestConfig(defaultRequestConfig()) .setRetryHandler(new HttpRequestRetryHandler()) .setRequestExecutor(MicrometerHttpRequestExecutor - .builder(new PrometheusMeterRegistry(DEFAULT)) + .builder(REGISTRY) .build()) .setConnectionManager(connectionManager()); }); @@ -125,7 +126,6 @@ private AbstractJerseyRestClient(URI proxy, Set f LOG.info("Registrer filter {}", f.getClass()); cfg.register(f); }); - cfg.register(ErrorResponseHandlingClientResponseFilter.class); if (ENV.isDev()) { cfg.register(new HeaderLoggingFilter())