prometheus

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package prometheus provides the Prometheus Backend provider

Index

Constants

View Source
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

func NewClient

func NewClient(name string, o *bo.Options, router http.Handler,
	cache cache.Cache, _ backends.Backends,
	_ types.Lookup,
) (backends.Backend, error)

NewClient returns a new Client Instance

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

func (c *Client) DefaultHealthCheckConfig() *ho.Options

DefaultHealthCheckConfig returns the default HealthCheck Config for this backend provider

func (*Client) DefaultPathConfigs

func (c *Client) DefaultPathConfigs(o *bo.Options) po.List

DefaultPathConfigs returns the default PathConfigs for the given Provider

func (*Client) FastForwardRequest

func (c *Client) FastForwardRequest(r *http.Request) (*http.Request, error)

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

func (c *Client) MergeablePaths() []string

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 (c *Client) RegisterHandlers(handlers.Lookup)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL