Class SmeupSpan

java.lang.Object
com.smeup.kokos.sdk.trace.SmeupSpan
All Implemented Interfaces:
AutoCloseable

public class SmeupSpan extends Object implements AutoCloseable
  • Constructor Details

    • SmeupSpan

      public SmeupSpan()
  • Method Details

    • startSpan

      public SmeupSpan startSpan(String spanName)
      Start a new tracing span.
      Parameters:
      spanName - The span name.
    • startSpan

      @Deprecated public SmeupSpan startSpan(String spanName, io.opentelemetry.api.common.Attributes attributes)
      Deprecated.
      Starts a new span with the given name and attributes using OpenTelemetry. Example:
       // Build attributes for the span
       Attributes attributes = Attributes.builder()
               .put(AttributeKey.stringKey("user.id"), "12345")
               .put(AttributeKey.stringKey("operation"), "data-processing")
               .put(AttributeKey.booleanKey("isSuccess"), true)
               .build();
       
       // Start a span with a name and attributes
       smeupSpan.startSpan("processDataSpan", attributes);
       
       // Perform operations within the span...
       
       // Close the span (optional depending on implementation)
       smeupSpan.end();
       
    • setAttribute

      public SmeupSpan setAttribute(String key, String value)
      Set attribute for span.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • setAttribute

      public SmeupSpan setAttribute(String key, long value)
      Set attribute for span.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • setAttribute

      public SmeupSpan setAttribute(String key, double value)
      Set attribute for span.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • setAttribute

      public SmeupSpan setAttribute(String key, boolean value)
      Set attribute for span.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • endSpan

      public void endSpan()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable