Class SimpleSpan

java.lang.Object
io.micrometer.tracing.test.simple.SimpleSpan
All Implemented Interfaces:
io.micrometer.tracing.exporter.FinishedSpan, io.micrometer.tracing.Span, io.micrometer.tracing.SpanCustomizer

public class SimpleSpan extends Object implements io.micrometer.tracing.Span, io.micrometer.tracing.exporter.FinishedSpan
A test implementation of a span.
Since:
1.0.0
  • Constructor Details

    • SimpleSpan

      public SimpleSpan()
      Creates a new instance of SimpleSpan.
  • Method Details

    • isNoop

      public boolean isNoop()
      Specified by:
      isNoop in interface io.micrometer.tracing.Span
    • context

      public SimpleTraceContext context()
      Specified by:
      context in interface io.micrometer.tracing.Span
    • start

      public SimpleSpan start()
      Specified by:
      start in interface io.micrometer.tracing.Span
    • name

      public SimpleSpan name(String name)
      Specified by:
      name in interface io.micrometer.tracing.Span
      Specified by:
      name in interface io.micrometer.tracing.SpanCustomizer
    • event

      public SimpleSpan event(String value)
      Specified by:
      event in interface io.micrometer.tracing.Span
      Specified by:
      event in interface io.micrometer.tracing.SpanCustomizer
    • event

      public io.micrometer.tracing.Span event(String value, long time, TimeUnit timeUnit)
      Specified by:
      event in interface io.micrometer.tracing.Span
    • tag

      public SimpleSpan tag(String key, String value)
      Specified by:
      tag in interface io.micrometer.tracing.Span
      Specified by:
      tag in interface io.micrometer.tracing.SpanCustomizer
    • error

      public SimpleSpan error(Throwable throwable)
      Specified by:
      error in interface io.micrometer.tracing.Span
    • remoteIpAndPort

      public SimpleSpan remoteIpAndPort(String ip, int port)
      Specified by:
      remoteIpAndPort in interface io.micrometer.tracing.Span
    • end

      public void end()
      Specified by:
      end in interface io.micrometer.tracing.Span
    • end

      public void end(long time, TimeUnit timeUnit)
      Specified by:
      end in interface io.micrometer.tracing.Span
    • abandon

      public void abandon()
      Specified by:
      abandon in interface io.micrometer.tracing.Span
    • remoteServiceName

      public SimpleSpan remoteServiceName(String remoteServiceName)
      Specified by:
      remoteServiceName in interface io.micrometer.tracing.Span
    • getTags

      public Map<String,String> getTags()
      Map of tags.
      Specified by:
      getTags in interface io.micrometer.tracing.exporter.FinishedSpan
      Returns:
      tags
    • setEvents

      public io.micrometer.tracing.exporter.FinishedSpan setEvents(Collection<Map.Entry<Long,String>> events)
      Specified by:
      setEvents in interface io.micrometer.tracing.exporter.FinishedSpan
    • getEvents

      public Collection<Map.Entry<Long,String>> getEvents()
      Specified by:
      getEvents in interface io.micrometer.tracing.exporter.FinishedSpan
    • getRemoteServiceName

      public String getRemoteServiceName()
      Remote service name of the span.
      Specified by:
      getRemoteServiceName in interface io.micrometer.tracing.exporter.FinishedSpan
      Returns:
      remote service name
    • setRemoteServiceName

      public io.micrometer.tracing.exporter.FinishedSpan setRemoteServiceName(String remoteServiceName)
      Specified by:
      setRemoteServiceName in interface io.micrometer.tracing.exporter.FinishedSpan
    • getSpanId

      public String getSpanId()
      Specified by:
      getSpanId in interface io.micrometer.tracing.exporter.FinishedSpan
    • getParentId

      public String getParentId()
      Specified by:
      getParentId in interface io.micrometer.tracing.exporter.FinishedSpan
    • getRemoteIp

      public String getRemoteIp()
      Specified by:
      getRemoteIp in interface io.micrometer.tracing.exporter.FinishedSpan
    • getLocalIp

      public String getLocalIp()
      Specified by:
      getLocalIp in interface io.micrometer.tracing.exporter.FinishedSpan
    • setLocalIp

      public io.micrometer.tracing.exporter.FinishedSpan setLocalIp(String ip)
      Specified by:
      setLocalIp in interface io.micrometer.tracing.exporter.FinishedSpan
    • getRemotePort

      public int getRemotePort()
      Specified by:
      getRemotePort in interface io.micrometer.tracing.exporter.FinishedSpan
    • setRemotePort

      public io.micrometer.tracing.exporter.FinishedSpan setRemotePort(int port)
      Specified by:
      setRemotePort in interface io.micrometer.tracing.exporter.FinishedSpan
    • getTraceId

      public String getTraceId()
      Specified by:
      getTraceId in interface io.micrometer.tracing.exporter.FinishedSpan
    • getError

      public Throwable getError()
      Specified by:
      getError in interface io.micrometer.tracing.exporter.FinishedSpan
    • setError

      public io.micrometer.tracing.exporter.FinishedSpan setError(Throwable error)
      Specified by:
      setError in interface io.micrometer.tracing.exporter.FinishedSpan
    • getKind

      public io.micrometer.tracing.Span.Kind getKind()
      Specified by:
      getKind in interface io.micrometer.tracing.exporter.FinishedSpan
    • setName

      public io.micrometer.tracing.exporter.FinishedSpan setName(String name)
      Specified by:
      setName in interface io.micrometer.tracing.exporter.FinishedSpan
    • getName

      public String getName()
      Span name.
      Specified by:
      getName in interface io.micrometer.tracing.exporter.FinishedSpan
      Returns:
      span name
    • getStartTimestamp

      public Instant getStartTimestamp()
      Specified by:
      getStartTimestamp in interface io.micrometer.tracing.exporter.FinishedSpan
    • getEndTimestamp

      public Instant getEndTimestamp()
      Specified by:
      getEndTimestamp in interface io.micrometer.tracing.exporter.FinishedSpan
    • setTags

      public io.micrometer.tracing.exporter.FinishedSpan setTags(Map<String,String> tags)
      Specified by:
      setTags in interface io.micrometer.tracing.exporter.FinishedSpan
    • getClock

      public Clock getClock()
      Clock used for time measurements.
      Returns:
      clock
    • toString

      public String toString()
      Overrides:
      toString in class Object