Documentation ¶
Index ¶
- Constants
- Variables
- func MatchersString(matchers []*labels.Matcher) string
- func NewMeasuredStorageQueryable(q remotereadstorage.Queryable, rec Recorder, timeNow func() time.Time) remotereadstorage.Queryable
- func NewStorageQueryable(cfg StorageQueryableConfig, tripperware querymiddleware.Tripperware) (remotereadstorage.Queryable, error)
- func NewStreamingSeriesSet(chunkedReader *remote.ChunkedReader, respBody io.ReadCloser, ...) storage.SeriesSet
- type API
- type APIOption
- type Client
- type Config
- type MeasuredAPI
- func (ma *MeasuredAPI) LabelNames(ctx context.Context, matches []string, startTime, endTime time.Time) (s []string, w v1.Warnings, err error)
- func (ma *MeasuredAPI) LabelValues(ctx context.Context, label string, matches []string, ...) (v model.LabelValues, w v1.Warnings, err error)
- func (ma *MeasuredAPI) Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (v model.Value, w v1.Warnings, err error)
- func (ma *MeasuredAPI) QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (v model.Value, w v1.Warnings, err error)
- func (ma *MeasuredAPI) Series(ctx context.Context, matches []string, startTime, endTime time.Time) (ls []model.LabelSet, w v1.Warnings, err error)
- type Recorder
- type StorageQuerierInterface
- type StorageQueryableConfig
- type StorageQueryableInterface
Constants ¶
View Source
const ( UserAgent = "Grafana" InitialBufSize = 32 * 1024 // 32KB SampledContentTypePrefix = "application/x-protobuf" StreamedContentTypePrefix = "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse" PrometheusRemoteReadVersion = "0.1.0" HTTPSuccessStatusPrefix = 2 )
Variables ¶
View Source
var ( AcceptedResponseTypes = []prompb.ReadRequest_ResponseType{ prompb.ReadRequest_STREAMED_XOR_CHUNKS, prompb.ReadRequest_SAMPLES, } )
Functions ¶
func MatchersString ¶
func NewMeasuredStorageQueryable ¶
func NewMeasuredStorageQueryable(q remotereadstorage.Queryable, rec Recorder, timeNow func() time.Time) remotereadstorage.Queryable
func NewStorageQueryable ¶
func NewStorageQueryable(cfg StorageQueryableConfig, tripperware querymiddleware.Tripperware) (remotereadstorage.Queryable, error)
func NewStreamingSeriesSet ¶
func NewStreamingSeriesSet(chunkedReader *remote.ChunkedReader, respBody io.ReadCloser, queryStartMs, queryEndMs int64, finalizer func()) storage.SeriesSet
Types ¶
type API ¶
type API interface { Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (model.Value, v1.Warnings, error) QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, v1.Warnings, error) LabelNames(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]string, v1.Warnings, error) LabelValues(ctx context.Context, label string, matches []string, startTime time.Time, endTime time.Time) (model.LabelValues, v1.Warnings, error) }
type APIOption ¶
type APIOption func(a *apiOptions)
func WithTripperware ¶
func WithTripperware(tripperware querymiddleware.Tripperware) APIOption
WithTripperware adds a tripperware to the http client's roundtripper. If there are multiple tripperwares, they are applied in order - e.g. NewAPI(cfg Config, WithTripperware(a), WithTripperware(b), WithTripperware(c)) would result in c(b(a(httpClientRoundTripper).
type Client ¶
type Config ¶
type Config struct { Endpoint string `yaml:"endpoint"` Timeout time.Duration `yaml:"timeout"` KeepAlive time.Duration `yaml:"keep_alive"` MaxIdleConns int `yaml:"max_idle_conns"` MaxConns int `yaml:"max_conns"` }
func (*Config) RegisterFlags ¶
RegisterFlags implements flagext.Registerer
type MeasuredAPI ¶
type MeasuredAPI struct {
// contains filtered or unexported fields
}
func (*MeasuredAPI) LabelNames ¶
func (*MeasuredAPI) LabelValues ¶
func (*MeasuredAPI) QueryRange ¶
type Recorder ¶
type Recorder interface {
// contains filtered or unexported methods
}
func NewRecorder ¶
func NewRecorder(namespacePrefix string, reg prometheus.Registerer) Recorder
type StorageQuerierInterface ¶
type StorageQuerierInterface interface { remotereadstorage.Querier }
type StorageQueryableConfig ¶
type StorageQueryableConfig struct { Address string `yaml:"query_address"` Timeout time.Duration `yaml:"query_timeout" category:"advanced"` KeepAlive time.Duration `yaml:"query_keep_alive" category:"advanced"` MaxIdleConns int `yaml:"query_max_idle_conns" category:"advanced"` MaxConns int `yaml:"query_max_conns" category:"advanced"` ClientName string `yaml:"query_client_name" category:"advanced"` }
func (*StorageQueryableConfig) RegisterFlagsWithPrefix ¶
func (c *StorageQueryableConfig) RegisterFlagsWithPrefix(prefix string, flags *flag.FlagSet)
RegisterFlagsWithPrefix registers flags, prepending the provided prefix if needed (no separation is added between the flag and the prefix)
type StorageQueryableInterface ¶
type StorageQueryableInterface interface { remotereadstorage.Queryable }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.