public static SpanObserver subscribe(String name,SpanObserver observer){
  if (observers.containsKey(name)) {
    log.warn("Overwriting existing SpanObserver with name {} by new observer: {}",name,observer);
  }
  if (observers.size() >= 5) {
    log.warn("Five or more SpanObservers registered: {}",observers.keySet());
  }
  return observers.put(name,observer);
}

public static SpanObserver subscribe ( String name , SpanObserver observer ) { if ( observers . containsKey ( name ) ) { log . warn ( "Overwriting existing SpanObserver with name {} by new observer: {}" , name , observer ) ; } if ( observers . size ( ) >= 5 ) { log . warn ( "Five or more SpanObservers registered: {}" , observers . keySet ( ) ) ; } return observers . put ( name , observer ) ; }
subscribes the given ( named ) span observer to all " span completed " events . observers are expected to be " cheap " , i . e . , do all non - trivial work ( logging , sending network messages , etc ) asynchronously . if an observer is already registered for the given name , then it gets overwritten by this call . returns the observer previously associated with the given name , or null if there is no such observer .
