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

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

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

origin: wu191287278/spring-boot-starter-dubbo

private Long getParentId(Span span) {
  return !span.getParents().isEmpty() ? span.getParents().get(0) : null;
}
origin: lexburner/sleuth-starter

private Long getParentId(Span span) {
  return !span.getParents().isEmpty() ? span.getParents().get(0) : null;
}
origin: org.ametiste.mdwd/mdwd-sleuth

/**
 * Defines whether this call is part of process or its separate operation
 * @return true if service is called within process started in other service, false otherwise
 */
@Override
public boolean isProcess() {
  ContextVerifier.assertWithinContext();
  return !TraceContextHolder.getCurrentSpan().getParents().isEmpty();
}
origin: org.springframework.cloud/spring-cloud-gcp-trace

public Map<String, String> extract(Span span, TraceSpan.SpanKind kind, String instanceId) {
  Map<String, String> labels = new HashMap<>();
  for (Map.Entry<String, String> tag : span.tags().entrySet()) {
    labels.put(label(tag.getKey()), tag.getValue());
  }
  for (Log log : span.logs()) {
    labels.put(label(log.getEvent()), formatTimestamp(log.getTimestamp()));
  }
  if (span.tags().containsKey(Span.SPAN_PEER_SERVICE_TAG_NAME)) {
    labels.put("/component", span.tags().get(Span.SPAN_PEER_SERVICE_TAG_NAME));
  }
  if (span.getParents() == null || span.getParents().isEmpty()) {
    labels.put("/agent", this.agentName);
  }
  if ((kind == TraceSpan.SpanKind.RPC_CLIENT || kind == TraceSpan.SpanKind.RPC_SERVER)
      && StringUtils.hasText(instanceId)) {
    if (StringUtils.hasText(instanceId)) {
      labels.put(label(Span.INSTANCEID), instanceId);
    }
  }
  return labels;
}
origin: gudaoxuri/dew

TraceLogWrap.request("MQ", name, "");
Span span = tracer.createSpan(name);
Long parentId = !span.getParents().isEmpty() ? span.getParents().get(0) : null;
HashMap<String, Object> hashMap = new HashMap<String, Object>() {{
  put(TraceMessageHeaders.TRACE_ID_NAME, Span.idToHex(span.getTraceId()));
origin: org.springframework.cloud/spring-cloud-gcp-trace

private void rewriteIds(Span span, TraceSpan.SpanKind kind, TraceSpan.Builder builder) {
  if (span.getParents().size() > 0) {
    if (span.getParents().size() > 1) {
      LOGGER.error("Stackdriver Trace doesn't support spans with multiple parents. Omitting "
          + "other parents for " + span);
    parentId = span.getParents().get(0);
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-sleuth-zipkin2

if (convertedSpan.getParents().size() > 0) {
  if (convertedSpan.getParents().size() > 1) {
    log.error("Zipkin doesn't support spans with multiple parents. Omitting "
        + "other parents for " + convertedSpan);
  zipkinSpan.parentId(Span.idToHex(convertedSpan.getParents().get(0)));
origin: census-instrumentation/opencensus-java

} else {
 span.stop();
 if (savedSpan != null && span.getParents().contains(savedSpan.getSpanId())) {
  this.spanReporter.report(span);
  this.spanLogger.logStoppedSpan(savedSpan, span);
org.springframework.cloud.sleuthSpangetParents

Popular methods of Span

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • Kernel (java.awt.image)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Github Copilot alternatives
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