Documentation ¶
Index ¶
- func DeleteSeries(at *auth.Token, sq *storage.SearchQuery, deadline searchutils.Deadline) (int, error)
- func ExportBlocks(at *auth.Token, sq *storage.SearchQuery, deadline searchutils.Deadline, ...) error
- func GetGraphiteTagValues(at *auth.Token, denyPartialResponse bool, tagName, filter string, limit int, ...) ([]string, bool, error)
- func GetGraphiteTags(at *auth.Token, denyPartialResponse bool, filter string, limit int, ...) ([]string, bool, error)
- func GetLabelEntries(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) ([]storage.TagEntry, bool, error)
- func GetLabelValues(at *auth.Token, denyPartialResponse bool, labelName string, ...) ([]string, bool, error)
- func GetLabelValuesOnTimeRange(at *auth.Token, denyPartialResponse bool, labelName string, ...) ([]string, bool, error)
- func GetLabels(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) ([]string, bool, error)
- func GetLabelsOnTimeRange(at *auth.Token, denyPartialResponse bool, tr storage.TimeRange, ...) ([]string, bool, error)
- func GetSeriesCount(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) (uint64, bool, error)
- func GetTSDBStatusForDate(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline, ...) (*storage.TSDBStatus, bool, error)
- func GetTSDBStatusWithFilters(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline, ...) (*storage.TSDBStatus, bool, error)
- func GetTagValueSuffixes(at *auth.Token, denyPartialResponse bool, tr storage.TimeRange, ...) ([]string, bool, error)
- func InitStorageNodes(addrs []string)
- func InitTmpBlocksDir(tmpDirPath string)
- func RegisterMetricNames(at *auth.Token, mrs []storage.MetricRow, deadline searchutils.Deadline) error
- func SearchMetricNames(at *auth.Token, denyPartialResponse bool, sq *storage.SearchQuery, ...) ([]storage.MetricName, bool, error)
- func Stop()
- type Result
- type Results
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSeries ¶
func DeleteSeries(at *auth.Token, sq *storage.SearchQuery, deadline searchutils.Deadline) (int, error)
DeleteSeries deletes time series matching the given sq.
func ExportBlocks ¶ added in v1.42.0
func ExportBlocks(at *auth.Token, sq *storage.SearchQuery, deadline searchutils.Deadline, f func(mn *storage.MetricName, b *storage.Block, tr storage.TimeRange) error) error
ExportBlocks searches for time series matching sq and calls f for each found block.
f is called in parallel from multiple goroutines. It is the responsibility of f to call b.UnmarshalData before reading timestamps and values from the block. It is the responsibility of f to filter blocks according to the given tr.
func GetGraphiteTagValues ¶ added in v1.47.0
func GetGraphiteTagValues(at *auth.Token, denyPartialResponse bool, tagName, filter string, limit int, deadline searchutils.Deadline) ([]string, bool, error)
GetGraphiteTagValues returns tag values for the given tagName until the given deadline.
func GetGraphiteTags ¶ added in v1.47.0
func GetGraphiteTags(at *auth.Token, denyPartialResponse bool, filter string, limit int, deadline searchutils.Deadline) ([]string, bool, error)
GetGraphiteTags returns Graphite tags until the given deadline.
func GetLabelEntries ¶ added in v1.19.0
func GetLabelEntries(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) ([]storage.TagEntry, bool, error)
GetLabelEntries returns all the label entries for at until the given deadline.
func GetLabelValues ¶
func GetLabelValues(at *auth.Token, denyPartialResponse bool, labelName string, deadline searchutils.Deadline) ([]string, bool, error)
GetLabelValues returns label values for the given labelName until the given deadline.
func GetLabelValuesOnTimeRange ¶ added in v1.46.0
func GetLabelValuesOnTimeRange(at *auth.Token, denyPartialResponse bool, labelName string, tr storage.TimeRange, deadline searchutils.Deadline) ([]string, bool, error)
GetLabelValuesOnTimeRange returns label values for the given labelName on the given tr until the given deadline.
func GetLabels ¶
func GetLabels(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) ([]string, bool, error)
GetLabels returns labels until the given deadline.
func GetLabelsOnTimeRange ¶ added in v1.46.0
func GetLabelsOnTimeRange(at *auth.Token, denyPartialResponse bool, tr storage.TimeRange, deadline searchutils.Deadline) ([]string, bool, error)
GetLabelsOnTimeRange returns labels for the given tr until the given deadline.
func GetSeriesCount ¶
func GetSeriesCount(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline) (uint64, bool, error)
GetSeriesCount returns the number of unique series for the given at.
func GetTSDBStatusForDate ¶ added in v1.35.0
func GetTSDBStatusForDate(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline, date uint64, topN int) (*storage.TSDBStatus, bool, error)
GetTSDBStatusForDate returns tsdb status according to https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats
func GetTSDBStatusWithFilters ¶ added in v1.60.0
func GetTSDBStatusWithFilters(at *auth.Token, denyPartialResponse bool, deadline searchutils.Deadline, sq *storage.SearchQuery, topN int) (*storage.TSDBStatus, bool, error)
GetTSDBStatusWithFilters returns tsdb status according to https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats
It accepts aribtrary filters on time series in sq.
func GetTagValueSuffixes ¶ added in v1.41.0
func GetTagValueSuffixes(at *auth.Token, denyPartialResponse bool, tr storage.TimeRange, tagKey, tagValuePrefix string, delimiter byte, deadline searchutils.Deadline) ([]string, bool, error)
GetTagValueSuffixes returns tag value suffixes for the given tagKey and the given tagValuePrefix.
It can be used for implementing https://graphite-api.readthedocs.io/en/latest/api.html#metrics-find
func InitStorageNodes ¶
func InitStorageNodes(addrs []string)
InitStorageNodes initializes storage nodes' connections to the given addrs.
func InitTmpBlocksDir ¶
func InitTmpBlocksDir(tmpDirPath string)
InitTmpBlocksDir initializes directory to store temporary search results.
It stores data in system-defined temporary directory if tmpDirPath is empty.
func RegisterMetricNames ¶
func RegisterMetricNames(at *auth.Token, mrs []storage.MetricRow, deadline searchutils.Deadline) error
RegisterMetricNames registers metric names from mrs in the storage.
func SearchMetricNames ¶ added in v1.47.0
func SearchMetricNames(at *auth.Token, denyPartialResponse bool, sq *storage.SearchQuery, deadline searchutils.Deadline) ([]storage.MetricName, bool, error)
SearchMetricNames returns all the metric names matching sq until the given deadline.
Types ¶
type Result ¶
type Result struct { // The name of the metric. MetricName storage.MetricName // Values are sorted by Timestamps. Values []float64 Timestamps []int64 }
Result is a single timeseries result.
ProcessSearchQuery returns Result slice.
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results holds results returned from ProcessSearchQuery.
func ProcessSearchQuery ¶
func ProcessSearchQuery(at *auth.Token, denyPartialResponse bool, sq *storage.SearchQuery, fetchData bool, deadline searchutils.Deadline) (*Results, bool, error)
ProcessSearchQuery performs sq until the given deadline.
Results.RunParallel or Results.Cancel must be called on the returned Results.
func (*Results) RunParallel ¶
RunParallel runs f in parallel for all the results from rss.
f shouldn't hold references to rs after returning. workerID is the id of the worker goroutine that calls f. Data processing is immediately stopped if f returns non-nil error.
rss becomes unusable after the call to RunParallel.