Skip to content

Commit 238f991

Browse files
vmsingle and vmagent: keep_input and ignore_first_samples for streaming aggregation
1 parent 23d58cf commit 238f991

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,10 @@ spec:
20392039
It is not recommended changing this setting, unless unfinished aggregations states
20402040
are preferred to missing data points.
20412041
type: boolean
2042+
ignore_first_intervals:
2043+
description: IgnoreFirstIntervals instructs to ignore
2044+
first N intervals after start.
2045+
type: integer
20422046
ignore_old_samples:
20432047
description: IgnoreOldSamples instructs to ignore
20442048
samples with old timestamps outside the current
@@ -2126,6 +2130,10 @@ spec:
21262130
interval:
21272131
description: Interval is the interval between aggregations.
21282132
type: string
2133+
keep_input:
2134+
description: KeepInput instructs whether to keep all
2135+
the matched input samples after the aggregation
2136+
type: boolean
21292137
keep_metric_names:
21302138
description: KeepMetricNames instructs to leave metric
21312139
names as is for the output time series without adding

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,10 @@ spec:
825825
It is not recommended changing this setting, unless unfinished aggregations states
826826
are preferred to missing data points.
827827
type: boolean
828+
ignore_first_intervals:
829+
description: IgnoreFirstIntervals instructs to ignore first
830+
N intervals after start.
831+
type: integer
828832
ignore_old_samples:
829833
description: IgnoreOldSamples instructs to ignore samples
830834
with old timestamps outside the current aggregation interval.
@@ -911,6 +915,10 @@ spec:
911915
interval:
912916
description: Interval is the interval between aggregations.
913917
type: string
918+
keep_input:
919+
description: KeepInput instructs whether to keep all the
920+
matched input samples after the aggregation
921+
type: boolean
914922
keep_metric_names:
915923
description: KeepMetricNames instructs to leave metric names
916924
as is for the output time series without adding any suffix.

docs/CHANGELOG.md

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

1717
## Next release
1818

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

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

0 commit comments

Comments
 (0)