Documentation ¶
Overview ¶
Package prometheus provides bindings to the Prometheus HTTP API: http://prometheus.io/docs/querying/api/
Index ¶
Constants ¶
View Source
const ( // The different API error types. ErrBadData ErrorType = "bad_data" ErrTimeout = "timeout" ErrCanceled = "canceled" ErrExec = "execution" ErrBadResponse = "bad_response" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelableTransport ¶
type CancelableTransport interface { http.RoundTripper CancelRequest(req *http.Request) }
CancelableTransport is like net.Transport but provides per-request cancelation functionality.
type Config ¶
type Config struct { // The address of the Prometheus to connect to. Address string // Transport is used by the Client to drive HTTP requests. If not // provided, DefaultTransport will be used. Transport CancelableTransport }
Config defines configuration parameters for a new client.
type QueryAPI ¶
type QueryAPI interface { // Query performs a query for the given time. Query(ctx context.Context, query string, ts time.Time) (model.Value, error) // Query performs a query for the given range. QueryRange(ctx context.Context, query string, r Range) (model.Value, error) }
QueryAPI provides bindings the Prometheus's query API.
func NewQueryAPI ¶
NewQueryAPI returns a new QueryAPI for the client.
It is safe to use the returned QueryAPI from multiple goroutines.
Click to show internal directories.
Click to hide internal directories.