AnalysisDefinition

Define SLOs for an Analysis

An AnalysisDefinition resource defines the list of Service Level Objectives (SLOs) for an Analysis.

Synopsis

{% include “analysisdefinition.md_1.yaml” %}

Fields

  • apiVersion – API version being used
  • kind – Resource type. Must be set to AnalysisDefinition.
  • metadata
    • name – Unique name of this analysis definition. Names must comply with the Kubernetes Object Names and IDs specification.
    • namespace – Namespace where this resource is located. Analysis resources must specify this namespace when referencing this definition, unless it resides in the same namespace as the Analysis resource.
  • spec
    • objectives This is a list of objectives whose results are combined to determine whether the analysis fails, passes, or passes with a warning.
      • analysisValueTemplateRef (required) – This string marks the beginning of each objective
        • name (required) – The metadata.name value of the AnalysisDefinition resource used for this objective. That resource defines the data provider and the query to use.
        • namespace – Namespace of the analysisValueTemplateRef resource. If the namespace is not specified, the analysis controller looks for the AnalysisValueTemplateRef resource in the same namespace as the Analysis resource.
        • target – defines failure or, optionally, warning criteria. Values not specified for failure or warning result in a pass. Keptn writes the results of the analysis to the status section of the Analysis resource after the analysis runs.
          • failure – criteria for failure, specified as operator: <quantity>. This can be specified either as an absolute value or as a range of values.

            Valid operators for absolute values are:

            • lessThan< operator
            • lessThanOrEqual<= operator
            • greaterThan> operator
            • greaterThanOrEqual>= operator
            • equalTo== operator

            Valid operators for specifying ranges are:

            • inRange – value is inclusively in the defined range

            • notInRange – value is exclusively out of the defined range

              Each of these operators require two arguments:

              • lowBound – minimum value of the range included or excluded
              • highBound – maximum value of the range included or excluded
          • warning – criteria for a warning, specified in the same way as the failure field.
        • weight – used to emphasize the importance of one objective over others
        • keyObjective – If set to true, the entire analysis fails if this objective fails
    • totalScore (required) –
      • passPercentage – threshold to reach for the full analysis (all objectives) to pass
      • warningPercentage – threshold to reach for the full analysis (all objectives) to pass with warning status

Usage

An AnalysisDefinition resource contains a list of objectives to satisfy. Each of these objectives must specify:

  • Failure or warning target criteria
  • Whether the objective is a key objective meaning that its failure fails the Analysis
  • Weight of the objective on the overall Analysis
  • The AnalysisValueTemplate resource that contains the SLIs, defining the data provider from which to gather the data and how to compute the Analysis

Example

{% include “analysisdefinition.md_2.yaml” %}

For an example of how to implement the Keptn Analysis feature, see the Analysis guide page.

Files

API reference: AnalysisDefinition

Differences between versions

A preliminary release of the Keptn Analysis feature is included in Keptn v0.8.3 and v0.9.0 but is hidden behind a feature flag. See the Analysis reference page for instructions to activate the preview of this feature.

See also

Last modified 2023-12-06: with newline (eb985a74)