Documentation ¶
Index ¶
- Constants
- Variables
- func NewKeptnDynatraceDQLProvider(k8sClient client.Client, opts ...KeptnDynatraceDQLProviderOption) *keptnDynatraceDQLProvider
- type DQLMetric
- type DQLRequest
- type DQLResult
- type DQLSecret
- type DynatraceDQLHandler
- type DynatraceDQLResult
- type DynatraceData
- type DynatraceResponse
- type DynatraceResult
- type Error
- type KeptnDynatraceDQLProviderOption
- type KeptnDynatraceProvider
- func (d *KeptnDynatraceProvider) EvaluateQuery(ctx context.Context, metric metricsapi.KeptnMetric, ...) (string, []byte, error)
- func (d *KeptnDynatraceProvider) EvaluateQueryForStep(ctx context.Context, metric metricsapi.KeptnMetric, ...) ([]string, []byte, error)
- func (d *KeptnDynatraceProvider) FetchAnalysisValue(ctx context.Context, query string, analysis metricsapi.Analysis, ...) (string, error)
Constants ¶
View Source
const (
ErrAPIMsg = "provider api response: %s"
)
Variables ¶
View Source
var ErrDQLQueryTimeout = errors.New("timed out waiting for result of DQL query")
View Source
var ErrInvalidAuthURL = errors.New("the Dynatrace auth URL is not a valid URL")
View Source
var ErrInvalidResult = errors.New("the answer does not contain any data")
View Source
var ErrInvalidToken = errors.New("the Dynatrace token has an invalid format")
View Source
var ErrSecretKeyRefNotDefined = errors.New("the SecretKeyRef property with the Dynatrace token is missing")
Functions ¶
func NewKeptnDynatraceDQLProvider ¶
func NewKeptnDynatraceDQLProvider(k8sClient client.Client, opts ...KeptnDynatraceDQLProviderOption) *keptnDynatraceDQLProvider
NewKeptnDynatraceDQLProvider creates and returns a new KeptnDynatraceDQLProvider
Types ¶
type DQLRequest ¶
type DQLRequest struct { Query string `json:"query"` DefaultTimeframeStart string `json:"defaultTimeframeStart,omitempty"` DefaultTimeframeEnd string `json:"defaultTimeframeEnd,omitempty"` Timezone string `json:"timezone"` Locale string `json:"locale"` FetchTimeoutSeconds int `json:"fetchTimeoutSeconds"` RequestTimeoutMilliseconds int `json:"requestTimeoutMilliseconds"` }
type DynatraceDQLHandler ¶
type DynatraceDQLHandler struct {
RequestToken string `json:"requestToken"`
}
type DynatraceDQLResult ¶
type DynatraceData ¶
type DynatraceResponse ¶
type DynatraceResponse struct { TotalCount int `json:"totalCount"` Resolution string `json:"resolution"` Result []DynatraceResult `json:"result"` Error `json:"error"` }
type DynatraceResult ¶
type DynatraceResult struct { MetricId string `json:"metricId"` Data []DynatraceData `json:"data"` }
type KeptnDynatraceDQLProviderOption ¶
type KeptnDynatraceDQLProviderOption func(provider *keptnDynatraceDQLProvider)
func WithDTAPIClient ¶
func WithDTAPIClient(dtApiClient dtclient.DTAPIClient) KeptnDynatraceDQLProviderOption
func WithLogger ¶
func WithLogger(logger logr.Logger) KeptnDynatraceDQLProviderOption
type KeptnDynatraceProvider ¶
type KeptnDynatraceProvider struct { Log logr.Logger HttpClient http.Client K8sClient client.Client }
func (*KeptnDynatraceProvider) EvaluateQuery ¶
func (d *KeptnDynatraceProvider) EvaluateQuery(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error)
EvaluateQuery fetches the SLI values from dynatrace provider
func (*KeptnDynatraceProvider) EvaluateQueryForStep ¶
func (d *KeptnDynatraceProvider) EvaluateQueryForStep(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) ([]string, []byte, error)
func (*KeptnDynatraceProvider) FetchAnalysisValue ¶
func (d *KeptnDynatraceProvider) FetchAnalysisValue(ctx context.Context, query string, analysis metricsapi.Analysis, provider *metricsapi.KeptnMetricsProvider) (string, error)
Click to show internal directories.
Click to hide internal directories.