Documentation
¶
Overview ¶
Package prometheus provides the Prometheus Backend provider
Index ¶
- Constants
- func MergeablePaths() []string
- func NewClient(name string, o *bo.Options, router http.Handler, cache cache.Cache, ...) (backends.Backend, error)
- type Client
- func (c *Client) AlertsHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) DefaultHealthCheckConfig() *ho.Options
- func (c *Client) DefaultPathConfigs(o *bo.Options) po.List
- func (c *Client) FastForwardRequest(r *http.Request) (*http.Request, error)
- func (c *Client) LabelsHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) MergeablePaths() []string
- func (c *Client) ObjectProxyCacheHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, *timeseries.RequestOptions, bool, error)
- func (c *Client) ProcessTransformations(ts timeseries.Timeseries)
- func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) QueryRangeHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) RegisterHandlers(handlers.Lookup)
- func (c *Client) SeriesHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) SetExtent(r *http.Request, _ *timeseries.TimeRangeQuery, extent *timeseries.Extent)
- func (c *Client) UnsupportedHandler(w http.ResponseWriter, _ *http.Request)
Constants ¶
const (
APIPath = "/api/v1/"
)
Prometheus API
Variables ¶
This section is empty.
Functions ¶
func MergeablePaths ¶
func MergeablePaths() []string
MergeablePaths returns the list of Prometheus Paths for which Trickster supports merging multiple documents into a single response
Types ¶
type Client ¶
type Client struct {
backends.TimeseriesBackend
// contains filtered or unexported fields
}
Client Implements Proxy Client Interface
func (*Client) AlertsHandler ¶
func (c *Client) AlertsHandler(w http.ResponseWriter, r *http.Request)
AlertsHandler proxies requests for path /alerts to the origin by way of the object proxy cache
func (*Client) DefaultHealthCheckConfig ¶
DefaultHealthCheckConfig returns the default HealthCheck Config for this backend provider
func (*Client) DefaultPathConfigs ¶
DefaultPathConfigs returns the default PathConfigs for the given Provider
func (*Client) FastForwardRequest ¶
FastForwardRequest returns an *http.Request crafted to collect Fast Forward data from the Origin, based on the provided HTTP Request
func (*Client) LabelsHandler ¶
func (c *Client) LabelsHandler(w http.ResponseWriter, r *http.Request)
LabelsHandler proxies requests for path /label and /labels to the origin by way of the object proxy cache
func (*Client) MergeablePaths ¶
MergeablePaths returns the list of Prometheus Paths for which Trickster supports merging multiple documents into a single response
func (*Client) ObjectProxyCacheHandler ¶
func (c *Client) ObjectProxyCacheHandler(w http.ResponseWriter, r *http.Request)
ObjectProxyCacheHandler handles calls to /query (for instantaneous values)
func (*Client) ParseTimeRangeQuery ¶
func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, *timeseries.RequestOptions, bool, error, )
ParseTimeRangeQuery parses the key parts of a TimeRangeQuery from the inbound HTTP Request
func (*Client) ProcessTransformations ¶
func (c *Client) ProcessTransformations(ts timeseries.Timeseries)
func (*Client) ProxyHandler ¶
func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)
ProxyHandler sends a request through the basic reverse proxy to the origin, and services non-cacheable Prometheus API calls.
func (*Client) QueryHandler ¶
func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)
QueryHandler handles calls to /query (for instantaneous values)
func (*Client) QueryRangeHandler ¶
func (c *Client) QueryRangeHandler(w http.ResponseWriter, r *http.Request)
QueryRangeHandler handles timeseries requests for Prometheus and processes them through the delta proxy cache
func (*Client) RegisterHandlers ¶
func (*Client) SeriesHandler ¶
func (c *Client) SeriesHandler(w http.ResponseWriter, r *http.Request)
SeriesHandler proxies requests for path /series to the origin by way of the object proxy cache
func (*Client) SetExtent ¶
func (c *Client) SetExtent(r *http.Request, _ *timeseries.TimeRangeQuery, extent *timeseries.Extent, )
SetExtent will change the upstream request query to use the provided Extent
func (*Client) UnsupportedHandler ¶
func (c *Client) UnsupportedHandler(w http.ResponseWriter, _ *http.Request)
UnsupportedHandler responds to endpoints like /api/v1/admin