Package codes.grow.packages.skywalking
Record Class NativeLog
java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.NativeLog
- Record Components:
serviceName- service nameserviceId- service idserviceInstanceName- instance name, may be emptyendpointName- endpoint name, may be emptytraceId- native or hex trace id;""when the log has no trace contexttimestamp- epoch millisecondscontentType-TEXT,JSONorYAMLcontent- log body- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.Returns the value of thecontentTyperecord component.Returns the value of theendpointNamerecord component.final booleanIndicates whether some other object is "equal to" this one.static NativeLogfromJson(com.fasterxml.jackson.databind.JsonNode l) Decodes one log (missing fields get neutral defaults).final inthashCode()Returns a hash code value for this object.Returns the value of theserviceIdrecord component.Returns the value of theserviceInstanceNamerecord component.Returns the value of theserviceNamerecord component.The first value of a tag.tags()Returns the value of thetagsrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.traceId()Returns the value of thetraceIdrecord component.
-
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- serviceserviceId- service idserviceInstanceName- instanceendpointName- endpointtraceId- trace idtimestamp- timecontentType- content typecontent- contenttags- tags
-
-
Method Details
-
fromJson
Decodes one log (missing fields get neutral defaults).- Parameters:
l- JSON object- Returns:
- the log
-
tag
The first value of a tag.- Parameters:
key- tag key- Returns:
- the value, or empty
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
serviceName
Returns the value of theserviceNamerecord component.- Returns:
- the value of the
serviceNamerecord component
-
serviceId
Returns the value of theserviceIdrecord component.- Returns:
- the value of the
serviceIdrecord component
-
serviceInstanceName
Returns the value of theserviceInstanceNamerecord component.- Returns:
- the value of the
serviceInstanceNamerecord component
-
endpointName
Returns the value of theendpointNamerecord component.- Returns:
- the value of the
endpointNamerecord component
-
traceId
Returns the value of thetraceIdrecord component.- Returns:
- the value of the
traceIdrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-