diff --git a/javaagent-instrumentation-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/InstrumentationContext.java b/javaagent-instrumentation-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/InstrumentationContext.java index 9b27f026f4..6cf4c518d6 100644 --- a/javaagent-instrumentation-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/InstrumentationContext.java +++ b/javaagent-instrumentation-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/InstrumentationContext.java @@ -18,12 +18,8 @@ public class InstrumentationContext { *
In reality, the calls to this method are re-written to something more performant * while injecting advice into a method. * - *
When this method is called from outside of an Advice class it can only access {@link - * ContextStore} when it is already created. For this {@link ContextStore} either needs to be - * registered in {@code - * io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule#registerMuzzleContextStoreClasses(InstrumentationContextBuilder)} - * or be used in an Advice or Helper class which automatically adds it to {@code - * InstrumentationModule#registerMuzzleContextStoreClasses(InstrumentationContextBuilder)}. + *
When using this method outside of Advice method, the {@link ContextStore} should be looked + * up once and stored in a field to avoid repeatedly calling this method. * * @param keyClass The key class context is attached to. * @param contextClass The context class attached to the user class.