Class ServerSpanNaming


  • public final class ServerSpanNaming
    extends Object
    Helper container for tracking whether instrumentation should update server span name or not.
    • Method Detail

      • init

        public static io.opentelemetry.context.Context init​(io.opentelemetry.context.Context context,
                                                            ServerSpanNaming.Source initialSource)
      • updateServerSpanName

        public static void updateServerSpanName​(io.opentelemetry.context.Context context,
                                                ServerSpanNaming.Source source,
                                                Supplier<String> serverSpanName)
        If there is a server span in the context, and init(Context, Source) has been called to populate a ServerSpanName into the context, then this method will update the server span name using the provided Supplier if and only if the last ServerSpanNaming.Source to update the span name using this method has strictly lower priority than the provided ServerSpanNaming.Source, and the value returned from the Supplier is non-null.

        If there is a server span in the context, and init(Context, Source) has NOT been called to populate a ServerSpanName into the context, then this method will update the server span name using the provided Supplier if the value returned from it is non-null.