Documentation
¶
Index ¶
- func FetchOptionsToM3Options(fetchOptions *FetchOptions, fetchQuery *FetchQuery) index.QueryOptions
- func FetchQueryToM3Query(fetchQuery *FetchQuery) (index.Query, error)
- func FetchResultToPromResult(result *FetchResult) *prompb.QueryResult
- func FromIdentTagIteratorToTags(identTags ident.TagIterator) (models.Tags, error)
- func FromM3IdentToMetric(identNamespace, identID ident.ID, iterTags ident.TagIterator) (*models.Metric, error)
- func PromLabelsToM3Tags(labels []*prompb.Label) models.Tags
- func PromMatcherToM3(matcher *prompb.LabelMatcher) (*models.Matcher, error)
- func PromMatchersToM3(matchers []*prompb.LabelMatcher) (models.Matchers, error)
- func PromSamplesToM3Datapoints(samples []*prompb.Sample) ts.Datapoints
- func PromTypeToM3(labelType prompb.LabelMatcher_Type) (models.MatchType, error)
- func SeriesToPromSamples(series *ts.Series) []*prompb.Sample
- func SeriesToPromTS(series *ts.Series) *prompb.TimeSeries
- func TagsToIdentTagIterator(tags models.Tags) ident.TagIterator
- func TagsToPromLabels(tags models.Tags) []*prompb.Label
- func TimeToTimestamp(timestamp time.Time) int64
- func TimestampToTime(timestampMS int64) time.Time
- type Appender
- type Block
- type BlockMetadata
- type BlockResult
- type Bounds
- type FetchOptions
- type FetchQuery
- type FetchResult
- type Querier
- type Query
- type QueryResult
- type SearchResults
- type SeriesIter
- type SeriesMeta
- type Step
- type StepIter
- type StepMeta
- type Storage
- type Type
- type WriteQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchOptionsToM3Options ¶
func FetchOptionsToM3Options(fetchOptions *FetchOptions, fetchQuery *FetchQuery) index.QueryOptions
FetchOptionsToM3Options converts a set of coordinator options to M3 options
func FetchQueryToM3Query ¶
func FetchQueryToM3Query(fetchQuery *FetchQuery) (index.Query, error)
FetchQueryToM3Query converts an m3coordinator fetch query to an M3 query
func FetchResultToPromResult ¶
func FetchResultToPromResult(result *FetchResult) *prompb.QueryResult
FetchResultToPromResult converts fetch results from M3 to Prometheus result
func FromIdentTagIteratorToTags ¶
func FromIdentTagIteratorToTags(identTags ident.TagIterator) (models.Tags, error)
FromIdentTagIteratorToTags converts ident tags to coordinator tags
func FromM3IdentToMetric ¶
func FromM3IdentToMetric(identNamespace, identID ident.ID, iterTags ident.TagIterator) (*models.Metric, error)
FromM3IdentToMetric converts an M3 ident metric to a coordinator metric
func PromLabelsToM3Tags ¶
PromLabelsToM3Tags converts Prometheus labels to M3 tags
func PromMatcherToM3 ¶
func PromMatcherToM3(matcher *prompb.LabelMatcher) (*models.Matcher, error)
PromMatcherToM3 converts a prometheus label matcher to m3 matcher
func PromMatchersToM3 ¶
func PromMatchersToM3(matchers []*prompb.LabelMatcher) (models.Matchers, error)
PromMatchersToM3 converts prometheus label matchers to m3 matchers
func PromSamplesToM3Datapoints ¶
func PromSamplesToM3Datapoints(samples []*prompb.Sample) ts.Datapoints
PromSamplesToM3Datapoints converts Prometheus samples to M3 datapoints
func PromTypeToM3 ¶
func PromTypeToM3(labelType prompb.LabelMatcher_Type) (models.MatchType, error)
PromTypeToM3 converts a prometheus label type to m3 matcher type
func SeriesToPromSamples ¶
SeriesToPromSamples series datapoints to prometheus samples
func SeriesToPromTS ¶
func SeriesToPromTS(series *ts.Series) *prompb.TimeSeries
SeriesToPromTS converts a series to prometheus timeseries
func TagsToIdentTagIterator ¶
func TagsToIdentTagIterator(tags models.Tags) ident.TagIterator
TagsToIdentTagIterator converts coordinator tags to ident tags
func TagsToPromLabels ¶
TagsToPromLabels converts tags to prometheus labels
func TimeToTimestamp ¶
TimeToTimestamp converts a time.Time to prometheus timestamp
func TimestampToTime ¶
TimestampToTime converts a prometheus timestamp to time.Time
Types ¶
type Appender ¶
type Appender interface { // Write value to the database for an ID Write(ctx context.Context, query *WriteQuery) error }
Appender provides batched appends against a storage.
type Block ¶
type Block interface { Meta() BlockMetadata StepIter() StepIter SeriesIter() SeriesIter SeriesMeta() []SeriesMeta StepMeta() []StepMeta }
Block represents a group of series across a time bound
type BlockMetadata ¶
BlockMetadata is metadata for a block
type BlockResult ¶
type BlockResult struct {
Blocks []Block
}
BlockResult is the result from a block query
type Bounds ¶
type Bounds struct {
// contains filtered or unexported fields
}
Bounds are the time bounds nolint: structcheck, megacheck, unused
type FetchOptions ¶
type FetchOptions struct { Limit int KillChan chan struct{} }
FetchOptions represents the options for fetch query
type FetchQuery ¶
type FetchQuery struct { Raw string TagMatchers models.Matchers `json:"matchers"` Start time.Time `json:"start"` End time.Time `json:"end"` }
FetchQuery represents the input query which is fetched from M3DB
func PromReadQueryToM3 ¶
func PromReadQueryToM3(query *prompb.Query) (*FetchQuery, error)
PromReadQueryToM3 converts a prometheus read query to m3 ready query
func (*FetchQuery) String ¶
func (q *FetchQuery) String() string
type FetchResult ¶
type FetchResult struct { SeriesList []*ts.Series // The aggregated list of results across all underlying storage calls LocalOnly bool HasNext bool }
FetchResult provides a fetch result and meta information
type Querier ¶
type Querier interface { // Fetch fetches timeseries data based on a query Fetch( ctx context.Context, query *FetchQuery, options *FetchOptions) (*FetchResult, error) FetchTags( ctx context.Context, query *FetchQuery, options *FetchOptions) (*SearchResults, error) FetchBlocks( ctx context.Context, query *FetchQuery, options *FetchOptions) (BlockResult, error) }
Querier handles queries against a storage.
type QueryResult ¶
type QueryResult struct { FetchResult *FetchResult Err error }
QueryResult is the result from a query
type SearchResults ¶
SearchResults is the result from a search
type SeriesIter ¶
SeriesIter iterates through a CompressedSeriesIterator horizontally
type SeriesMeta ¶
SeriesMeta is metadata data for the series
type Storage ¶
type Storage interface { Querier Appender // Type identifies the type of the underlying storage Type() Type // Close is used to close the underlying storage and free up resources Close() error }
Storage provides an interface for reading and writing to the tsdb
type WriteQuery ¶
type WriteQuery struct { Raw string Tags models.Tags Datapoints ts.Datapoints Unit xtime.Unit Annotation []byte }
WriteQuery represents the input timeseries that is written to M3DB
func PromWriteTSToM3 ¶
func PromWriteTSToM3(timeseries *prompb.TimeSeries) *WriteQuery
PromWriteTSToM3 converts a prometheus write query to an M3 one
func (*WriteQuery) String ¶
func (q *WriteQuery) String() string