Skip to content

Commit f3d27d7

Browse files
vmsingle and vmagent: keep_input and ignore_first_samples for streaming aggregation
1 parent e9b2e9c commit f3d27d7

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

api/v1beta1/additional.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,12 @@ type StreamAggrRule struct {
503503
// IgnoreOldSamples instructs to ignore samples with old timestamps outside the current aggregation interval.
504504
IgnoreOldSamples *bool `json:"ignore_old_samples,omitempty" yaml:"ignore_old_samples,omitempty"`
505505

506+
// IgnoreFirstIntervals instructs to ignore first N intervals after start.
507+
IgnoreFirstIntervals *int `json:"ignore_first_intervals,omitempty" yaml:"ignore_first_intervals,omitempty"`
508+
509+
// KeepInput instructs whether to keep all the matched input samples after the aggregation
510+
KeepInput *bool `json:"keep_input,omitempty" yaml:"keep_input,omitempty"`
511+
506512
// By is an optional list of labels for grouping input series.
507513
//
508514
// See also Without.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/victoriametrics/v1beta1/additional.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,12 @@ type StreamAggrRule struct {
503503
// IgnoreOldSamples instructs to ignore samples with old timestamps outside the current aggregation interval.
504504
IgnoreOldSamples *bool `json:"ignore_old_samples,omitempty" yaml:"ignore_old_samples,omitempty"`
505505

506+
// IgnoreFirstIntervals instructs to ignore first N intervals after start.
507+
IgnoreFirstIntervals *int `json:"ignore_first_intervals,omitempty" yaml:"ignore_first_intervals,omitempty"`
508+
509+
// KeepInput instructs whether to keep all the matched input samples after the aggregation
510+
KeepInput *bool `json:"keep_input,omitempty" yaml:"keep_input,omitempty"`
511+
506512
// By is an optional list of labels for grouping input series.
507513
//
508514
// See also Without.

config/crd/bases/operator.victoriametrics.com_vmagents.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,9 @@ spec:
19221922
It is not recommended changing this setting, unless unfinished aggregations states
19231923
are preferred to missing data points.
19241924
type: boolean
1925+
ignore_first_intervals:
1926+
description: IgnoreFirstIntervals instructs to ignore first N intervals after start.
1927+
type: integer
19251928
ignore_old_samples:
19261929
description: IgnoreOldSamples instructs to ignore samples with old timestamps outside the current aggregation interval.
19271930
type: boolean
@@ -2001,6 +2004,9 @@ spec:
20012004
interval:
20022005
description: Interval is the interval between aggregations.
20032006
type: string
2007+
keep_input:
2008+
description: KeepInput instructs whether to keep all the matched input samples after the aggregation
2009+
type: boolean
20042010
keep_metric_names:
20052011
description: KeepMetricNames instructs to leave metric names as is for the output time series without adding any suffix.
20062012
type: boolean

config/crd/bases/operator.victoriametrics.com_vmsingles.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,9 @@ spec:
803803
It is not recommended changing this setting, unless unfinished aggregations states
804804
are preferred to missing data points.
805805
type: boolean
806+
ignore_first_intervals:
807+
description: IgnoreFirstIntervals instructs to ignore first N intervals after start.
808+
type: integer
806809
ignore_old_samples:
807810
description: IgnoreOldSamples instructs to ignore samples with old timestamps outside the current aggregation interval.
808811
type: boolean
@@ -882,6 +885,9 @@ spec:
882885
interval:
883886
description: Interval is the interval between aggregations.
884887
type: string
888+
keep_input:
889+
description: KeepInput instructs whether to keep all the matched input samples after the aggregation
890+
type: boolean
885891
keep_metric_names:
886892
description: KeepMetricNames instructs to leave metric names as is for the output time series without adding any suffix.
887893
type: boolean

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ aliases:
2727

2828
- [vmalertmanagerconfig](./api.md#vmalertmanagerconfig): adds missing `handleReconcileErr` callback to the reconcile loop. It must properly handle errors and deregister objects.
2929

30+
- [vmagent](./api.md#vmagent) and [vmsingle](./api.md#vmsingle): adds new fields into `streamAggrConfig`: `keep_input`, `ignore_first_samples`.
31+
3032
<a name="v0.45.0"></a>
3133

3234
## [v0.45.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.45.0) - 10 Jun 2024

0 commit comments

Comments
 (0)