Record Class NativeLog

java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.NativeLog
Record Components:
serviceName - service name
serviceId - service id
serviceInstanceName - instance name, may be empty
endpointName - endpoint name, may be empty
traceId - native or hex trace id; "" when the log has no trace context
timestamp - epoch milliseconds
contentType - TEXT, JSON or YAML
content - log body
tags - tags

public record NativeLog(String serviceName, String serviceId, String serviceInstanceName, String endpointName, String traceId, long timestamp, String contentType, String content, List<KeyValue> tags) extends Record
A log record as OAP stores it (GraphQL queryLogs).
  • Constructor Details

    • NativeLog

      public NativeLog(String serviceName, String serviceId, String serviceInstanceName, String endpointName, String traceId, long timestamp, String contentType, String content, List<KeyValue> tags)
      Copies the tags.
      Parameters:
      serviceName - service
      serviceId - service id
      serviceInstanceName - instance
      endpointName - endpoint
      traceId - trace id
      timestamp - time
      contentType - content type
      content - content
      tags - tags
  • Method Details

    • fromJson

      public static NativeLog fromJson(com.fasterxml.jackson.databind.JsonNode l)
      Decodes one log (missing fields get neutral defaults).
      Parameters:
      l - JSON object
      Returns:
      the log
    • tag

      public Optional<String> tag(String key)
      The first value of a tag.
      Parameters:
      key - tag key
      Returns:
      the value, or empty
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • serviceName

      public String serviceName()
      Returns the value of the serviceName record component.
      Returns:
      the value of the serviceName record component
    • serviceId

      public String serviceId()
      Returns the value of the serviceId record component.
      Returns:
      the value of the serviceId record component
    • serviceInstanceName

      public String serviceInstanceName()
      Returns the value of the serviceInstanceName record component.
      Returns:
      the value of the serviceInstanceName record component
    • endpointName

      public String endpointName()
      Returns the value of the endpointName record component.
      Returns:
      the value of the endpointName record component
    • traceId

      public String traceId()
      Returns the value of the traceId record component.
      Returns:
      the value of the traceId record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • contentType

      public String contentType()
      Returns the value of the contentType record component.
      Returns:
      the value of the contentType record component
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • tags

      public List<KeyValue> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component