prometheus

package
v0.0.0-...-0d28830 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTLSConfig

func BuildTLSConfig(clientCert, clientKey, serverRootCACert, serverName string, insecureSkipVerify bool) (*tls.Config, error)

Types

type APIClient

type APIClient struct {
	promapi.API
}

func NewAPIClient

func NewAPIClient(cfg Config) (*APIClient, error)

func (*APIClient) ListMetrics

func (c *APIClient) ListMetrics() ([]string, []string, error)

func (*APIClient) QueryMetrics

func (c *APIClient) QueryMetrics(promql string, queryRange promapi.Range) (model.Matrix, error)

type Config

type Config struct {
	TargetHost         string
	ServerRootCACert   string
	ClientCert         string
	ClientKey          string
	ServerName         string
	InsecureSkipVerify bool
}

type HttpClient

type HttpClient struct {
	Endpoint *url.URL
	Client   *http.Client
}

func NewHttpClient

func NewHttpClient(addr string, httpClient *http.Client) (*HttpClient, error)

func (*HttpClient) Do

func (c *HttpClient) Do(ctx context.Context, req *http.Request) (*http.Response, []byte, error)

func (*HttpClient) URL

func (c *HttpClient) URL(ep string, args map[string]string) *url.URL

type Querier

type Querier interface {
	ListMetrics() ([]string, []string, error)
	QueryMetrics(promql string, queryRange promapi.Range) (model.Matrix, error)
}

Jump to

Keyboard shortcuts

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