Tabnine Logo
Span.idToHex
Code IndexAdd Tabnine to your IDE (free)

How to use
idToHex
method
in
org.springframework.cloud.sleuth.Span

Best Java code snippets using org.springframework.cloud.sleuth.Span.idToHex (Showing top 3 results out of 315)

origin: wu191287278/spring-boot-starter-dubbo

@Override
public void inject(Span span, RpcContext carrier) {
  Map<String, String> attachments = carrier.getAttachments();
  if (span.getTraceId() != 0) {
    attachments.put(Span.TRACE_ID_NAME, Span.idToHex(span.getTraceId()));
  }
  if (span.getSpanId() != 0) {
    attachments.put(Span.SPAN_ID_NAME, Span.idToHex(span.getSpanId()));
  }
  attachments.put(Span.SAMPLED_NAME, span.isExportable() ? Span.SPAN_SAMPLED : Span.SPAN_NOT_SAMPLED);
  attachments.put(Span.SPAN_NAME_NAME, span.getName());
  Long parentId = getParentId(span);
  if (parentId != null && parentId != 0) {
    attachments.put(Span.PARENT_ID_NAME, Span.idToHex(parentId));
  }
  attachments.put(Span.PROCESS_ID_NAME, span.getProcessId());
}
origin: lexburner/sleuth-starter

protected void attachTraceInfo(Tracer tracer, Span span, final Request request) {
  if (span == null) {
    setHeader(request, Span.SAMPLED_NAME, Span.SPAN_NOT_SAMPLED);
    return;
  }
  setHeader(request, TraceRequestAttributes.HANDLED_SPAN_REQUEST_ATTR, "true");
  setHeader(request, Span.SPAN_ID_NAME, Span.idToHex(span.getSpanId()));
  setHeader(request, Span.TRACE_ID_NAME, span.traceIdString());
  setHeader(request, Span.SPAN_NAME_NAME, span.getName());
  setHeader(request, Span.SAMPLED_NAME, span.isExportable() ?
      Span.SPAN_SAMPLED : Span.SPAN_NOT_SAMPLED);
  setHeader(request, Span.PARENT_ID_NAME,Span.idToHex(getParentId(span)));
  setHeader(request, Span.PROCESS_ID_NAME, span.getProcessId());
  if(span.getSavedSpan()!=null && span.getSavedSpan().tags()!=null){
    for (Entry<String, String> stringStringEntry : span.getSavedSpan().tags().entrySet()) {
      setHeader(request, stringStringEntry.getKey(), stringStringEntry.getValue());
    }
  }
  /*spanInjector.inject(span,null);
  tracer.inject(span.context(), Format.Builtin.TEXT_MAP, new TextMap() {
    @Override
    public void put(String key, String value) {
      request.setAttachment(key, value);
    }
    @Override
    public Iterator<Entry<String, String>> iterator() {
      throw new UnsupportedOperationException("TextMapInjectAdapter should only be used with Tracer.inject()");
    }
  });*/
}
origin: org.springframework.cloud/spring-cloud-sleuth-zipkin2

        + "other parents for " + convertedSpan);
  zipkinSpan.parentId(Span.idToHex(convertedSpan.getParents().get(0)));
zipkinSpan.id(Span.idToHex(convertedSpan.getSpanId()));
if (StringUtils.hasText(convertedSpan.getName())) {
  zipkinSpan.name(convertedSpan.getName());
org.springframework.cloud.sleuthSpanidToHex

Popular methods of Span

  • getSpanId
  • getParents
  • getName
  • getTraceId
  • isExportable
  • builder
  • getProcessId
  • getSavedSpan
  • tag
  • traceIdString
  • getBegin
  • hexToId
  • getBegin,
  • hexToId,
  • isRemote,
  • logEvent,
  • tags,
  • getTraceIdHigh,
  • isRunning,
  • logs,
  • stop

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Notification (javax.management)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now