Package com.smeup.kokos.sdk.trace
Class SmeupSpan
java.lang.Object
com.smeup.kokos.sdk.trace.SmeupSpan
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidendSpan()setAttribute(String key, boolean value) Set attribute for span.setAttribute(String key, double value) Set attribute for span.setAttribute(String key, long value) Set attribute for span.setAttribute(String key, String value) Set attribute for span.Start a new tracing span.Deprecated.
-
Constructor Details
-
SmeupSpan
public SmeupSpan()
-
-
Method Details
-
startSpan
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
Set attribute for span.- Parameters:
key- The key of the attribute.value- The value of the attribute.
-
setAttribute
Set attribute for span.- Parameters:
key- The key of the attribute.value- The value of the attribute.
-
setAttribute
Set attribute for span.- Parameters:
key- The key of the attribute.value- The value of the attribute.
-
setAttribute
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:
closein interfaceAutoCloseable
-