Package codes.grow.packages.loki
Record Class LabelsOptions
java.lang.Object
java.lang.Record
codes.grow.packages.loki.LabelsOptions
- Record Components:
start- window start, or emptyend- window end, or emptyquery- stream selector that scopes the result, or empty
public record LabelsOptions(Optional<Instant> start, Optional<Instant> end, Optional<String> query)
extends Record
Options of
LokiClient.labels() and LokiClient.labelValues(java.lang.String).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LabelsOptionsdefaults()The server's default window (last 6 hours), all streams.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LabelsOptionsOptions for the window[now - window, now](thesinceof the other languages, computed on the client).static LabelsOptionsA window.query()Returns the value of thequeryrecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.A copy scoped to the streams matching a selector.
-
Constructor Details
-
LabelsOptions
Normalizesnullfields to empty.- Parameters:
start- startend- endquery- selector
-
-
Method Details
-
defaults
The server's default window (last 6 hours), all streams.- Returns:
- default options
-
of
A window.- Parameters:
start- start ornullend- end ornull- Returns:
- the options
-
last
Options for the window[now - window, now](thesinceof the other languages, computed on the client).- Parameters:
window- positive duration- Returns:
- the options
-
withQuery
A copy scoped to the streams matching a selector.- Parameters:
selector- stream selector such as{app="x"}- Returns:
- the options
-
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). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-