Skip to content

Commit

Permalink
Merge pull request #691 from VictoriaMetrics/add-UpdateEntriesLimit-f…
Browse files Browse the repository at this point in the history
…or-vmrule

vmrule: support `update_entries_limit`
  • Loading branch information
Amper authored Jul 21, 2023
2 parents 622cf84 + db2dc44 commit 8258ee7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
7 changes: 6 additions & 1 deletion api/v1beta1/vmrule_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v1beta1

import (
"net/url"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/url"
)

// MaxConfigMapDataSize is a maximum `Data` field size of a ConfigMap.
Expand Down Expand Up @@ -100,6 +101,10 @@ type Rule struct {
// Annotations will be added to rule configuration
// +optional
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
// UpdateEntriesLimit defines max number of rule's state updates stored in memory.
// Overrides `-rule.updateEntriesLimit` in vmalert.
// +optional
UpdateEntriesLimit *int `json:"update_entries_limit,omitempty" yaml:"update_entries_limit,omitempty"`
}

// VMRuleStatus defines the observed state of VMRule
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion api/victoriametrics/v1beta1/vmrule_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v1beta1

import (
"net/url"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/url"
)

// MaxConfigMapDataSize is a maximum `Data` field size of a ConfigMap.
Expand Down Expand Up @@ -100,6 +101,10 @@ type Rule struct {
// Annotations will be added to rule configuration
// +optional
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
// UpdateEntriesLimit defines max number of rule's state updates stored in memory.
// Overrides `-rule.updateEntriesLimit` in vmalert.
// +optional
UpdateEntriesLimit *int `json:"update_entries_limit,omitempty" yaml:"update_entries_limit,omitempty"`
}

// VMRuleStatus defines the observed state of VMRule
Expand Down
5 changes: 5 additions & 0 deletions api/victoriametrics/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/operator.victoriametrics.com_vmrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ spec:
description: Record represents a query, that will be recorded
to dataSource
type: string
update_entries_limit:
description: UpdateEntriesLimit defines max number of
rule's state updates stored in memory. Overrides `-rule.updateEntriesLimit`
in vmalert.
type: integer
type: object
type: array
tenant:
Expand Down

0 comments on commit 8258ee7

Please sign in to comment.