providers

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoValuesFound = errors.New("no values found")
)

Functions

This section is empty.

Types

type CloudWatchProvider

type CloudWatchProvider struct {
	// contains filtered or unexported fields
}

func NewCloudWatchProvider

func NewCloudWatchProvider(metricInterval string, provider flaggerv1.MetricTemplateProvider) (*CloudWatchProvider, error)

NewCloudWatchProvider takes a metricInterval, a provider spec and the credentials map, and returns a cloudWatchProvider ready to execute queries against the AWS CloudWatch metrics

func (*CloudWatchProvider) IsOnline

func (p *CloudWatchProvider) IsOnline() (bool, error)

IsOnline calls GetMetricData endpoint with the empty query and returns an error if the returned status code is NOT http.StatusBadRequests. For example, if the flagger does not have permission to perform `cloudwatch:GetMetricData`, the returned status code would be http.StatusForbidden

func (*CloudWatchProvider) RunQuery

func (p *CloudWatchProvider) RunQuery(query string) (float64, error)

RunQuery executes the aws cloud watch metrics query against GetMetricData endpoint and returns the the first result as float64

type DatadogProvider

type DatadogProvider struct {
	// contains filtered or unexported fields
}

DatadogProvider executes datadog queries

func NewDatadogProvider

func NewDatadogProvider(metricInterval string,
	provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte) (*DatadogProvider, error)

NewDatadogProvider takes a canary spec, a provider spec and the credentials map, and returns a Datadog client ready to execute queries against the API

func (*DatadogProvider) IsOnline

func (p *DatadogProvider) IsOnline() (bool, error)

IsOnline calls the Datadog's validation endpoint with api keys and returns an error if the validation fails

func (*DatadogProvider) RunQuery

func (p *DatadogProvider) RunQuery(query string) (float64, error)

RunQuery executes the datadog query against DatadogProvider.metricsQueryEndpoint and returns the the first result as float64

type DynatraceProvider added in v1.14.0

type DynatraceProvider struct {
	// contains filtered or unexported fields
}

DynatraceProvider executes dynatrace queries

func NewDynatraceProvider added in v1.14.0

func NewDynatraceProvider(metricInterval string,
	provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte) (*DynatraceProvider, error)

NewDynatraceProvider takes a canary spec, a provider spec and the credentials map, and returns a Dynatrace client ready to execute queries against the API

func (*DynatraceProvider) IsOnline added in v1.14.0

func (p *DynatraceProvider) IsOnline() (bool, error)

IsOnline calls the Dynatrace's metrics endpoint with token and returns an error if the endpoint fails

func (*DynatraceProvider) RunQuery added in v1.14.0

func (p *DynatraceProvider) RunQuery(query string) (float64, error)

RunQuery executes the dynatrace query against DynatraceProvider.metricsQueryEndpoint and returns the the first result as float64

type Factory

type Factory struct{}

func (Factory) Provider

func (factory Factory) Provider(
	metricInterval string,
	provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte,
) (Interface, error)

type GraphiteProvider added in v1.10.0

type GraphiteProvider struct {
	// contains filtered or unexported fields
}

GraphiteProvider executes Graphite render URL API queries.

func NewGraphiteProvider added in v1.10.0

func NewGraphiteProvider(provider flaggerv1.MetricTemplateProvider, credentials map[string][]byte) (*GraphiteProvider, error)

NewGraphiteProvider takes a provider spec and credentials map, validates the address, extracts the credentials map's username and password values if provided, and returns a Graphite client ready to execute queries against the Graphite render URL API.

func (*GraphiteProvider) IsOnline added in v1.10.0

func (g *GraphiteProvider) IsOnline() (bool, error)

IsOnline runs a simple Graphite render URL API query and returns an error if the API is unreachable.

func (*GraphiteProvider) RunQuery added in v1.10.0

func (g *GraphiteProvider) RunQuery(query string) (float64, error)

RunQuery executes the Graphite render URL API query and returns the the first result as float64.

type InfluxdbProvider added in v1.14.0

type InfluxdbProvider struct {
	// contains filtered or unexported fields
}

func NewInfluxdbProvider added in v1.14.0

func NewInfluxdbProvider(provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte) (*InfluxdbProvider, error)

func (*InfluxdbProvider) IsOnline added in v1.14.0

func (i *InfluxdbProvider) IsOnline() (bool, error)

IsOnline runs a simple query against the default bucket.

func (*InfluxdbProvider) RunQuery added in v1.14.0

func (i *InfluxdbProvider) RunQuery(query string) (float64, error)

type Interface

type Interface interface {
	// RunQuery executes the query and converts the first result to float64
	RunQuery(query string) (float64, error)

	// IsOnline calls the provider endpoint and returns an error if the API is unreachable
	IsOnline() (bool, error)
}

type NewRelicProvider

type NewRelicProvider struct {
	// contains filtered or unexported fields
}

NewRelicProvider executes newrelic queries

func NewNewRelicProvider

func NewNewRelicProvider(
	metricInterval string,
	provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte,
) (*NewRelicProvider, error)

NewNewRelicProvider takes a canary spec, a provider spec and the credentials map, and returns a NewRelic client ready to execute queries against the Insights API

func (*NewRelicProvider) IsOnline

func (p *NewRelicProvider) IsOnline() (bool, error)

IsOnline calls the NewRelic's insights API with and returns an error if the request is rejected

func (*NewRelicProvider) RunQuery

func (p *NewRelicProvider) RunQuery(query string) (float64, error)

RunQuery executes the new relic query against the New Relic Insights API and returns the the first result

type PrometheusProvider

type PrometheusProvider struct {
	// contains filtered or unexported fields
}

PrometheusProvider executes promQL queries

func NewPrometheusProvider

func NewPrometheusProvider(provider flaggerv1.MetricTemplateProvider, credentials map[string][]byte) (*PrometheusProvider, error)

NewPrometheusProvider takes a provider spec and the credentials map, validates the address, extracts the username and password values if provided and returns a Prometheus client ready to execute queries against the API

func (*PrometheusProvider) IsOnline

func (p *PrometheusProvider) IsOnline() (bool, error)

IsOnline run simple Prometheus query and returns an error if the API is unreachable

func (*PrometheusProvider) RunQuery

func (p *PrometheusProvider) RunQuery(query string) (float64, error)

RunQuery executes the promQL query and returns the the first result as float64

type StackDriverProvider added in v1.14.0

type StackDriverProvider struct {
	// contains filtered or unexported fields
}

func NewStackDriverProvider added in v1.14.0

func NewStackDriverProvider(provider flaggerv1.MetricTemplateProvider,
	credentials map[string][]byte,
) (*StackDriverProvider, error)

NewStackDriverProvider takes a provider spec and credential map and returns a StackDriverProvider ready to execute queries against the Cloud Monitoring API

func (*StackDriverProvider) IsOnline added in v1.14.0

func (s *StackDriverProvider) IsOnline() (bool, error)

IsOnline calls QueryTimeSeries method with the empty query and returns an error if the returned status code is NOT grpc.InvalidArgument. For example, if the flagger does not the authorization scope `https://www.googleapis.com/auth/monitoring.read`, the returned status code would be grpc.PermissionDenied

func (*StackDriverProvider) RunQuery added in v1.14.0

func (s *StackDriverProvider) RunQuery(query string) (float64, error)

RunQuery executes Monitoring Query Language(MQL) queries against the Cloud Monitoring API

Jump to

Keyboard shortcuts

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