Documentation ¶
Index ¶
- type HTTP
- func (h *HTTP) FetchContent() ([]byte, error)
- func (h *HTTP) FetchJSON() (map[string]interface{}, error)
- func (h *HTTP) FetchResponse() (*http.Response, error)
- func (h *HTTP) FetchScanner() (*bufio.Scanner, error)
- func (h *HTTP) SetBody(body []byte)
- func (h *HTTP) SetHeader(key, value string)
- func (h *HTTP) SetMethod(method string)
- func (h *HTTP) SetURI(uri string)
- type Prometheus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
func (*HTTP) FetchContent ¶
FetchContent makes an HTTP request to the configured url and returns the body content.
func (*HTTP) FetchJSON ¶
FetchJSON makes an HTTP request to the configured url and returns the JSON content. This only works if the JSON output needed is in map[string]interface format.
func (*HTTP) FetchResponse ¶
FetchResponse fetches a response for the http metricset. It's important that resp.Body has to be closed if this method is used. Before using this method check if one of the other Fetch* methods could be used as they ensure that the Body is properly closed.
func (*HTTP) FetchScanner ¶
FetchScanner returns a Scanner for the content.
type Prometheus ¶
type Prometheus struct {
HTTP
}
Prometheus helper retrieves prometheus formatted metrics
func NewPrometheusClient ¶
func NewPrometheusClient(base mb.BaseMetricSet) *Prometheus
NewPrometheusClient creates new prometheus helper
func (*Prometheus) GetFamilies ¶
func (p *Prometheus) GetFamilies() ([]*dto.MetricFamily, error)
GetFamilies requests metric families from prometheus endpoint and returns them