mufiye commented on issue #9999:
URL: https://github.com/apache/skywalking/issues/9999#issuecomment-1373535452

   Good evening@wu-sheng, I have organized new idea about api design today and 
write these API designs in brief. Could you give me some suggestions? And to 
what extent should the api design proposal be detailed?
   * **Span creating**
   
     ```java
     public class TracerManager{
         public static void createEntrySpan(String operationName, Object 
message){}
         public static void createLocalSpan(String operationName){}
         public static void createExitSpan(String operationName, Object 
message, String remotePeer){}
         public static void createExitSpan(String operationName, String 
remotePeer){}
         public static void stopSpan(){}
     }
     ```
   
   * **Inject/extract for RPC tracing**
   
     ```java
     // Question: how to pass the ContextCarrier
     // Answer: use message to encapsulate the ContextCarrier
     public class TracerManager{
         ...
         public static void inject(Object message){}
         public static void extract(Object message){}
     }
     ```
   
   * **Capture/continue for continue tracing context in the x-thread tracing**
   
     ```java
     public class TracerManager{
         ...
         public static ContextSnapshot capture(){}
         public static void continued(ContextSnapshot snapshot){}
     }
     ```
   
   * **Tag and log for the current span**
   
     ```java
     public class CurrentSpan{
         public static void log(Throwable t){}
         public static void log(Map<String, ?> event){}
         public static void tag(String key, String value){}
         public static void tag(AbstractTag<?> tag, String value){}
     }
     ```
   
   * **Async prepare/finish for span crossing threads**
   
     ```java
     public class newAsyncSpan{
        ...
         public newAsyncSpan prepareForAsync(); 
         public newAsyncSpan asyncFinish();
     }
     ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to