ContinueOps

    continueops

    by: ContinueOps·Resilience & Disaster Recovery

    Published
    Published 3 days ago
    Version
    0.1.0
    Source
    app.terraform.io/continueops/continueops
    Documentation

    continueops_slo (Resource)

    A service level indicator (type = "SLI") or objective (type = "SLO"), optionally attached to a continueops_bco_component. Its conditions must all hold at once; each renders as aggregation(metric, window) operator threshold [by (by)], e.g. p99(latency_ms, 5m) < 250.

    SLIs/SLOs are private to the user who creates them: this resource manages the API key owner's own definitions, in their primary tenant. Destroy deletes the definition.

    Example Usage

    resource "continueops_bco_component" "payments_api" {
      component_name = "Payments API"
      criticality    = "critical"
    }
    
    resource "continueops_slo" "payments_latency" {
      type              = "SLO"
      name              = "Payments API latency"
      component_id      = continueops_bco_component.payments_api.id
      target_percentage = 99.9
      window_days       = 30
      sensitivity       = "high"
    
      # All conditions must hold: p99(request_latency_ms, 5m) < 250 AND count(errors) <= 3
      conditions = [
        { metric = "request_latency_ms", aggregation = "p99", operator = "<", threshold = 250, window = "5m" },
        { metric = "errors", aggregation = "count", operator = "<=", threshold = 3 },
      ]
    }

    Schema

    Required

    • conditions (Attributes List) The conditions, 1 to 50, all of which must hold (AND). A list because the platform shows them in this order. (see below for nested schema)
    • name (String) Name, 1 to 200 characters.
    • type (String) SLI (an indicator) or SLO (an objective with a target_percentage). Can be changed in place.

    Optional

    • component_id (String) Id of the continueops_bco_component this measures. Deleting the component detaches the definition (it is not deleted).
    • description (String) Free-text description, at most 4000 characters.
    • is_active (Boolean) Whether the definition is evaluated. Default true.
    • sensitivity (String) How urgently a breach escalates: critical, high, medium or low. Default medium.
    • target_percentage (Number) For an SLO: the share of time (0-100, at most two decimals, e.g. 99.95) the conditions must hold over window_days.
    • timeouts (Attributes) (see below for nested schema)
    • when_active (String) When a breach may page: always, wake-me-up, business-hours-only or never. Default always.
    • window_days (Number) Rolling evaluation window in days (1-3650), used with target_percentage for the error budget. Default 30.

    Read-Only

    • created_at (String) When the definition was created (RFC 3339, UTC).
    • id (String) Definition id (UUID).
    • updated_at (String) When the definition last changed (RFC 3339, UTC).

    Nested Schema for conditions

    Required:

    • aggregation (String) Aggregation over the window: p50, p95, p99, avg, max, min, sum or count.
    • metric (String) Metric name, e.g. payment_processing_duration_ms. 1 to 200 characters.
    • operator (String) Comparison: <, >, <=, >=, == or !=.
    • threshold (Number) Value the aggregate is compared with.

    Optional:

    • by (String) Group-by dimension, e.g. region.
    • label (String) Human-readable label shown instead of the rendered query.
    • window (String) Evaluation window, a number and a unit s, m, h, d or w (e.g. 5m, 24h, 7d). Required unless aggregation = "count".

    Nested Schema for timeouts

    Optional:

    • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Import is supported using the following syntax:

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    import {
      to = continueops_slo.example
      id = "00000000-0000-4000-8000-000000000000"
    }

    The terraform import command can be used, for example:

    # Import by id (UUID). Only SLIs/SLOs owned by the API key's owner are visible.
    terraform import continueops_slo.example 00000000-0000-4000-8000-000000000000