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

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

Best Java code snippets using org.springframework.cloud.sleuth.Span.getName (Showing top 6 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: org.springframework.cloud/spring-cloud-gcp-trace

protected TraceSpan convert(Span span) {
  Span adjustedSpan = span;
  for (SpanAdjuster adjuster : this.spanAdjusters) {
    adjustedSpan = adjuster.adjust(adjustedSpan);
  }
  TraceSpan.Builder builder = TraceSpan.newBuilder();
  // Set name
  if (StringUtils.hasText(adjustedSpan.getName())) {
    builder.setName(adjustedSpan.getName());
  }
  TraceSpan.SpanKind kind = getKind(adjustedSpan);
  builder.setKind(kind);
  builder.setSpanId(adjustedSpan.getSpanId());
  rewriteIds(adjustedSpan, kind, builder);
  writeStartEndTime(adjustedSpan, builder);
  builder.putAllLabels(this.labelExtractor.extract(adjustedSpan, builder.getKind(), this.instanceId));
  return builder.build();
}
origin: org.springframework.cloud/spring-cloud-sleuth-zipkin2

if (StringUtils.hasText(convertedSpan.getName())) {
  zipkinSpan.name(convertedSpan.getName());
origin: census-instrumentation/opencensus-java

private static Span sampledSpan(Span span, Sampler sampler) {
 if (!sampler.isSampled(span)) {
  // Copy everything, except set exportable to false
  return Span.builder()
    .begin(span.getBegin())
    .traceIdHigh(span.getTraceIdHigh())
    .traceId(span.getTraceId())
    .spanId(span.getSpanId())
    .name(span.getName())
    .exportable(false)
    .build();
 }
 return span;
}
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()");
    }
  });*/
}
org.springframework.cloud.sleuthSpangetName

Popular methods of Span

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

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
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