Documentation ¶
Index ¶
- Constants
- func BuildSubQueries(matchers []*labels.Matcher) (*clauseBuilder, error)
- func GetMetadata(clauses []string, values []interface{}) *evalMetadata
- func GetMetricNameSeriesIds(ctx context.Context, conn pgxconn.PgxConn, metadata *evalMetadata) (metrics, schemas []string, correspondingSeriesIDs [][]model.SeriesID, ...)
- func GetPromQLMetadata(matchers []*labels.Matcher, hints *storage.SelectHints, qh *QueryHints, ...) *promqlMetadata
- type ExemplarQuerier
- type Querier
- type QueryHints
- type Reader
- type RemoteReadQuerier
- type SamplesQuerier
- type SeriesSet
- type TimestampSeries
Constants ¶
const ( // Postgres time zero is Sat Jan 01 00:00:00 2000 UTC. // This is the offset of the Unix epoch in milliseconds from the Postgres zero. PostgresUnixEpoch = -946684800000 )
Variables ¶
This section is empty.
Functions ¶
func BuildSubQueries ¶
func GetMetadata ¶
func GetMetadata(clauses []string, values []interface{}) *evalMetadata
func GetMetricNameSeriesIds ¶
func GetPromQLMetadata ¶
func GetPromQLMetadata(matchers []*labels.Matcher, hints *storage.SelectHints, qh *QueryHints, path []parser.Node) *promqlMetadata
Types ¶
type ExemplarQuerier ¶
type ExemplarQuerier interface { // Select returns a series set containing the exemplar that matches the supplied query parameters. Select(start, end time.Time, ms ...[]*labels.Matcher) ([]model.ExemplarQueryResult, error) }
ExemplarQuerier queries data using the provided query data and returns the matching exemplars.
type Querier ¶
type Querier interface { // RemoteReadQuerier returns a remote storage querier RemoteReadQuerier(ctx context.Context) RemoteReadQuerier // SamplesQuerier returns a sample querier. SamplesQuerier(ctx context.Context) SamplesQuerier // ExemplarsQuerier returns an exemplar querier. ExemplarsQuerier(ctx context.Context) ExemplarQuerier }
Querier provides access to the three query methods: remote read, samples, and exemplars.
func NewQuerier ¶
func NewQuerier( conn pgxconn.PgxConn, metricCache cache.MetricCache, labelsReader lreader.LabelsReader, exemplarCache cache.PositionCache, rAuth tenancy.ReadAuthorizer, ) Querier
NewQuerier returns a new pgxQuerier that reads from PostgreSQL using PGX and caches metric table names and label sets using the supplied caches.
type QueryHints ¶
QueryHints contain additional metadata which promscale requires
type Reader ¶
type Reader interface {
Read(context.Context, *prompb.ReadRequest) (*prompb.ReadResponse, error)
}
Reader reads the data based on the provided read request.
type RemoteReadQuerier ¶
type RemoteReadQuerier interface { // Query returns resulting timeseries for a query. Query(*prompb.Query) ([]*prompb.TimeSeries, error) }
RemoteReadQuerier queries the data using the provided query data and returns the matching timeseries.
type SamplesQuerier ¶
type SamplesQuerier interface { // Select returns a series set containing the exemplar that matches the supplied query parameters. Select(mint, maxt int64, sortSeries bool, hints *storage.SelectHints, queryHints *QueryHints, path []parser.Node, ms ...*labels.Matcher) (SeriesSet, parser.Node) }
SamplesQuerier queries data using the provided query data and returns the matching samples.
type SeriesSet ¶
SeriesSet adds a Close method to storage.SeriesSet to provide a way to free memory/
type TimestampSeries ¶
type TimestampSeries interface { //At returns the element at an index location, as well as a bool to indicate //whether the value is valid (or NULL for example) At(index int) (int64, bool) Len() int }
TimestampSeries represent an array of timestamps (model.Time/int64) that is 0-indexed.