Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFieldMappingConfig = logs.FieldMappingConfig{ Severity: []string{"detected_level"}, Host: []string{"pod"}, }
Functions ¶
func NewSearcher ¶
func NewSearcher(conn connection.Loki, mappingConfig *logs.FieldMappingConfig) *lokiSearcher
Types ¶
type Data ¶
type Data struct {
ResultType string `json:"resultType"`
Stats map[string]any `json:"stats"`
// Logs per label (aka. stream)
Result []Result `json:"result"`
}
Data holds the actual query results and statistics.
type LokiResponse ¶
type LokiResponse struct {
Status string `json:"status"`
Data Data `json:"data"`
ErrorType v1.ErrorType `json:"errorType,omitempty"`
Error string `json:"error,omitempty"`
}
LokiResponse represents the top-level response from Loki's query_range API.
func (*LokiResponse) ToLogResult ¶
func (t *LokiResponse) ToLogResult(mappingConfig logs.FieldMappingConfig) logs.LogResult
type Request ¶
type Request struct {
logs.LogsRequestBase `json:",inline" template:"true"`
// Query is the LogQL query to perform
Query string `json:"query,omitempty" template:"true"`
// Since is a duration used to calculate start relative to end.
// If end is in the future, start is calculated as this duration before now.
// Any value specified for start supersedes this parameter.
Since string `json:"since,omitempty"`
// Step is the Query resolution step width in duration format or float number of seconds
Step string `json:"step,omitempty"`
// Only return entries at (or greater than) the specified interval, can be a duration format or float number of seconds
Interval string `json:"interval,omitempty"`
// Direction is the direction of the query. "forward" or "backward" (default)
Direction string `json:"direction,omitempty"`
}
Request represents available parameters for Loki queries.
+kubebuilder:object:generate=true
func (*Request) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Request.
func (*Request) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Click to show internal directories.
Click to hide internal directories.