Documentation ¶
Index ¶
- func GetObjectClient(store string, conf loki.Config, cm storage.ClientMetrics) (chunk.ObjectClient, error)
- func LoadSchemaUsingObjectClient(oc chunk.ObjectClient, name string) (*config.SchemaConfig, error)
- type PartFile
- type Query
- func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string, useRemoteSchema bool) error
- func (q *Query) DoQuery(c client.Client, out output.LogOutput, statistics bool)
- func (q *Query) DoQueryParallel(c client.Client, out output.LogOutput, statistics bool)
- func (q *Query) SetInstant(time time.Time)
- func (q *Query) TailQuery(delayFor time.Duration, c client.Client, out output.LogOutput)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetObjectClient ¶
func GetObjectClient(store string, conf loki.Config, cm storage.ClientMetrics) (chunk.ObjectClient, error)
func LoadSchemaUsingObjectClient ¶
func LoadSchemaUsingObjectClient(oc chunk.ObjectClient, name string) (*config.SchemaConfig, error)
LoadSchemaUsingObjectClient returns the loaded schema from the object with the given name
Types ¶
type PartFile ¶
type PartFile struct {
// contains filtered or unexported fields
}
PartFile partially complete file. Expected usage:
- Create the temp file: CreateTemp
- Write the data to the file
- When you're done, call Finalize and the temp file will be closed and renamed
func NewPartFile ¶
NewPartFile initializes a new partial file object, setting the filename which will be used when the file is closed with the Finalize function.
This will not create the file, call CreateTemp to create the file.
func (*PartFile) Close ¶
Close closes the temporary file. Double close is handled gracefully without error so that Close can be deferred for errors, and is also called when Finalize is called.
func (*PartFile) CreateTempFile ¶
CreateTempFile creates the temp file to store the data before Finalize is called.
type Query ¶
type Query struct { QueryString string Start time.Time End time.Time Limit int BatchSize int Forward bool Step time.Duration Interval time.Duration Quiet bool NoLabels bool IgnoreLabelsKey []string ShowLabelsKey []string FixedLabelsLen int ColoredOutput bool LocalConfig string FetchSchemaFromStorage bool SchemaStore string // The duration of each part/job. ParallelDuration time.Duration // Number of workers to start. ParallelMaxWorkers int // Path prefix of the name for each part file. // The idea for this is to allow the user to download many different queries at the same // time, and/or give a directory for the part files to be placed. PartPathPrefix string // By default (false value), if the part file has finished downloading, and another job with // the same filename is run, it will skip the completed files. This will remove the completed // files as each worker gets to that part file, so the part will be downloaded again. OverwriteCompleted bool // If true, the part files will be read in order, and the data will be output to stdout. MergeParts bool // If MergeParts is false, this parameter has no effect, part files will be kept. // Otherwise, if this is true, the part files will not be deleted once they have been merged. KeepParts bool }
Query contains all necessary fields to execute instant and range queries and print the results.
func (*Query) DoLocalQuery ¶
func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string, useRemoteSchema bool) error
DoLocalQuery executes the query against the local store using a Loki configuration file.
func (*Query) DoQueryParallel ¶
func (*Query) SetInstant ¶
SetInstant makes the Query an instant type