Documentation ¶
Index ¶
- type Access
- type Exemplar
- type Option
- func AccessMode(mode Access) Option
- func BasicAuth(username string, password string) Option
- func Default() Option
- func Exemplars(exemplars ...Exemplar) Option
- func ForwardCookies(cookies ...string) Option
- func ForwardOauthIdentity() Option
- func HTTPMethod(method string) Option
- func QueryTimeout(timeout time.Duration) Option
- func ScrapeInterval(interval time.Duration) Option
- func SkipTLSVerify() Option
- func WithCertificate(certificate string) Option
- func WithCredentials() Option
- type Prometheus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exemplar ¶
type Exemplar struct { // The name of the field in the labels object that should be used to get the traceID. LabelName string `json:"name"` // The data source the exemplar is going to navigate to. // Set this value for internal exemplar links. DatasourceUID string `json:"datasourceUid"` // The URL of the trace backend the user would go to see its trace. // Set this value for external exemplar links. URL string `json:"url,omitempty"` }
type Option ¶
type Option func(datasource *Prometheus) error
func AccessMode ¶
AccessMode controls how requests to the data source will be handled. Proxy should be the preferred way if nothing else is stated. Browser will let your browser send the requests (deprecated).
func ForwardCookies ¶
ForwardCookies configures a list of cookies that should be forwarded to the datasource.
func ForwardOauthIdentity ¶
func ForwardOauthIdentity() Option
ForwardOauthIdentity forward the user's upstream OAuth identity to the data source (Their access token gets passed along).
func HTTPMethod ¶
HTTPMethod sets the method used to query Prometheus. POST is the recommended method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network.
func QueryTimeout ¶
QueryTimeout sets the timeout for queries. Defaults to 60s
func ScrapeInterval ¶
ScrapeInterval configures the scrape and evaluation interval. Should be set to the typical value in Prometheus (defaults to 15s).
func SkipTLSVerify ¶
func SkipTLSVerify() Option
SkipTLSVerify disables verification of SSL certificates.
func WithCertificate ¶
WithCertificate sets a self-signed certificate that can be verified against.
func WithCredentials ¶
func WithCredentials() Option
WithCredentials joins credentials such as cookies or auth headers to cross-site requests.
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
func (Prometheus) MarshalJSON ¶
func (datasource Prometheus) MarshalJSON() ([]byte, error)
func (Prometheus) Name ¶
func (datasource Prometheus) Name() string