Tabnine Logo
Tracer.setSpanLoggingRepresentation
Code IndexAdd Tabnine to your IDE (free)

How to use
setSpanLoggingRepresentation
method
in
com.nike.wingtips.Tracer

Best Java code snippets using com.nike.wingtips.Tracer.setSpanLoggingRepresentation (Showing top 5 results out of 315)

origin: Nike-Inc/wingtips

@Autowired
public WingtipsSpringBootConfiguration(WingtipsSpringBootProperties wingtipsProperties) {
  this.wingtipsProperties = wingtipsProperties;
  // Set the span logging representation if specified in the wingtips properties.
  if (wingtipsProperties.getSpanLoggingFormat() != null) {
    Tracer.getInstance().setSpanLoggingRepresentation(wingtipsProperties.getSpanLoggingFormat());
  }
}
origin: Nike-Inc/wingtips

private Span findCompletedSpanByCriteria(Predicate<Span> criteria) {
  Tracer.getInstance().setSpanLoggingRepresentation(Tracer.SpanLoggingRepresentation.KEY_VALUE);
  List<Span> matchingSpans = spanRecorder.completedSpans.stream().filter(criteria).collect(Collectors.toList());
  assertThat(matchingSpans)
    .withFailMessage(
      "Expected to find exactly 1 span matching the specified criteria - instead found: "
      + matchingSpans.size()
    )
    .hasSize(1);
  return matchingSpans.get(0);
}
origin: Nike-Inc/wingtips

@Test(expected = IllegalArgumentException.class)
public void setSpanLoggingRepresentation_blows_up_if_spanLoggingRepresentation_is_null() {
  // expect
  Tracer.getInstance().setSpanLoggingRepresentation(null);
}
origin: Nike-Inc/wingtips

@DataProvider(value = {
  "JSON",
  "KEY_VALUE"
}, splitBy = "\\|")
@Test
public void verify_span_serialization_methods(Tracer.SpanLoggingRepresentation serializationOption) {
  // given
  Span span = Span.generateRootSpanForNewTrace(UUID.randomUUID().toString(), SpanPurpose.LOCAL_ONLY).build();
  String expectedOutput;
  switch(serializationOption) {
    case JSON:
      expectedOutput = span.toJSON();
      break;
    case KEY_VALUE:
      expectedOutput = span.toKeyValueString();
      break;
    default:
      throw new IllegalArgumentException("Unhandled option: " + serializationOption);
  }
  Tracer.getInstance().setSpanLoggingRepresentation(serializationOption);
  // then
  assertThat(Tracer.getInstance().getSpanLoggingRepresentation()).isEqualTo(serializationOption);
  // and when
  String serializedString = Tracer.getInstance().serializeSpanToDesiredStringRepresentation(span);
  // then
  assertThat(serializedString).isEqualTo(expectedOutput);
}
origin: Nike-Inc/wingtips

private void resetTracer() {
  Tracer.getInstance().completeRequestSpan();
  Tracer.getInstance().setRootSpanSamplingStrategy(new SampleAllTheThingsStrategy());
  for (SpanLifecycleListener listener : new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners())) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
  Tracer.getInstance().setSpanLoggingRepresentation(Tracer.SpanLoggingRepresentation.JSON);
}
com.nike.wingtipsTracersetSpanLoggingRepresentation

Javadoc

Sets the option for how spans will be serialized when they are completed and logged.

Popular methods of Tracer

  • getInstance
  • getCurrentSpan
  • addSpanLifecycleListener
    Adds the given listener to the #spanLifecycleListeners list using java.util.List#add(Object). This m
  • getSpanLifecycleListeners
  • removeSpanLifecycleListener
    Returns the value of calling java.util.List#remove(Object) on #spanLifecycleListeners.
  • getCurrentSpanStackCopy
  • startRequestWithRootSpan
  • unregisterFromThread
  • completeRequestSpan
  • startSpanInCurrentContext
  • registerWithThread
  • startSubSpan
  • registerWithThread,
  • startSubSpan,
  • completeSubSpan,
  • startRequestWithChildSpan,
  • configureMDC,
  • containsSameSpansInSameOrder,
  • getCurrentManagedStatusForSpan,
  • getCurrentSpanStackSize,
  • getCurrentTracingStateCopy

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Reference (javax.naming)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
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