PrometheusRule

Scope: Namespaced
Version: v1

PrometheusRule defines recording and alerting rules for a Prometheus instance

  • apiVersion
    строка

    APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

  • kind
    строка

    Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

  • metadata
    объект
  • spec
    объект

    Обязательный параметр

    Specification of desired alerting rule definitions for Prometheus.

    • spec.groups
      массив объектов

      Content of Prometheus rule file

      RuleGroup is a list of sequentially evaluated recording and alerting rules.

      • spec.groups.interval
        строка

        Interval determines how often rules in the group are evaluated.

        Шаблон: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.groups.limit
        целочисленный

        Limit the number of alerts an alerting rule and series a recording rule can produce. Limit is supported starting with Prometheus >= 2.31 and Thanos Ruler >= 0.24.

      • spec.groups.name
        строка

        Обязательный параметр

        Name of the rule group.

      • spec.groups.partial_response_strategy
        строка

        PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response

        Шаблон: ^(?i)(abort|warn)?$

      • spec.groups.rules
        массив объектов

        List of alerting and recording rules.

        Rule describes an alerting or recording rule See Prometheus documentation: alerting or recording rule

        • spec.groups.rules.alert
          строка

          Name of the alert. Must be a valid label value. Only one of record and alert must be set.

        • spec.groups.rules.annotations
          объект

          Annotations to add to each alert. Only valid for alerting rules.

        • spec.groups.rules.expr
          строка или число

          Обязательный параметр

          PromQL expression to evaluate.

        • spec.groups.rules.for
          строка

          Alerts are considered firing once they have been returned for this long.

          Шаблон: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

        • spec.groups.rules.keep_firing_for
          строка

          KeepFiringFor defines how long an alert will continue firing after the condition that triggered it has cleared.

          Шаблон: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

        • spec.groups.rules.labels
          объект

          Labels to add or overwrite.

        • spec.groups.rules.record
          строка

          Name of the time series to output to. Must be a valid metric name. Only one of record and alert must be set.