Skip to content

Commit

Permalink
metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
janolaveide committed May 26, 2021
1 parent cbd40ec commit 46c6fff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;

import io.micrometer.core.instrument.binder.httpcomponents.PoolingHttpClientConnectionManagerMetricsBinder;
import no.nav.vedtak.felles.integrasjon.rest.jersey.AbstractJerseyRestClient;
import no.nav.vedtak.felles.integrasjon.rest.jersey.HeaderLoggingRequestInterceptor;
import no.nav.vedtak.felles.integrasjon.rest.jersey.HeaderLoggingResponseInterceptor;

Expand Down Expand Up @@ -128,6 +130,7 @@ public static PoolingHttpClientConnectionManager connectionManager() {
connManager.setMaxTotal(100);
connManager.setDefaultConnectionConfig(defaultConnectionConfig);
connManager.setValidateAfterInactivity(100);
new PoolingHttpClientConnectionManagerMetricsBinder(connManager, "jersey-pool").bindTo(AbstractJerseyRestClient.REGISTRY);
return connManager;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static Runnable propagate(Runnable task) {
}
}

static class PropagatingRunnable implements Runnable {
private static class PropagatingRunnable implements Runnable {

private static final Logger LOG = LoggerFactory.getLogger(PropagatingRunnable.class);
private final Runnable task;
Expand Down Expand Up @@ -98,15 +98,11 @@ private void propagateContextIfSet() {
}

private void propagateSubjectIfSet() {
try {
if (subject != null) {
LOG.trace("Propagerer subject fra subject handler");
ThreadLocalSubjectHandler.class.cast(getSubjectHandler()).setSubject(subject);
} else {
LOG.trace("Intet subject å propagere");
}
} catch (Exception e) {
LOG.warn("Feil ved propagering av subject", e);
if (subject != null) {
LOG.trace("Propagerer subject fra subject handler");
ThreadLocalSubjectHandler.class.cast(getSubjectHandler()).setSubject(subject);
} else {
LOG.trace("Intet subject å propagere");
}
}

Expand Down

This file was deleted.

0 comments on commit 46c6fff

Please sign in to comment.