diff --git a/api/operator/v1beta1/vmextra_types.go b/api/operator/v1beta1/vmextra_types.go index 0896555b7..d01c96dfa 100644 --- a/api/operator/v1beta1/vmextra_types.go +++ b/api/operator/v1beta1/vmextra_types.go @@ -563,6 +563,9 @@ type StreamAggrRule struct { // +optional IgnoreOldSamples *bool `json:"ignore_old_samples,omitempty" yaml:"ignore_old_samples,omitempty"` + // KeepInput instructs whether to keep all the matched input samples after the aggregation + KeepInput *bool `json:"keep_input,omitempty" yaml:"keep_input,omitempty"` + // By is an optional list of labels for grouping input series. // // See also Without. diff --git a/api/operator/v1beta1/zz_generated.deepcopy.go b/api/operator/v1beta1/zz_generated.deepcopy.go index defa86710..ad1ea283f 100644 --- a/api/operator/v1beta1/zz_generated.deepcopy.go +++ b/api/operator/v1beta1/zz_generated.deepcopy.go @@ -2506,6 +2506,11 @@ func (in *StreamAggrRule) DeepCopyInto(out *StreamAggrRule) { *out = new(bool) **out = **in } + if in.KeepInput != nil { + in, out := &in.KeepInput, &out.KeepInput + *out = new(bool) + **out = **in + } if in.By != nil { in, out := &in.By, &out.By *out = make([]string, len(*in)) diff --git a/config/crd/overlay/crd.yaml b/config/crd/overlay/crd.yaml index dcac04762..127d8d863 100644 --- a/config/crd/overlay/crd.yaml +++ b/config/crd/overlay/crd.yaml @@ -3291,6 +3291,10 @@ spec: interval: description: Interval is the interval between aggregations. type: string + keep_input: + description: KeepInput instructs whether to keep all + the matched input samples after the aggregation + type: boolean keep_metric_names: description: KeepMetricNames instructs to leave metric names as is for the output time series without adding @@ -5090,6 +5094,10 @@ spec: interval: description: Interval is the interval between aggregations. type: string + keep_input: + description: KeepInput instructs whether to keep all the + matched input samples after the aggregation + type: boolean keep_metric_names: description: KeepMetricNames instructs to leave metric names as is for the output time series without adding any suffix. @@ -28534,6 +28542,10 @@ spec: interval: description: Interval is the interval between aggregations. type: string + keep_input: + description: KeepInput instructs whether to keep all the + matched input samples after the aggregation + type: boolean keep_metric_names: description: KeepMetricNames instructs to leave metric names as is for the output time series without adding any suffix. diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e1e40b29c..2dd2e951a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -75,6 +75,8 @@ aliases: - [vmscrapeconfig](https://docs.victoriametrics.com/operator/api#vmscrapeconfig) - added `max_scrape_size` parameter for scrape protocols configuration +- [vmagent](./api.md#vmagent) and [vmsingle](./api.md#vmsingle): adds new fields into `streamAggrConfig`: `keep_input`. + ## [v0.45.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.45.0) - 10 Jun 2024 diff --git a/docs/api.md b/docs/api.md index cc24a5e57..de59a9063 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1857,6 +1857,7 @@ _Appears in:_ | `ignore_old_samples` | IgnoreOldSamples instructs to ignore samples with old timestamps outside the current aggregation interval. | _boolean_ | false | | `input_relabel_configs` | InputRelabelConfigs is an optional relabeling rules, which are applied on the input
before aggregation. | _[RelabelConfig](#relabelconfig) array_ | false | | `interval` | Interval is the interval between aggregations. | _string_ | true | +| `keep_input` | KeepInput instructs whether to keep all the matched input samples after the aggregation | _boolean_ | true | | `keep_metric_names` | KeepMetricNames instructs to leave metric names as is for the output time series without adding any suffix. | _boolean_ | false | | `match` | Match is a label selector (or list of label selectors) for filtering time series for the given selector.

If the match isn't set, then all the input time series are processed. | _[StringOrArray](#stringorarray)_ | false | | `no_align_flush_to_interval` | NoAlignFlushToInterval disables aligning of flushes to multiples of Interval.
By default flushes are aligned to Interval. | _boolean_ | false |