Dela via


PrometheusRule Class

Definition

An Azure Prometheus alerting or recording rule.

[System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.PrometheusRuleGroups.Models.Api20230301.PrometheusRuleTypeConverter))]
public class PrometheusRule : Microsoft.Azure.PowerShell.Cmdlets.PrometheusRuleGroups.Models.Api20230301.IPrometheusRule
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.PrometheusRuleGroups.Models.Api20230301.PrometheusRuleTypeConverter))>]
type PrometheusRule = class
    interface IPrometheusRule
    interface IJsonSerializable
Public Class PrometheusRule
Implements IPrometheusRule
Inheritance
PrometheusRule
Attributes
Implements

Constructors

PrometheusRule()

Creates an new PrometheusRule instance.

Properties

Action

Actions that are performed when the alert rule becomes active, and when an alert condition is resolved.

Alert

Alert rule name.

Annotation

The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.

Enabled

Enable/disable rule.

Expression

The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.

For

The amount of time alert must be active before firing.

Label

Labels to add or overwrite before storing the result.

Record

Recorded metrics name.

ResolveConfigurationAutoResolved

Enable alert auto-resolution.

ResolveConfigurationTimeToResolve

Alert auto-resolution timeout.

Severity

The severity of the alerts fired by the rule. Must be between 0 and 4.

Methods

DeserializeFromDictionary(IDictionary)

Deserializes a IDictionary into an instance of PrometheusRule.

DeserializeFromPSObject(PSObject)

Deserializes a PSObject into an instance of PrometheusRule.

FromJson(JsonNode)

Deserializes a JsonNode into an instance of Microsoft.Azure.PowerShell.Cmdlets.PrometheusRuleGroups.Models.Api20230301.IPrometheusRule.

FromJsonString(String)

Creates a new instance of PrometheusRule, deserializing the content from a json string.

ToJson(JsonObject, SerializationMode)

Serializes this instance of PrometheusRule into a JsonNode.

ToJsonString()

Serializes this instance to a json string.

ToString()

Applies to