Skip to content

ExpressionBuilder🔗

Constructor🔗

func NewExpressionBuilder() *ExpressionBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *ExpressionBuilder) Build() (Expression, error)

DatasourceUID🔗

The UID of the datasource to run this expression against. If omitted, the expression will be run against the __expr__ datasource

func (builder *ExpressionBuilder) DatasourceUID(datasourceUID alertingv0alpha1.DatasourceUID) *ExpressionBuilder

Model🔗

func (builder *ExpressionBuilder) Model(model any) *ExpressionBuilder

QueryType🔗

The type of query if this is a query expression

func (builder *ExpressionBuilder) QueryType(queryType string) *ExpressionBuilder

RelativeTimeRange🔗

func (builder *ExpressionBuilder) RelativeTimeRange(relativeTimeRange cog.Builder[alertingv0alpha1.RelativeTimeRange]) *ExpressionBuilder

Source🔗

Used to mark the expression to be used as the final source for the rule evaluation

Only one expression in a rule can be marked as the source

For AlertRules, this is the expression that will be evaluated against the alerting condition

For RecordingRules, this is the expression that will be recorded

func (builder *ExpressionBuilder) Source(source bool) *ExpressionBuilder

See also🔗