diff --git a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/instrumentation/correlation/log/MDCAccess.java b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/instrumentation/correlation/log/MDCAccess.java index 1bdecf3755..bc9aab7474 100644 --- a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/instrumentation/correlation/log/MDCAccess.java +++ b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/instrumentation/correlation/log/MDCAccess.java @@ -18,7 +18,6 @@ import javax.annotation.PostConstruct; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import java.util.stream.Collectors; @@ -123,6 +122,6 @@ synchronized void updateEnabledAdaptersSet() { inspectitEnv.getCurrentConfig().getTracing().getLogCorrelation().getTraceIdMdcInjection(); enabledAdapters = availableAdapters.values().stream() .filter(adapter -> adapter.isEnabledForConfig(settings)) - .collect(Collectors.toCollection(() -> Collections.newSetFromMap(new ConcurrentHashMap<>()))); + .collect(Collectors.toCollection(() -> Collections.newSetFromMap(new WeakHashMap<>()))); } } diff --git a/inspectit-ocelot-documentation/docs/tracing/log-correlation.md b/inspectit-ocelot-documentation/docs/tracing/log-correlation.md index 5281da5b37..6d16ffed33 100644 --- a/inspectit-ocelot-documentation/docs/tracing/log-correlation.md +++ b/inspectit-ocelot-documentation/docs/tracing/log-correlation.md @@ -47,7 +47,7 @@ As a result, log messages, generated within an exported trace, will be prefixed You can change the key under which the trace-id is placed in the MDC using the property `inspectit.tracing.log-correlation.trace-id-mdc-injection.key`. -By default, the trace-id will inserted into all MDCs. If required, you can selectively exclude the supported libraries using the following flags: +By default, the trace-id will be inserted into all MDCs. If required, you can selectively exclude the supported libraries using the following flags: ```yaml inspectit: tracing: