Documentation ¶
Index ¶
- type BaseMetricsQuery
- type Client
- func (in *Client) API() prom_v1.API
- func (in *Client) Address() string
- func (in *Client) FetchHistogramRange(metricName, labels, grouping string, q *BaseMetricsQuery) Histogram
- func (in *Client) FetchRange(metricName, labels, grouping, aggregator string, q *BaseMetricsQuery) *Metric
- func (in *Client) FetchRateRange(metricName, labels, grouping string, q *BaseMetricsQuery) *Metric
- func (in *Client) GetAllRequestRates(namespace string, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (in *Client) GetAppRequestRates(namespace, app, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
- func (in *Client) GetConfiguration() (prom_v1.ConfigResult, error)
- func (in *Client) GetFlags() (prom_v1.FlagsResult, error)
- func (in *Client) GetInfraMetrics(query *InfraOptionMetricsQuery) InfraMetrics
- func (in *Client) GetMetrics(query *IstioMetricsQuery) Metrics
- func (in *Client) GetNamespaceServicesRequestRates(namespace string, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (in *Client) GetServiceRequestRates(namespace, service, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (in *Client) GetWorkloadRequestRates(namespace, workload, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
- func (in *Client) Inject(api prom_v1.API)
- type ClientInterface
- type Histogram
- type InfraMetrics
- type InfraMetricsQuery
- type InfraOptionMetricsQuery
- type IstioMetricsQuery
- type Metric
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMetricsQuery ¶
type BaseMetricsQuery struct { prom_v1.Range RateInterval string RateFunc string Quantiles []string Avg bool ByLabels []string }
BaseMetricsQuery holds common parameters for all kinds of queries
type Client ¶
type Client struct { ClientInterface // contains filtered or unexported fields }
Client for Prometheus API. It hides the way we query Prometheus offering a layer with a high level defined API.
func NewClient ¶
NewClient creates a new client to the Prometheus API. It returns an error on any problem.
func (*Client) API ¶
API returns the Prometheus V1 HTTP API for performing calls not supported natively by this client
func (*Client) FetchHistogramRange ¶
func (in *Client) FetchHistogramRange(metricName, labels, grouping string, q *BaseMetricsQuery) Histogram
FetchHistogramRange fetches bucketed metric as histogram in given range
func (*Client) FetchRange ¶
func (in *Client) FetchRange(metricName, labels, grouping, aggregator string, q *BaseMetricsQuery) *Metric
FetchRange fetches a simple metric (gauge or counter) in given range
func (*Client) FetchRateRange ¶
func (in *Client) FetchRateRange(metricName, labels, grouping string, q *BaseMetricsQuery) *Metric
FetchRateRange fetches a counter's rate in given range
func (*Client) GetAllRequestRates ¶
func (in *Client) GetAllRequestRates(namespace string, ratesInterval string, queryTime time.Time) (model.Vector, error)
GetAllRequestRates queries Prometheus to fetch request counter rates, over a time interval, for requests into, internal to, or out of the namespace. Returns (rates, error)
func (*Client) GetAppRequestRates ¶
func (in *Client) GetAppRequestRates(namespace, app, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
GetAppRequestRates queries Prometheus to fetch request counters rates over a time interval for a given app, both in and out. Returns (in, out, error)
func (*Client) GetConfiguration ¶
func (in *Client) GetConfiguration() (prom_v1.ConfigResult, error)
func (*Client) GetInfraMetrics ¶
func (in *Client) GetInfraMetrics(query *InfraOptionMetricsQuery) InfraMetrics
aladdin
func (*Client) GetMetrics ¶
func (in *Client) GetMetrics(query *IstioMetricsQuery) Metrics
GetMetrics returns the Metrics related to the provided query options.
func (*Client) GetNamespaceServicesRequestRates ¶
func (in *Client) GetNamespaceServicesRequestRates(namespace string, ratesInterval string, queryTime time.Time) (model.Vector, error)
GetNamespaceServicesRequestRates queries Prometheus to fetch request counter rates, over a time interval, limited to requests for services in the namespace. Returns (rates, error)
func (*Client) GetServiceRequestRates ¶
func (in *Client) GetServiceRequestRates(namespace, service, ratesInterval string, queryTime time.Time) (model.Vector, error)
GetServiceRequestRates queries Prometheus to fetch request counters rates over a time interval for a given service (hence only inbound). Returns (in, error)
func (*Client) GetWorkloadRequestRates ¶
func (in *Client) GetWorkloadRequestRates(namespace, workload, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
GetWorkloadRequestRates queries Prometheus to fetch request counters rates over a time interval for a given workload, both in and out. Returns (in, out, error)
type ClientInterface ¶
type ClientInterface interface { FetchHistogramRange(metricName, labels, grouping string, q *BaseMetricsQuery) Histogram FetchRange(metricName, labels, grouping, aggregator string, q *BaseMetricsQuery) *Metric FetchRateRange(metricName, labels, grouping string, q *BaseMetricsQuery) *Metric GetAllRequestRates(namespace, ratesInterval string, queryTime time.Time) (model.Vector, error) GetAppRequestRates(namespace, app, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error) GetConfiguration() (prom_v1.ConfigResult, error) GetFlags() (prom_v1.FlagsResult, error) GetMetrics(query *IstioMetricsQuery) Metrics // aladdin GetInfraMetrics(query *InfraOptionMetricsQuery) InfraMetrics GetNamespaceServicesRequestRates(namespace, ratesInterval string, queryTime time.Time) (model.Vector, error) GetServiceRequestRates(namespace, service, ratesInterval string, queryTime time.Time) (model.Vector, error) GetWorkloadRequestRates(namespace, workload, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error) }
ClientInterface for mocks (only mocked function are necessary here)
type InfraMetrics ¶
aladdin Metrics contains all simple metrics
type InfraMetricsQuery ¶
type InfraMetricsQuery struct { prom_v1.Range RateInterval string RateFunc string Avg bool ByLabels []string }
aladdin: 인프라 쿼리를 위해(함수정보) InfraMetricsQuery holds common parameters for all kinds of queries
type InfraOptionMetricsQuery ¶
type InfraOptionMetricsQuery struct { InfraMetricsQuery Filters []string Condition string Status string Phase string Mode string Id string ContainerName string PodName string }
aladdin: 인프라 쿼리를 위해(필터링정보) InfraOptionMetricsQuery holds query parameters for a infra metrics query
func (*InfraOptionMetricsQuery) FillDefaults ¶
func (q *InfraOptionMetricsQuery) FillDefaults()
aladdin: InfraOptionMetricsQuery default FillDefaults fills the struct with default parameters
type IstioMetricsQuery ¶
type IstioMetricsQuery struct { BaseMetricsQuery Filters []string Namespace string App string Workload string Service string Direction string // outbound | inbound RequestProtocol string // e.g. http | grpc Reporter string // source | destination, defaults to source if not provided }
IstioMetricsQuery holds query parameters for a typical metrics query
func (*IstioMetricsQuery) FillDefaults ¶
func (q *IstioMetricsQuery) FillDefaults()
FillDefaults fills the struct with default parameters
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package internalmetrics provides functionality to collect Prometheus metrics.
|
Package internalmetrics provides functionality to collect Prometheus metrics. |