Documentation ¶
Index ¶
- Constants
- func Match(xs []string) ([][]*labels.Matcher, error)
- func ParseLabelQuery(r *http.Request) (*logproto.LabelRequest, error)
- func ParseSeriesQuery(r *http.Request) (*logproto.SeriesRequest, error)
- func ParseTailQuery(r *http.Request) (*logproto.TailRequest, error)
- type DroppedStream
- type Entry
- type InstantQuery
- type LabelResponse
- type LabelSet
- type Matrix
- type PushRequest
- type QueryResponse
- type QueryResponseData
- type QueryStatus
- type RangeQuery
- type ResultType
- type ResultValue
- type Scalar
- type SeriesResponse
- type Stream
- type Streams
- type TailResponse
- type Vector
- type Version
Constants ¶
const ( QueryStatusSuccess = "success" QueryStatusFail = "fail" )
QueryStatus values
const ( ResultTypeStream = "streams" ResultTypeScalar = "scalar" ResultTypeVector = "vector" ResultTypeMatrix = "matrix" )
ResultType values
const ( VersionLegacy = Version(iota) VersionV1 )
Valid Version values
Variables ¶
This section is empty.
Functions ¶
func Match ¶ added in v1.3.0
Match extracts and parses multiple matcher groups from a slice of strings
func ParseLabelQuery ¶
func ParseLabelQuery(r *http.Request) (*logproto.LabelRequest, error)
ParseLabelQuery parses a LabelRequest request from an http request.
func ParseSeriesQuery ¶ added in v1.3.0
func ParseSeriesQuery(r *http.Request) (*logproto.SeriesRequest, error)
func ParseTailQuery ¶
func ParseTailQuery(r *http.Request) (*logproto.TailRequest, error)
ParseTailQuery parses a TailRequest request from an http request.
Types ¶
type DroppedStream ¶
DroppedStream represents a dropped stream in tail call
func (*DroppedStream) MarshalJSON ¶
func (s *DroppedStream) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaller
func (*DroppedStream) UnmarshalJSON ¶
func (s *DroppedStream) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.UnMarshaller
type Entry ¶
Entry represents a log entry. It includes a log message and the time it occurred at.
func (*Entry) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Entry) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type InstantQuery ¶
InstantQuery defines a log instant query.
func ParseInstantQuery ¶
func ParseInstantQuery(r *http.Request) (*InstantQuery, error)
ParseInstantQuery parses an InstantQuery request from an http request.
type LabelResponse ¶
LabelResponse represents the http json response to a label query
type LabelSet ¶
LabelSet is a key/value pair mapping of labels
type PushRequest ¶
type PushRequest struct {
Streams []*Stream `json:"streams"`
}
PushRequest models a log stream push
type QueryResponse ¶
type QueryResponse struct { Status string `json:"status"` Data QueryResponseData `json:"data"` }
QueryResponse represents the http json response to a label query
type QueryResponseData ¶
type QueryResponseData struct { ResultType ResultType `json:"resultType"` Result ResultValue `json:"result"` Statistics stats.Result `json:"stats"` }
QueryResponseData represents the http json response to a label query
func (*QueryResponseData) UnmarshalJSON ¶
func (q *QueryResponseData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type RangeQuery ¶
type RangeQuery struct { Start time.Time End time.Time Step time.Duration Interval time.Duration Query string Direction logproto.Direction Limit uint32 Shards []string }
RangeQuery defines a log range query.
func ParseRangeQuery ¶
func ParseRangeQuery(r *http.Request) (*RangeQuery, error)
ParseRangeQuery parses a RangeQuery request from an http request.
type ResultValue ¶
type ResultValue interface {
Type() ResultType
}
ResultValue interface mimics the promql.Value interface
type Scalar ¶ added in v1.4.0
Scalar is a single timestamp/float with no labels
func (Scalar) MarshalJSON ¶ added in v1.4.0
func (Scalar) Type ¶ added in v1.4.0
func (Scalar) Type() ResultType
Type implements the promql.Value interface
func (*Scalar) UnmarshalJSON ¶ added in v1.4.0
type SeriesResponse ¶ added in v1.3.0
type TailResponse ¶
type TailResponse struct { Streams []Stream `json:"streams,omitempty"` DroppedStreams []DroppedStream `json:"dropped_entries,omitempty"` }
TailResponse represents the http json response to a tail query