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

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

Best Java code snippets using org.springframework.cloud.sleuth.Span.getProcessId (Showing top 4 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: com.ofg/micro-infra-spring-base

@SuppressWarnings("unchecked")
private HttpEntity createNewHttpEntity(HttpEntity httpEntity, Span span) {
  HttpHeaders newHttpHeaders = new HttpHeaders();
  newHttpHeaders.putAll(httpEntity.getHeaders());
  if (span != null) {
    addHeaderIfPresent(newHttpHeaders, Span.SPAN_ID_NAME, String.valueOf(span.getSpanId()));
    addHeaderIfPresent(newHttpHeaders, Span.TRACE_ID_NAME, String.valueOf(span.getTraceId()));
    addHeaderIfPresent(newHttpHeaders, OLD_CORRELATION_ID_HEADER, String.valueOf(span.getTraceId()));
    addHeaderIfPresent(newHttpHeaders, Span.SPAN_NAME_NAME, span.getName());
    addHeaderIfPresent(newHttpHeaders, Span.PARENT_ID_NAME, getFirst(span.getParents()));
    addHeaderIfPresent(newHttpHeaders, Span.PROCESS_ID_NAME, span.getProcessId());
  }
  return new HttpEntity(httpEntity.getBody(), newHttpHeaders);
}
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: census-instrumentation/opencensus-java

.parent(parent.getSpanId())
.spanId(id)
.processId(parent.getProcessId())
.savedSpan(parent)
.exportable(parent.isExportable())
org.springframework.cloud.sleuthSpangetProcessId

Popular methods of Span

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

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • startActivity (Activity)
  • String (java.lang)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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