Wrap instrumentation installation with a try/catch
@@ -138,8 +138,13 @@ public class AgentInstaller {
int numInstrumenters = 0;
for (final Instrumenter instrumenter : ServiceLoader.load(Instrumenter.class)) {
log.debug("Loading instrumentation {}", instrumenter.getClass().getName());
+
+ try {
agentBuilder = instrumenter.instrument(agentBuilder);
numInstrumenters++;
+ } catch (final Throwable e) {
+ log.error("Unable to load instrumentation {}", instrumenter.getClass().getName(), e);
+ }
}
log.debug("Installed {} instrumenter(s)", numInstrumenters);
