Skip to content

RuleBuilder🔗

Constructor🔗

new RuleBuilder(string $title)

Methods🔗

build🔗

Builds the object.

build()

annotations🔗

@param array $annotations

annotations(array $annotations)

condition🔗

condition(string $condition)

execErrState🔗

execErrState(\Grafana\Foundation\Alerting\RuleExecErrState $execErrState)

folderUID🔗

folderUID(string $folderUID)

for🔗

The amount of time, in seconds, for which the rule must be breached for the rule to be considered to be Firing.

Before this time has elapsed, the rule is only considered to be Pending.

for(string $for)

id🔗

id(int $id)

isPaused🔗

isPaused(bool $isPaused)

keepFiringFor🔗

You can set a Keep firing for period to avoid repeated firing-resolving-firing notifications caused by flapping conditions.

Value is in nanoseconds

keepFiringFor(int $keepFiringFor)

labels🔗

@param array $labels

labels(array $labels)

noDataState🔗

noDataState(\Grafana\Foundation\Alerting\RuleNoDataState $noDataState)

notificationSettings🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Alerting\NotificationSettings> $notificationSettings

notificationSettings(\Grafana\Foundation\Cog\Builder $notificationSettings)

orgID🔗

orgID(int $orgID)

provenance🔗

provenance(string $provenance)

queries🔗

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Alerting\Query>> $data

queries(array $data)

record🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Alerting\RecordRule> $record

record(\Grafana\Foundation\Cog\Builder $record)

ruleGroup🔗

ruleGroup(string $ruleGroup)

title🔗

title(string $title)

uid🔗

uid(string $uid)

updated🔗

updated(string $updated)

withQuery🔗

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Alerting\Query> $data

withQuery(\Grafana\Foundation\Cog\Builder $data)

See also🔗