Package codes.grow.packages.skywalking
Record Class ParsedLogQuery
java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.ParsedLogQuery
- Record Components:
service- service name, or emptyinstance- instance name, or emptyendpoint- endpoint name, or emptytraceId- related trace id, or empty- server-side tag filterstext- free-text terms, matched client side
public record ParsedLogQuery(Optional<String> service, Optional<String> instance, Optional<String> endpoint, Optional<String> traceId, Map<String,String> tags, List<String> text)
extends Record
Parsed form of a
SkyWalkingLogQueryClient query: space-separated key=value terms
(service=, instance=, endpoint=, trace_id=/traceId= map
to the GraphQL condition; any other key is a server tag filter and must be in
SW_SEARCHABLE_LOGS_TAG_KEYS) plus free-text terms ("quoted phrases" allowed). Every
free-text term must occur (case-insensitive) in the content or in a tag value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionendpoint()Returns the value of theendpointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.instance()Returns the value of theinstancerecord component.booleanmatchesText(NativeLog log) Whether every free-text term occurs (case-insensitive) in the log content or a tag value.static ParsedLogQueryParses a query (see the record description).service()Returns the value of theservicerecord component.tags()Returns the value of thetagsrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.traceId()Returns the value of thetraceIdrecord component.
-
Constructor Details
-
ParsedLogQuery
public ParsedLogQuery(Optional<String> service, Optional<String> instance, Optional<String> endpoint, Optional<String> traceId, Map<String, String> tags, List<String> text) Copies collections and normalises nulls.- Parameters:
service- serviceinstance- instanceendpoint- endpointtraceId- trace idtags- tagstext- text terms
-
-
Method Details
-
parse
Parses a query (see the record description).- Parameters:
query- query text (null = everything)- Returns:
- the parsed query
-
matchesText
Whether every free-text term occurs (case-insensitive) in the log content or a tag value.- Parameters:
log- stored log- Returns:
- true when the log matches
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
service
Returns the value of theservicerecord component.- Returns:
- the value of the
servicerecord component
-
instance
Returns the value of theinstancerecord component.- Returns:
- the value of the
instancerecord component
-
endpoint
Returns the value of theendpointrecord component.- Returns:
- the value of the
endpointrecord component
-
traceId
Returns the value of thetraceIdrecord component.- Returns:
- the value of the
traceIdrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-