diff --git a/.gitignore b/.gitignore index 84021b6..11c63ed 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,7 @@ crddir .DS_Store go.work.sum + +# Ignore DevSpace cache and log folder and DevSpace configuration file +.devspace/ +devspace.yaml diff --git a/api/telemetry/v1alpha1/bridge_types.go b/api/telemetry/v1alpha1/bridge_types.go index d98c73c..99603b1 100644 --- a/api/telemetry/v1alpha1/bridge_types.go +++ b/api/telemetry/v1alpha1/bridge_types.go @@ -20,10 +20,18 @@ import ( // BridgeSpec defines the desired state of Bridge type BridgeSpec struct { + // +kubebuilder:validation:Required + + // The source tenant from which telemetry will be forwarded. SourceTenant string `json:"sourceTenant"` + + // +kubebuilder:validation:Required + + // The target tenant to which telemetry will be forwarded. TargetTenant string `json:"targetTenant"` - // The OTTL condition which must be satisfied in order to forward telemetry - // from the source tenant to the target tenant + + // The condition which must be satisfied in order to forward telemetry + // from the source tenant to the target tenant. Condition string `json:"condition"` } diff --git a/api/telemetry/v1alpha1/collector_types.go b/api/telemetry/v1alpha1/collector_types.go index 8a8d4ad..33aef2c 100644 --- a/api/telemetry/v1alpha1/collector_types.go +++ b/api/telemetry/v1alpha1/collector_types.go @@ -49,13 +49,22 @@ type MemoryLimiter struct { // CollectorSpec defines the desired state of Collector type CollectorSpec struct { + // TenantSelector is used to select tenants for which the collector should collect data. TenantSelector metav1.LabelSelector `json:"tenantSelector,omitempty"` - // Namespace where OTel collector DaemonSet is deployed + + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable, please recreate the resource" + + // Namespace where the Otel collector DaemonSet is deployed. ControlNamespace string `json:"controlNamespace"` - // Enables debug logging for the collector + + // Enables debug logging for the collector. Debug bool `json:"debug,omitempty"` - // Setting memory limits for the Collector - MemoryLimiter *MemoryLimiter `json:"memoryLimiter,omitempty"` + + // Setting memory limits for the Collector using the memory limiter processor. + MemoryLimiter *MemoryLimiter `json:"memoryLimiter,omitempty"` + + // DaemonSetOverrides is used to override the default DaemonSet configuration. DaemonSetOverrides *typeoverride.DaemonSet `json:"daemonSet,omitempty"` } diff --git a/api/telemetry/v1alpha1/output_types.go b/api/telemetry/v1alpha1/output_types.go index 483bf81..3457a5c 100644 --- a/api/telemetry/v1alpha1/output_types.go +++ b/api/telemetry/v1alpha1/output_types.go @@ -19,6 +19,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// Batch processor configuration. type Batch struct { // From go.opentelemetry.io/collector/processor/batchprocessor @@ -65,6 +66,7 @@ type OutputSpec struct { Batch *Batch `json:"batch,omitempty"` } +// Output Authentication configuration. type OutputAuth struct { BasicAuth *BasicAuthConfig `json:"basicauth,omitempty"` BearerAuth *BearerAuthConfig `json:"bearerauth,omitempty"` @@ -81,7 +83,8 @@ type BearerAuthConfig struct { TokenField string `json:"tokenField,omitempty"` } -// OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go +// Configuration for the OTLP gRPC exporter. +// ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go type OTLPGRPC struct { QueueConfig *QueueSettings `json:"sending_queue,omitempty"` RetryConfig *BackOffConfig `json:"retry_on_failure,omitempty"` @@ -89,12 +92,14 @@ type OTLPGRPC struct { GRPCClientConfig `json:",inline"` } +// Configuration for the OTLP HTTP exporter. type OTLPHTTP struct { QueueConfig *QueueSettings `json:"sending_queue,omitempty"` RetryConfig *BackOffConfig `json:"retry_on_failure,omitempty"` HTTPClientConfig `json:",inline"` } +// Configuration for the fluentforward exporter. type Fluentforward struct { TCPClientSettings `json:",inline"` diff --git a/api/telemetry/v1alpha1/subscription_types.go b/api/telemetry/v1alpha1/subscription_types.go index c8ebc2c..7a2d114 100644 --- a/api/telemetry/v1alpha1/subscription_types.go +++ b/api/telemetry/v1alpha1/subscription_types.go @@ -20,8 +20,15 @@ import ( // SubscriptionSpec defines the desired state of Subscription type SubscriptionSpec struct { - Condition string `json:"condition"` - Outputs []NamespacedName `json:"outputs,omitempty"` + // +kubebuilder:validation:Required + + // The condition which must be satisfied in order to forward telemetry to the outputs. + Condition string `json:"condition"` + + // +kubebuilder:validation:Required + + // The outputs to which the logs will be routed if the condition evaluates to true. + Outputs []NamespacedName `json:"outputs"` } // SubscriptionStatus defines the observed state of Subscription diff --git a/api/telemetry/v1alpha1/tenant_types.go b/api/telemetry/v1alpha1/tenant_types.go index bb93e75..f84c919 100644 --- a/api/telemetry/v1alpha1/tenant_types.go +++ b/api/telemetry/v1alpha1/tenant_types.go @@ -18,10 +18,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// TransformStatement represents a single statement in a Transform processor +// TransformStatement represents a single statement in a Transform processor. // ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor type TransformStatement struct { // +kubebuilder:validation:Enum:=resource;scope;span;spanevent;metric;datapoint;log + Context string `json:"context,omitempty"` Conditions []string `json:"conditions,omitempty"` Statements []string `json:"statements,omitempty"` @@ -32,8 +33,8 @@ type Transform struct { // Name of the Transform processor Name string `json:"name,omitempty"` - // When FlattenData is true, the processor provides each log record with a distinct copy - // of its resource and scope. Then, after applying all transformations, + // When FlattenData is true, the processor provides each log record with + // a distinct copy of its resource and scope. Then, after applying all transformations, // the log records are regrouped by resource and scope. FlattenData bool `json:"flattenData,omitempty"` @@ -51,6 +52,7 @@ type Transform struct { // RouteConfig defines the routing configuration for a tenant // it will be used to generate routing connectors type RouteConfig struct { + // Contains the list of pipelines to use when a record does not meet any of specified conditions. DefaultPipelines []string `json:"defaultPipelines,omitempty"` // TODO: Provide users with a guide to determine generated pipeline names // +kubebuilder:validation:Enum:=ignore;silent;propagate @@ -58,15 +60,24 @@ type RouteConfig struct { // ErrorMode specifies how errors are handled while processing a statement // vaid options are: ignore, silent, propagate; (default: propagate) ErrorMode string `json:"errorMode,omitempty"` - MatchOnce bool `json:"matchOnce,omitempty"` + + // Determines whether the connector matches multiple statements or not. + // If enabled, the payload will be routed to the first pipeline in the table whose routing condition is met. + // May only be false when used with resource context. + MatchOnce bool `json:"matchOnce,omitempty"` } // TenantSpec defines the desired state of Tenant type TenantSpec struct { + // Determines the namespaces from which subscriptions are collected by this tenant. SubscriptionNamespaceSelectors []metav1.LabelSelector `json:"subscriptionNamespaceSelectors,omitempty"` - LogSourceNamespaceSelectors []metav1.LabelSelector `json:"logSourceNamespaceSelectors,omitempty"` - Transform Transform `json:"transform,omitempty"` - RouteConfig RouteConfig `json:"routeConfig,omitempty"` + + // Determines the namespaces from which logs are collected by this tenant. + // If initialized with an empty list, logs from all namespaces are collected. + // If uninitialized, no logs are collected. + LogSourceNamespaceSelectors []metav1.LabelSelector `json:"logSourceNamespaceSelectors,omitempty"` + Transform `json:"transform,omitempty"` + RouteConfig `json:"routeConfig,omitempty"` } // TenantStatus defines the observed state of Tenant diff --git a/charts/telemetry-controller/Chart.yaml b/charts/telemetry-controller/Chart.yaml index 7344ec8..4decdea 100644 --- a/charts/telemetry-controller/Chart.yaml +++ b/charts/telemetry-controller/Chart.yaml @@ -1,12 +1,16 @@ apiVersion: v2 -name: telemetry-controller -description: A Helm chart for deploying telemetry-controller - type: application - +name: telemetry-controller version: 0.0.0 appVersion: latest - +kubeVersion: ">=1.26.0" +description: A Helm chart for deploying telemetry-controller +keywords: + - opentelemetry-collector + - telemetry-controller + - collector +sources: + - https://github.com/kube-logging/telemetry-controller dependencies: - name: opentelemetry-operator version: 0.74.3 diff --git a/charts/telemetry-controller/charts/opentelemetry-operator-0.71.2.tgz b/charts/telemetry-controller/charts/opentelemetry-operator-0.71.2.tgz deleted file mode 100644 index d81cb26..0000000 Binary files a/charts/telemetry-controller/charts/opentelemetry-operator-0.71.2.tgz and /dev/null differ diff --git a/charts/telemetry-controller/charts/opentelemetry-operator-0.74.3.tgz b/charts/telemetry-controller/charts/opentelemetry-operator-0.74.3.tgz new file mode 100644 index 0000000..390cac3 Binary files /dev/null and b/charts/telemetry-controller/charts/opentelemetry-operator-0.74.3.tgz differ diff --git a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_bridges.yaml b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_bridges.yaml index cd51427..20328e2 100644 --- a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_bridges.yaml +++ b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_bridges.yaml @@ -50,12 +50,14 @@ spec: properties: condition: description: |- - The OTTL condition which must be satisfied in order to forward telemetry - from the source tenant to the target tenant + The condition which must be satisfied in order to forward telemetry + from the source tenant to the target tenant. type: string sourceTenant: + description: The source tenant from which telemetry will be forwarded. type: string targetTenant: + description: The target tenant to which telemetry will be forwarded. type: string required: - condition diff --git a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_collectors.yaml b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_collectors.yaml index 7a554a9..7abefac 100644 --- a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_collectors.yaml +++ b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_collectors.yaml @@ -49,11 +49,14 @@ spec: description: CollectorSpec defines the desired state of Collector properties: controlNamespace: - description: Namespace where OTel collector DaemonSet is deployed + description: Namespace where the Otel collector DaemonSet is deployed. type: string + x-kubernetes-validations: + - message: Value is immutable, please recreate the resource + rule: self == oldSelf daemonSet: - description: DaemonSet is a subset of [DaemonSet in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#daemonset-v1-apps), - with [DaemonSetSpec replaced by the local variant](#daemonset-spec). + description: DaemonSetOverrides is used to override the default DaemonSet + configuration. properties: metadata: description: ObjectMeta contains only a [subset of the fields @@ -8049,10 +8052,11 @@ spec: type: object type: object debug: - description: Enables debug logging for the collector + description: Enables debug logging for the collector. type: boolean memoryLimiter: - description: Setting memory limits for the Collector + description: Setting memory limits for the Collector using the memory + limiter processor. properties: check_interval: description: |- @@ -8093,10 +8097,8 @@ spec: - spike_limit_percentage type: object tenantSelector: - description: |- - A label selector is a label query over a set of resources. The result of matchLabels and - matchExpressions are ANDed. An empty label selector matches all objects. A null - label selector matches no objects. + description: TenantSelector is used to select tenants for which the + collector should collect data. properties: matchExpressions: description: matchExpressions is a list of label selector requirements. diff --git a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_outputs.yaml b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_outputs.yaml index 49d5f65..4b3d4dd 100644 --- a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_outputs.yaml +++ b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_outputs.yaml @@ -42,6 +42,7 @@ spec: description: OutputSpec defines the desired state of Output properties: authentication: + description: Output Authentication configuration. properties: basicauth: properties: @@ -87,6 +88,7 @@ spec: type: object type: object batch: + description: Batch processor configuration. properties: metadata_cardinality_limit: description: |- @@ -132,6 +134,7 @@ spec: type: string type: object fluentforward: + description: Configuration for the fluentforward exporter. properties: compress_gzip: description: CompressGzip enables gzip compression for the payload. @@ -293,7 +296,9 @@ spec: type: object type: object otlp: - description: 'OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go' + description: |- + Configuration for the OTLP gRPC exporter. + ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go properties: auth: description: Auth configuration for outgoing RPCs. @@ -497,6 +502,7 @@ spec: - endpoint type: object otlphttp: + description: Configuration for the OTLP HTTP exporter. properties: auth: description: Auth configuration for outgoing HTTP calls. diff --git a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_subscriptions.yaml b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_subscriptions.yaml index a9a23b0..be8f04e 100644 --- a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_subscriptions.yaml +++ b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_subscriptions.yaml @@ -52,8 +52,12 @@ spec: description: SubscriptionSpec defines the desired state of Subscription properties: condition: + description: The condition which must be satisfied in order to forward + telemetry to the outputs. type: string outputs: + description: The outputs to which the logs will be routed if the condition + evaluates to true. items: properties: name: @@ -67,6 +71,7 @@ spec: type: array required: - condition + - outputs type: object status: description: SubscriptionStatus defines the observed state of Subscription diff --git a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_tenants.yaml b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_tenants.yaml index 1c6b0b8..53a5585 100644 --- a/charts/telemetry-controller/crds/telemetry.kube-logging.dev_tenants.yaml +++ b/charts/telemetry-controller/crds/telemetry.kube-logging.dev_tenants.yaml @@ -55,6 +55,10 @@ spec: description: TenantSpec defines the desired state of Tenant properties: logSourceNamespaceSelectors: + description: |- + Determines the namespaces from which logs are collected by this tenant. + If initialized with an empty list, logs from all namespaces are collected. + If uninitialized, no logs are collected. items: description: |- A label selector is a label query over a set of resources. The result of matchLabels and @@ -111,6 +115,8 @@ spec: it will be used to generate routing connectors properties: defaultPipelines: + description: Contains the list of pipelines to use when a record + does not meet any of specified conditions. items: type: string type: array @@ -124,9 +130,15 @@ spec: - propagate type: string matchOnce: + description: |- + Determines whether the connector matches multiple statements or not. + If enabled, the payload will be routed to the first pipeline in the table whose routing condition is met. + May only be false when used with resource context. type: boolean type: object subscriptionNamespaceSelectors: + description: Determines the namespaces from which subscriptions are + collected by this tenant. items: description: |- A label selector is a label query over a set of resources. The result of matchLabels and @@ -192,14 +204,14 @@ spec: type: string flattenData: description: |- - When FlattenData is true, the processor provides each log record with a distinct copy - of its resource and scope. Then, after applying all transformations, + When FlattenData is true, the processor provides each log record with + a distinct copy of its resource and scope. Then, after applying all transformations, the log records are regrouped by resource and scope. type: boolean logStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: @@ -225,7 +237,7 @@ spec: metricStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: @@ -254,7 +266,7 @@ spec: traceStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: diff --git a/config/crd/bases/telemetry.kube-logging.dev_bridges.yaml b/config/crd/bases/telemetry.kube-logging.dev_bridges.yaml index cd51427..20328e2 100644 --- a/config/crd/bases/telemetry.kube-logging.dev_bridges.yaml +++ b/config/crd/bases/telemetry.kube-logging.dev_bridges.yaml @@ -50,12 +50,14 @@ spec: properties: condition: description: |- - The OTTL condition which must be satisfied in order to forward telemetry - from the source tenant to the target tenant + The condition which must be satisfied in order to forward telemetry + from the source tenant to the target tenant. type: string sourceTenant: + description: The source tenant from which telemetry will be forwarded. type: string targetTenant: + description: The target tenant to which telemetry will be forwarded. type: string required: - condition diff --git a/config/crd/bases/telemetry.kube-logging.dev_collectors.yaml b/config/crd/bases/telemetry.kube-logging.dev_collectors.yaml index 7a554a9..7abefac 100644 --- a/config/crd/bases/telemetry.kube-logging.dev_collectors.yaml +++ b/config/crd/bases/telemetry.kube-logging.dev_collectors.yaml @@ -49,11 +49,14 @@ spec: description: CollectorSpec defines the desired state of Collector properties: controlNamespace: - description: Namespace where OTel collector DaemonSet is deployed + description: Namespace where the Otel collector DaemonSet is deployed. type: string + x-kubernetes-validations: + - message: Value is immutable, please recreate the resource + rule: self == oldSelf daemonSet: - description: DaemonSet is a subset of [DaemonSet in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#daemonset-v1-apps), - with [DaemonSetSpec replaced by the local variant](#daemonset-spec). + description: DaemonSetOverrides is used to override the default DaemonSet + configuration. properties: metadata: description: ObjectMeta contains only a [subset of the fields @@ -8049,10 +8052,11 @@ spec: type: object type: object debug: - description: Enables debug logging for the collector + description: Enables debug logging for the collector. type: boolean memoryLimiter: - description: Setting memory limits for the Collector + description: Setting memory limits for the Collector using the memory + limiter processor. properties: check_interval: description: |- @@ -8093,10 +8097,8 @@ spec: - spike_limit_percentage type: object tenantSelector: - description: |- - A label selector is a label query over a set of resources. The result of matchLabels and - matchExpressions are ANDed. An empty label selector matches all objects. A null - label selector matches no objects. + description: TenantSelector is used to select tenants for which the + collector should collect data. properties: matchExpressions: description: matchExpressions is a list of label selector requirements. diff --git a/config/crd/bases/telemetry.kube-logging.dev_outputs.yaml b/config/crd/bases/telemetry.kube-logging.dev_outputs.yaml index 49d5f65..4b3d4dd 100644 --- a/config/crd/bases/telemetry.kube-logging.dev_outputs.yaml +++ b/config/crd/bases/telemetry.kube-logging.dev_outputs.yaml @@ -42,6 +42,7 @@ spec: description: OutputSpec defines the desired state of Output properties: authentication: + description: Output Authentication configuration. properties: basicauth: properties: @@ -87,6 +88,7 @@ spec: type: object type: object batch: + description: Batch processor configuration. properties: metadata_cardinality_limit: description: |- @@ -132,6 +134,7 @@ spec: type: string type: object fluentforward: + description: Configuration for the fluentforward exporter. properties: compress_gzip: description: CompressGzip enables gzip compression for the payload. @@ -293,7 +296,9 @@ spec: type: object type: object otlp: - description: 'OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go' + description: |- + Configuration for the OTLP gRPC exporter. + ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go properties: auth: description: Auth configuration for outgoing RPCs. @@ -497,6 +502,7 @@ spec: - endpoint type: object otlphttp: + description: Configuration for the OTLP HTTP exporter. properties: auth: description: Auth configuration for outgoing HTTP calls. diff --git a/config/crd/bases/telemetry.kube-logging.dev_subscriptions.yaml b/config/crd/bases/telemetry.kube-logging.dev_subscriptions.yaml index a9a23b0..be8f04e 100644 --- a/config/crd/bases/telemetry.kube-logging.dev_subscriptions.yaml +++ b/config/crd/bases/telemetry.kube-logging.dev_subscriptions.yaml @@ -52,8 +52,12 @@ spec: description: SubscriptionSpec defines the desired state of Subscription properties: condition: + description: The condition which must be satisfied in order to forward + telemetry to the outputs. type: string outputs: + description: The outputs to which the logs will be routed if the condition + evaluates to true. items: properties: name: @@ -67,6 +71,7 @@ spec: type: array required: - condition + - outputs type: object status: description: SubscriptionStatus defines the observed state of Subscription diff --git a/config/crd/bases/telemetry.kube-logging.dev_tenants.yaml b/config/crd/bases/telemetry.kube-logging.dev_tenants.yaml index 1c6b0b8..53a5585 100644 --- a/config/crd/bases/telemetry.kube-logging.dev_tenants.yaml +++ b/config/crd/bases/telemetry.kube-logging.dev_tenants.yaml @@ -55,6 +55,10 @@ spec: description: TenantSpec defines the desired state of Tenant properties: logSourceNamespaceSelectors: + description: |- + Determines the namespaces from which logs are collected by this tenant. + If initialized with an empty list, logs from all namespaces are collected. + If uninitialized, no logs are collected. items: description: |- A label selector is a label query over a set of resources. The result of matchLabels and @@ -111,6 +115,8 @@ spec: it will be used to generate routing connectors properties: defaultPipelines: + description: Contains the list of pipelines to use when a record + does not meet any of specified conditions. items: type: string type: array @@ -124,9 +130,15 @@ spec: - propagate type: string matchOnce: + description: |- + Determines whether the connector matches multiple statements or not. + If enabled, the payload will be routed to the first pipeline in the table whose routing condition is met. + May only be false when used with resource context. type: boolean type: object subscriptionNamespaceSelectors: + description: Determines the namespaces from which subscriptions are + collected by this tenant. items: description: |- A label selector is a label query over a set of resources. The result of matchLabels and @@ -192,14 +204,14 @@ spec: type: string flattenData: description: |- - When FlattenData is true, the processor provides each log record with a distinct copy - of its resource and scope. Then, after applying all transformations, + When FlattenData is true, the processor provides each log record with + a distinct copy of its resource and scope. Then, after applying all transformations, the log records are regrouped by resource and scope. type: boolean logStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: @@ -225,7 +237,7 @@ spec: metricStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: @@ -254,7 +266,7 @@ spec: traceStatements: items: description: |- - TransformStatement represents a single statement in a Transform processor + TransformStatement represents a single statement in a Transform processor. ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor properties: conditions: diff --git a/internal/controller/telemetry/otel_conf_gen/otel_conf_gen.go b/internal/controller/telemetry/otel_conf_gen/otel_conf_gen.go index 8588dfd..7c30657 100644 --- a/internal/controller/telemetry/otel_conf_gen/otel_conf_gen.go +++ b/internal/controller/telemetry/otel_conf_gen/otel_conf_gen.go @@ -133,8 +133,10 @@ func (cfgInput *OtelColConfigInput) generateReceivers() map[string]any { return tenantName == t.Name }); tenantIdx != -1 { namespaces := cfgInput.Tenants[tenantIdx].Status.LogSourceNamespaces - // Generate filelog receiver for the tenant if it has any logsource namespaces - if len(namespaces) > 0 { + + // Generate filelog receiver for the tenant if it has any logsource namespaces. + // Or Handle "all namespaces" case: selectors are initialized but empty + if len(namespaces) > 0 || (cfgInput.Tenants[tenantIdx].Spec.LogSourceNamespaceSelectors != nil && len(namespaces) == 0) { receivers[fmt.Sprintf("filelog/%s", tenantName)] = receiver.GenerateDefaultKubernetesReceiver(namespaces) } } @@ -350,12 +352,6 @@ func validateTenants(tenants *[]v1alpha1.Tenant) error { return errors.New("no tenants provided, at least one tenant must be provided") } - for _, tenant := range *tenants { - if len(tenant.Spec.SubscriptionNamespaceSelectors) == 0 && len(tenant.Spec.LogSourceNamespaceSelectors) == 0 { - result = multierror.Append(result, fmt.Errorf("tenant must have at least one subscription or logsource namespace selector, tenant: %s has neither", tenant.Name)) - } - } - return result.ErrorOrNil() } diff --git a/internal/controller/telemetry/pipeline/components/receiver/filelog_receiver.go b/internal/controller/telemetry/pipeline/components/receiver/filelog_receiver.go index 9c99898..c25a0e0 100644 --- a/internal/controller/telemetry/pipeline/components/receiver/filelog_receiver.go +++ b/internal/controller/telemetry/pipeline/components/receiver/filelog_receiver.go @@ -99,9 +99,13 @@ func GenerateDefaultKubernetesReceiver(namespaces []string) map[string]any { } includeList := make([]string, 0, len(namespaces)) - for _, ns := range namespaces { - include := fmt.Sprintf("/var/log/pods/%s_*/*/*.log", ns) - includeList = append(includeList, include) + if len(namespaces) > 0 { + for _, ns := range namespaces { + include := fmt.Sprintf("/var/log/pods/%s_*/*/*.log", ns) + includeList = append(includeList, include) + } + } else { + includeList = append(includeList, "/var/log/pods/*/*/*.log") } k8sReceiver := map[string]any{