Documentation
¶
Index ¶
- Constants
- type APIBasicAuth
- type APILabelPair
- type APIScrapeConfig
- type APIScrapeConfigsCreateRequest
- type APIScrapeConfigsGetResponse
- type APIScrapeConfigsListResponse
- type APIScrapeConfigsUpdateRequest
- type APIScrapeTargetHealth
- type APIStaticConfig
- type APITLSConfig
- type Client
- func (c *Client) ScrapeConfigsCreate(ctx context.Context, req *APIScrapeConfigsCreateRequest) error
- func (c *Client) ScrapeConfigsDelete(ctx context.Context, jobName string) error
- func (c *Client) ScrapeConfigsGet(ctx context.Context, jobName string) (*APIScrapeConfigsGetResponse, error)
- func (c *Client) ScrapeConfigsList(ctx context.Context) (*APIScrapeConfigsListResponse, error)
- func (c *Client) ScrapeConfigsUpdate(ctx context.Context, req *APIScrapeConfigsUpdateRequest) error
- type Error
- type ScrapeTargetHealthHealth
Constants ¶
View Source
const ( ErrCanceled = 1 ErrUnknown = 2 ErrInvalidArgument = 3 ErrDeadlineExceeded = 4 ErrNotFound = 5 ErrAlreadyExists = 6 ErrPermissionDenied = 7 ErrUnauthenticated = 16 ErrResourceExhausted = 8 ErrFailedPrecondition = 9 ErrAborted = 10 ErrOutOfRange = 11 ErrUnimplemented = 12 ErrInternal = 13 ErrDataLoss = 15 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIBasicAuth ¶
type APILabelPair ¶
type APIScrapeConfig ¶
type APIScrapeConfig struct {
// The job name assigned to scraped metrics by default: "example-job" (required)
JobName string `json:"job_name,omitempty"`
// How frequently to scrape targets from this job: "10s"
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Per-scrape timeout when scraping this job: "5s"
ScrapeTimeout string `json:"scrape_timeout,omitempty"`
// The HTTP resource path on which to fetch metrics from targets: "/metrics"
MetricsPath string `json:"metrics_path,omitempty"`
// Configures the protocol scheme used for requests: "http" or "https"
Scheme string `json:"scheme,omitempty"`
// Sets the `Authorization` header on every scrape request with the configured username and password
BasicAuth *APIBasicAuth `json:"basic_auth,omitempty"`
// Configures the scrape request's TLS settings
TLSConfig *APITLSConfig `json:"tls_config,omitempty"`
// List of labeled statically configured targets for this job
StaticConfigs []*APIStaticConfig `json:"static_configs"`
}
type APIScrapeConfigsCreateRequest ¶
type APIScrapeConfigsCreateRequest struct {
// scrape config
ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`
// Check that added targets can be scraped from PMM Server
CheckReachability bool `json:"check_reachability,omitempty"`
}
type APIScrapeConfigsGetResponse ¶ added in v1.7.0
type APIScrapeConfigsGetResponse struct {
// scrape config
ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`
// Scrape targets health for this scrape job
ScrapeTargetsHealth []*APIScrapeTargetHealth `json:"scrape_targets_health"`
}
type APIScrapeConfigsListResponse ¶
type APIScrapeConfigsListResponse struct {
// scrape configs
ScrapeConfigs []*APIScrapeConfig `json:"scrape_configs"`
// Scrape targets health for all managed scrape jobs
ScrapeTargetsHealth []*APIScrapeTargetHealth `json:"scrape_targets_health"`
}
type APIScrapeConfigsUpdateRequest ¶ added in v1.7.0
type APIScrapeConfigsUpdateRequest struct {
// scrape config
ScrapeConfig *APIScrapeConfig `json:"scrape_config,omitempty"`
// Check that added targets can be scraped from PMM Server
CheckReachability bool `json:"check_reachability,omitempty"`
}
type APIScrapeTargetHealth ¶ added in v1.7.0
type APIScrapeTargetHealth struct {
// Original scrape job name
JobName string `json:"job_name,omitempty"`
// "job" label value, may be different from job_name due to relabeling
Job string `json:"job,omitempty"`
// Original target
Target string `json:"target,omitempty"`
// "instance" label value, may be different from target due to relabeling
Instance string `json:"instance,omitempty"`
// health
Health ScrapeTargetHealthHealth `json:"health,omitempty"`
}
type APIStaticConfig ¶
type APIStaticConfig struct {
// Labels assigned to all metrics scraped from the targets
Labels []*APILabelPair `json:"labels"`
// Hostnames or IPs followed by an optional port number: "1.2.3.4:9090"
Targets []string `json:"targets"`
}
type APITLSConfig ¶
type APITLSConfig struct {
// insecure skip verify
InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ScrapeConfigsCreate ¶
func (c *Client) ScrapeConfigsCreate(ctx context.Context, req *APIScrapeConfigsCreateRequest) error
func (*Client) ScrapeConfigsDelete ¶
func (*Client) ScrapeConfigsGet ¶ added in v1.7.0
func (*Client) ScrapeConfigsList ¶
func (c *Client) ScrapeConfigsList(ctx context.Context) (*APIScrapeConfigsListResponse, error)
func (*Client) ScrapeConfigsUpdate ¶ added in v1.7.0
func (c *Client) ScrapeConfigsUpdate(ctx context.Context, req *APIScrapeConfigsUpdateRequest) error
type ScrapeTargetHealthHealth ¶ added in v1.7.0
type ScrapeTargetHealthHealth string
const ( // ScrapeTargetHealthHealthUNKNOWN captures enum value "UNKNOWN" ScrapeTargetHealthHealthUNKNOWN ScrapeTargetHealthHealth = "UNKNOWN" // ScrapeTargetHealthHealthDOWN captures enum value "DOWN" ScrapeTargetHealthHealthDOWN ScrapeTargetHealthHealth = "DOWN" // ScrapeTargetHealthHealthUP captures enum value "UP" ScrapeTargetHealthHealthUP ScrapeTargetHealthHealth = "UP" )
Click to show internal directories.
Click to hide internal directories.