Skip to content

Commit 2bf55a5

Browse files
committed
Add support for configuring the maximum message length (in bytes) after merging partial log lines in the kubernetes_logs source
1 parent 743bc32 commit 2bf55a5

22 files changed

+722
-18
lines changed

api/observability/v1/input_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
package v1
1616

1717
import (
18+
"k8s.io/apimachinery/pkg/api/resource"
1819
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1920
)
2021

@@ -96,6 +97,12 @@ type ContainerInputTuningSpec struct {
9697
// +kubebuilder:validation:Optional
9798
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Per-Container Rate Limit"
9899
RateLimitPerContainer *LimitSpec `json:"rateLimitPerContainer,omitempty"`
100+
101+
// MaxMessageSize The maximum message length in bytes that a single log event can be when all
102+
// partial log lines are merged. Messages exceeding this limit are dropped.
103+
// +kubebuilder:validation:Optional
104+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Max Message Size"
105+
MaxMessageSize *resource.Quantity `json:"maxMessageSize,omitempty"`
99106
}
100107

101108
// ApplicationSource defines the type of ApplicationSource log source to use.
@@ -184,6 +191,16 @@ var (
184191
}
185192
)
186193

194+
// InfrastructureInputTuningSpec is the infrastructure input tuning spec, for now available only for container sources
195+
type InfrastructureInputTuningSpec struct {
196+
197+
// Container is the input tuning spec for container sources
198+
//
199+
// +kubebuilder:validation:Optional
200+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Input Tuning"
201+
Container *ContainerInputTuningSpec `json:"container,omitempty"`
202+
}
203+
187204
// Infrastructure enables infrastructure logs.
188205
// Sources of these logs:
189206
// * container workloads deployed to namespaces: default, kube*, openshift*
@@ -195,6 +212,12 @@ type Infrastructure struct {
195212
// +kubebuilder:validation:Optional
196213
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Log Sources"
197214
Sources []InfrastructureSource `json:"sources,omitempty"`
215+
216+
// Tuning is the infrastructure input tuning spec, for now available only for container sources
217+
//
218+
// +kubebuilder:validation:Optional
219+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Container Input Tuning"
220+
Tuning *InfrastructureInputTuningSpec `json:"tuning,omitempty"`
198221
}
199222

200223
// AuditSource defines which type of audit log source is used.

api/observability/v1/zz_generated.deepcopy.go

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

bundle/manifests/cluster-logging.clusterserviceversion.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ metadata:
8282
categories: OpenShift Optional, Logging & Tracing, Observability
8383
certified: "false"
8484
containerImage: quay.io/openshift-logging/cluster-logging-operator:latest
85-
createdAt: "2025-11-13T11:03:18Z"
85+
createdAt: "2025-12-12T18:19:58Z"
8686
description: The Red Hat OpenShift Logging Operator for OCP provides a means for
8787
configuring and managing log collection and forwarding.
8888
features.operators.openshift.io/cnf: "false"
@@ -333,6 +333,11 @@ spec:
333333
sources
334334
displayName: Input Tuning
335335
path: inputs[0].application.tuning
336+
- description: |-
337+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
338+
partial log lines are merged. Messages exceeding this limit are dropped.
339+
displayName: Max Message Size
340+
path: inputs[0].application.tuning.maxMessageSize
336341
- description: |-
337342
RateLimitPerContainer is the limit applied to each container
338343
by this input. This limit is applied per collector deployment.
@@ -361,6 +366,30 @@ spec:
361366
This field is optional and omission results in the collection of all infrastructure sources.
362367
displayName: Log Sources
363368
path: inputs[0].infrastructure.sources
369+
- description: Tuning is the infrastructure input tuning spec, for now available
370+
only for container sources
371+
displayName: Container Input Tuning
372+
path: inputs[0].infrastructure.tuning
373+
- description: Container is the input tuning spec for container sources
374+
displayName: Input Tuning
375+
path: inputs[0].infrastructure.tuning.container
376+
- description: |-
377+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
378+
partial log lines are merged. Messages exceeding this limit are dropped.
379+
displayName: Max Message Size
380+
path: inputs[0].infrastructure.tuning.container.maxMessageSize
381+
- description: |-
382+
RateLimitPerContainer is the limit applied to each container
383+
by this input. This limit is applied per collector deployment.
384+
displayName: Per-Container Rate Limit
385+
path: inputs[0].infrastructure.tuning.container.rateLimitPerContainer
386+
- description: |-
387+
MaxRecordsPerSecond is the maximum number of log records
388+
allowed per input/output in a pipeline
389+
displayName: Max Records Per Second
390+
path: inputs[0].infrastructure.tuning.container.rateLimitPerContainer.maxRecordsPerSecond
391+
x-descriptors:
392+
- urn:alm:descriptor:com.tectonic.ui:number
364393
- description: Name used to refer to the input of a `pipeline`.
365394
displayName: Input Name
366395
path: inputs[0].name

bundle/manifests/observability.openshift.io_clusterlogforwarders.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,15 @@ spec:
15241524
description: Tuning is the container input tuning spec for
15251525
this container sources
15261526
properties:
1527+
maxMessageSize:
1528+
anyOf:
1529+
- type: integer
1530+
- type: string
1531+
description: |-
1532+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
1533+
partial log lines are merged. Messages exceeding this limit are dropped.
1534+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1535+
x-kubernetes-int-or-string: true
15271536
rateLimitPerContainer:
15281537
description: |-
15291538
RateLimitPerContainer is the limit applied to each container
@@ -1575,6 +1584,41 @@ spec:
15751584
- node
15761585
type: string
15771586
type: array
1587+
tuning:
1588+
description: Tuning is the infrastructure input tuning spec,
1589+
for now available only for container sources
1590+
properties:
1591+
container:
1592+
description: Container is the input tuning spec for
1593+
container sources
1594+
properties:
1595+
maxMessageSize:
1596+
anyOf:
1597+
- type: integer
1598+
- type: string
1599+
description: |-
1600+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
1601+
partial log lines are merged. Messages exceeding this limit are dropped.
1602+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1603+
x-kubernetes-int-or-string: true
1604+
rateLimitPerContainer:
1605+
description: |-
1606+
RateLimitPerContainer is the limit applied to each container
1607+
by this input. This limit is applied per collector deployment.
1608+
properties:
1609+
maxRecordsPerSecond:
1610+
description: |-
1611+
MaxRecordsPerSecond is the maximum number of log records
1612+
allowed per input/output in a pipeline
1613+
exclusiveMinimum: true
1614+
format: int64
1615+
minimum: 0
1616+
type: integer
1617+
required:
1618+
- maxRecordsPerSecond
1619+
type: object
1620+
type: object
1621+
type: object
15781622
type: object
15791623
name:
15801624
description: Name used to refer to the input of a `pipeline`.

config/crd/bases/observability.openshift.io_clusterlogforwarders.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,15 @@ spec:
15241524
description: Tuning is the container input tuning spec for
15251525
this container sources
15261526
properties:
1527+
maxMessageSize:
1528+
anyOf:
1529+
- type: integer
1530+
- type: string
1531+
description: |-
1532+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
1533+
partial log lines are merged. Messages exceeding this limit are dropped.
1534+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1535+
x-kubernetes-int-or-string: true
15271536
rateLimitPerContainer:
15281537
description: |-
15291538
RateLimitPerContainer is the limit applied to each container
@@ -1575,6 +1584,41 @@ spec:
15751584
- node
15761585
type: string
15771586
type: array
1587+
tuning:
1588+
description: Tuning is the infrastructure input tuning spec,
1589+
for now available only for container sources
1590+
properties:
1591+
container:
1592+
description: Container is the input tuning spec for
1593+
container sources
1594+
properties:
1595+
maxMessageSize:
1596+
anyOf:
1597+
- type: integer
1598+
- type: string
1599+
description: |-
1600+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
1601+
partial log lines are merged. Messages exceeding this limit are dropped.
1602+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1603+
x-kubernetes-int-or-string: true
1604+
rateLimitPerContainer:
1605+
description: |-
1606+
RateLimitPerContainer is the limit applied to each container
1607+
by this input. This limit is applied per collector deployment.
1608+
properties:
1609+
maxRecordsPerSecond:
1610+
description: |-
1611+
MaxRecordsPerSecond is the maximum number of log records
1612+
allowed per input/output in a pipeline
1613+
exclusiveMinimum: true
1614+
format: int64
1615+
minimum: 0
1616+
type: integer
1617+
required:
1618+
- maxRecordsPerSecond
1619+
type: object
1620+
type: object
1621+
type: object
15781622
type: object
15791623
name:
15801624
description: Name used to refer to the input of a `pipeline`.

config/manifests/bases/cluster-logging.clusterserviceversion.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ spec:
256256
sources
257257
displayName: Input Tuning
258258
path: inputs[0].application.tuning
259+
- description: |-
260+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
261+
partial log lines are merged. Messages exceeding this limit are dropped.
262+
displayName: Max Message Size
263+
path: inputs[0].application.tuning.maxMessageSize
259264
- description: |-
260265
RateLimitPerContainer is the limit applied to each container
261266
by this input. This limit is applied per collector deployment.
@@ -284,6 +289,30 @@ spec:
284289
This field is optional and omission results in the collection of all infrastructure sources.
285290
displayName: Log Sources
286291
path: inputs[0].infrastructure.sources
292+
- description: Tuning is the infrastructure input tuning spec, for now available
293+
only for container sources
294+
displayName: Container Input Tuning
295+
path: inputs[0].infrastructure.tuning
296+
- description: Container is the input tuning spec for container sources
297+
displayName: Input Tuning
298+
path: inputs[0].infrastructure.tuning.container
299+
- description: |-
300+
MaxMessageSize The maximum message length in bytes that a single log event can be when all
301+
partial log lines are merged. Messages exceeding this limit are dropped.
302+
displayName: Max Message Size
303+
path: inputs[0].infrastructure.tuning.container.maxMessageSize
304+
- description: |-
305+
RateLimitPerContainer is the limit applied to each container
306+
by this input. This limit is applied per collector deployment.
307+
displayName: Per-Container Rate Limit
308+
path: inputs[0].infrastructure.tuning.container.rateLimitPerContainer
309+
- description: |-
310+
MaxRecordsPerSecond is the maximum number of log records
311+
allowed per input/output in a pipeline
312+
displayName: Max Records Per Second
313+
path: inputs[0].infrastructure.tuning.container.rateLimitPerContainer.maxRecordsPerSecond
314+
x-descriptors:
315+
- urn:alm:descriptor:com.tectonic.ui:number
287316
- description: Name used to refer to the input of a `pipeline`.
288317
displayName: Input Name
289318
path: inputs[0].name

docs/reference/operator/api_logging_v1alpha1.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,24 @@ Type:: object
3737
|======================
3838
|Property|Type|Description
3939

40+
|networkPolicy|object| *(optional)* Define the Network Policy for the LogFileMetricExporter
4041
|nodeSelector|object| *(optional)* Define which Nodes the Pods are scheduled on.
4142
|resources|object| *(optional)* The resource requirements for the LogFileMetricExporter
4243
|tolerations|array| *(optional)* Define the tolerations the Pods will accept
4344
|======================
4445

46+
=== .spec.networkPolicy
47+
48+
Type:: object
49+
50+
[options="header"]
51+
|======================
52+
|Property|Type|Description
53+
54+
|ruleSet|string| NetworkPolicyRuleSetType is the type of network policy rule set to use
55+
56+
|======================
57+
4558
=== .spec.nodeSelector
4659

4760
Type:: object

0 commit comments

Comments
 (0)