Class SpanMetadata

java.lang.Object
com.google.genkit.core.tracing.SpanMetadata

public class SpanMetadata extends Object
SpanMetadata contains metadata for a tracing span.
  • Constructor Details

    • SpanMetadata

      public SpanMetadata()
      Creates a new SpanMetadata.
    • SpanMetadata

      public SpanMetadata(String name, String type, String subtype, Map<String,Object> attributes)
      Creates a new SpanMetadata with the specified values.
      Parameters:
      name - the span name
      type - the span type
      subtype - the span subtype
      attributes - additional attributes
  • Method Details

    • builder

      public static SpanMetadata.Builder builder()
      Creates a builder for SpanMetadata.
      Returns:
      a new builder
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getSubtype

      public String getSubtype()
    • setSubtype

      public void setSubtype(String subtype)
    • getAttributes

      public Map<String,Object> getAttributes()
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
    • addAttribute

      public SpanMetadata addAttribute(String key, Object value)
      Adds an attribute to the span metadata.
      Parameters:
      key - the attribute key
      value - the attribute value
      Returns:
      this SpanMetadata for chaining