Class ServerSpanNaming
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.servlet.ServerSpanNaming
-
public final class ServerSpanNaming extends Object
Helper container for tracking whether instrumentation should update server span name or not.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerSpanNaming.Source
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.opentelemetry.context.Contextinit(io.opentelemetry.context.Context context, ServerSpanNaming.Source initialSource)static <T> voidupdateServerSpanName(io.opentelemetry.context.Context context, ServerSpanNaming.Source source, ServerSpanNameSupplier<T> serverSpanName, T arg1)If there is a server span in the context, andinit(Context, Source)has been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameSupplierif and only if the lastServerSpanNaming.Sourceto update the span name using this method has strictly lower priority than the providedServerSpanNaming.Source, and the value returned from theServerSpanNameSupplieris non-null.static <T,U>
voidupdateServerSpanName(io.opentelemetry.context.Context context, ServerSpanNaming.Source source, ServerSpanNameTwoArgSupplier<T,U> serverSpanName, T arg1, U arg2)If there is a server span in the context, andinit(Context, Source)has been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameTwoArgSupplierif and only if the lastServerSpanNaming.Sourceto update the span name using this method has strictly lower priority than the providedServerSpanNaming.Source, and the value returned from theServerSpanNameTwoArgSupplieris non-null.
-
-
-
Method Detail
-
init
public static io.opentelemetry.context.Context init(io.opentelemetry.context.Context context, ServerSpanNaming.Source initialSource)
-
updateServerSpanName
public static <T> void updateServerSpanName(io.opentelemetry.context.Context context, ServerSpanNaming.Source source, ServerSpanNameSupplier<T> serverSpanName, T arg1)If there is a server span in the context, andinit(Context, Source)has been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameSupplierif and only if the lastServerSpanNaming.Sourceto update the span name using this method has strictly lower priority than the providedServerSpanNaming.Source, and the value returned from theServerSpanNameSupplieris non-null.If there is a server span in the context, and
init(Context, Source)has NOT been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameSupplierif the value returned from it is non-null.
-
updateServerSpanName
public static <T,U> void updateServerSpanName(io.opentelemetry.context.Context context, ServerSpanNaming.Source source, ServerSpanNameTwoArgSupplier<T,U> serverSpanName, T arg1, U arg2)If there is a server span in the context, andinit(Context, Source)has been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameTwoArgSupplierif and only if the lastServerSpanNaming.Sourceto update the span name using this method has strictly lower priority than the providedServerSpanNaming.Source, and the value returned from theServerSpanNameTwoArgSupplieris non-null.If there is a server span in the context, and
init(Context, Source)has NOT been called to populate aServerSpanNameinto the context, then this method will update the server span name using the providedServerSpanNameTwoArgSupplierif the value returned from it is non-null.
-
-