Documentation
¶
Index ¶
- Constants
- Variables
- func NewPromReadHandler(opts options.HandlerOptions) http.Handler
- func NewPromSeriesMatchHandler(opts options.HandlerOptions) http.Handler
- func NewPromWriteHandler(options options.HandlerOptions) (http.Handler, error)
- func NewTagValuesHandler(options options.HandlerOptions) http.Handler
- func ParseExpr(r *http.Request, opts xpromql.ParseOptions) (*prompb.ReadRequest, error)
- func ParseRequest(ctx context.Context, r *http.Request, opts options.HandlerOptions) (*prompb.ReadRequest, *storage.FetchOptions, error)
- func WriteSnappyCompressed(w http.ResponseWriter, readResult ReadResult, logger *zap.Logger) error
- type PromSeriesMatchHandler
- type PromWriteHandler
- type ReadResult
- type TagValuesHandler
- type TagValuesResponse
Constants ¶
const ( // NameReplace is the parameter that gets replaced. NameReplace = "name" // TagValuesURL is the url for tag values. TagValuesURL = handler.RoutePrefixV1 + "/label/{" + NameReplace + "}/values" // TagValuesHTTPMethod is the HTTP method used with this resource. TagValuesHTTPMethod = http.MethodGet )
const ( // PromWriteURL is the url for the prom write handler PromWriteURL = handler.RoutePrefixV1 + "/prom/remote/write" // PromWriteHTTPMethod is the HTTP method used with this resource. PromWriteHTTPMethod = http.MethodPost )
const ( // PromReadURL is the url for remote prom read handler PromReadURL = handler.RoutePrefixV1 + "/prom/remote/read" )
const ( // PromSeriesMatchURL is the url for remote prom series matcher handler. PromSeriesMatchURL = handler.RoutePrefixV1 + "/series" )
Variables ¶
var ( // PromReadHTTPMethods are the HTTP methods used with this resource. PromReadHTTPMethods = []string{http.MethodPost, http.MethodGet} )
var ( // PromSeriesMatchHTTPMethods are the HTTP methods for this handler. PromSeriesMatchHTTPMethods = []string{http.MethodGet, http.MethodPost} )
Functions ¶
func NewPromReadHandler ¶
func NewPromReadHandler(opts options.HandlerOptions) http.Handler
NewPromReadHandler returns a new instance of handler.
func NewPromSeriesMatchHandler ¶ added in v0.5.0
func NewPromSeriesMatchHandler(opts options.HandlerOptions) http.Handler
NewPromSeriesMatchHandler returns a new instance of handler.
func NewPromWriteHandler ¶
func NewPromWriteHandler(options options.HandlerOptions) (http.Handler, error)
NewPromWriteHandler returns a new instance of handler.
func NewTagValuesHandler ¶ added in v0.5.0
func NewTagValuesHandler(options options.HandlerOptions) http.Handler
NewTagValuesHandler returns a new instance of handler.
func ParseExpr ¶ added in v0.15.0
func ParseExpr( r *http.Request, opts xpromql.ParseOptions, ) (*prompb.ReadRequest, error)
ParseExpr parses a prometheus request expression into the constituent fetches, rather than the full query application.
func ParseRequest ¶ added in v0.15.0
func ParseRequest( ctx context.Context, r *http.Request, opts options.HandlerOptions, ) (*prompb.ReadRequest, *storage.FetchOptions, error)
ParseRequest parses the compressed request
func WriteSnappyCompressed ¶ added in v0.15.0
func WriteSnappyCompressed( w http.ResponseWriter, readResult ReadResult, logger *zap.Logger, ) error
WriteSnappyCompressed writes snappy compressed results to the given writer.
Types ¶
type PromSeriesMatchHandler ¶ added in v0.5.0
type PromSeriesMatchHandler struct {
// contains filtered or unexported fields
}
PromSeriesMatchHandler represents a handler for the prometheus series matcher endpoint.
func (*PromSeriesMatchHandler) ServeHTTP ¶ added in v0.5.0
func (h *PromSeriesMatchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PromWriteHandler ¶
type PromWriteHandler struct {
// contains filtered or unexported fields
}
PromWriteHandler represents a handler for prometheus write endpoint.
func (*PromWriteHandler) ServeHTTP ¶
func (h *PromWriteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ReadResult ¶ added in v0.15.0
type ReadResult struct { Meta block.ResultMetadata Result []*prompb.QueryResult }
ReadResult is a read result.
func Read ¶ added in v0.15.0
func Read( ctx context.Context, cancelWatcher handler.CancelWatcher, r *prompb.ReadRequest, fetchOpts *storage.FetchOptions, opts options.HandlerOptions, ) (ReadResult, error)
Read performs a remote read on the given engine.
type TagValuesHandler ¶ added in v0.5.0
type TagValuesHandler struct {
// contains filtered or unexported fields
}
TagValuesHandler represents a handler for search tags endpoint.
func (*TagValuesHandler) ServeHTTP ¶ added in v0.5.0
func (h *TagValuesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TagValuesResponse ¶ added in v0.5.0
type TagValuesResponse struct {
Results consolidators.CompleteTagsResult `json:"results,omitempty"`
}
TagValuesResponse is the response that gets returned to the user