diff --git a/operator/api/loki/v1/lokistack_types.go b/operator/api/loki/v1/lokistack_types.go index e0c55ec5d569..a9ef632d7044 100644 --- a/operator/api/loki/v1/lokistack_types.go +++ b/operator/api/loki/v1/lokistack_types.go @@ -289,6 +289,34 @@ type OpenshiftTenantSpec struct { // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Admin Groups" AdminGroups []string `json:"adminGroups"` + + // OTLP contains settings for ingesting data using OTLP in the OpenShift tenancy mode. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OpenTelemetry Protocol" + OTLP *OpenshiftOTLPConfig `json:"otlp,omitempty"` +} + +// OpenshiftOTLPConfig defines configuration specific to users using OTLP together with an OpenShift tenancy mode. +type OpenshiftOTLPConfig struct { + // DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + // metadata. + // + // Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + // meta information to not be available as stream labels or structured metadata, potentially making queries more + // expensive and less performant. + // + // Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + // added to the configuration, even if this field is set to true. + // + // This option is supposed to be combined with a custom label configuration customizing the labels for the specific + // usecase. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Disable recommended OTLP attributes" + DisableRecommendedAttributes bool `json:"disableRecommendedAttributes,omitempty"` } // LokiComponentSpec defines the requirements to configure scheduling @@ -791,138 +819,70 @@ type IngestionLimitSpec struct { PerStreamRateLimitBurst int32 `json:"perStreamRateLimitBurst,omitempty"` } -// OTLPAttributeAction defines the action to executed when indexing -// OTLP resource attributes. Resource attributes can be either added -// to the index, the chunk structured metadata or entirely dropped. -type OTLPAttributeAction string - -const ( - // OTLPAttributeActionIndexLabel stores a resource attribute as a label, which is part of the index identifying streams. - OTLPAttributeActionIndexLabel OTLPAttributeAction = "indexLabel" - // OTLPAttributeActionStructuredMetadata stores an attribute as structured metadata with each log entry. - OTLPAttributeActionStructuredMetadata OTLPAttributeAction = "structuredMetadata" - // OTLPAttributeActionDrop removes the matching attributes from the log entry. - OTLPAttributeActionDrop OTLPAttributeAction = "drop" -) - -// OTLPAttributesSpec contains the configuration for a set of attributes -// to store them as index labels or structured metadata or drop them altogether. -type OTLPAttributesSpec struct { - // Action defines the indexing action for the selected attributes. They - // can be either added to structured metadata or drop altogether. - // - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=structured_metadata;drop - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Action" - Action OTLPAttributeAction `json:"action"` - - // Attributes allows choosing the attributes by listing their names. +// OTLPSpec defines which resource, scope and log attributes should be used as stream labels or +// stored as structured metadata. +type OTLPSpec struct { + // StreamLabels configures which resource attributes are converted to Loki stream labels. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Attribute Names" - Attributes []string `json:"attributes,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Stream Labels" + StreamLabels *OTLPStreamLabelSpec `json:"streamLabels,omitempty"` - // Regex allows choosing the attributes by matching a regular expression. + // StructuredMetadata configures which attributes are saved in structured metadata. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Regular Expression" - Regex string `json:"regex,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Structured Metadata" + StructuredMetadata *OTLPMetadataSpec `json:"structuredMetadata,omitempty"` } -// OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes -// to store them as index labels or structured metadata or drop them altogether. -type OTLPResourceAttributesConfigSpec struct { - // Action defines the indexing action for the selected resoure attributes. They - // can be either indexed as labels, added to structured metadata or drop altogether. - // - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=index_label;structured_metadata;drop - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Action" - Action OTLPAttributeAction `json:"action"` - - // Attributes is the list of attributes to configure indexing or drop them - // altogether. - // - // +optional - // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Attribute Names" - Attributes []string `json:"attributes,omitempty"` - - // Regex allows choosing the attributes by matching a regular expression. +type OTLPStreamLabelSpec struct { + // ResourceAttributes lists the names of the resource attributes that should be converted into Loki stream labels. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Regular Expression" - Regex string `json:"regex,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Attributes" + ResourceAttributes []OTLPAttributeReference `json:"resourceAttributes,omitempty"` } -// OTLPResourceAttributesSpec contains the configuration for resource attributes -// to store them as index labels or structured metadata or drop them altogether. -type OTLPResourceAttributesSpec struct { - // IgnoreDefaults controls whether to ignore the global configuration for resource attributes - // indexed as labels. - // - // If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. +type OTLPMetadataSpec struct { + // ResourceAttributes lists the names of resource attributes that should be included in structured metadata. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch",displayName="Ignore Global Defaults" - IgnoreDefaults bool `json:"ignoreDefaults,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Attributes" + ResourceAttributes []OTLPAttributeReference `json:"resourceAttributes,omitempty"` - // Attributes contains the configuration for resource attributes - // to store them as index labels or structured metadata or drop them altogether. + // ScopeAttributes lists the names of scope attributes that should be included in structured metadata. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Attributes" - Attributes []OTLPResourceAttributesConfigSpec `json:"attributes,omitempty"` -} + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Scope Attributes" + ScopeAttributes []OTLPAttributeReference `json:"scopeAttributes,omitempty"` -// GlobalOTLPSpec defines which resource, scope and log attributes to -// be stored as index or structured metadata or drop altogether for all -// tenants. -type GlobalOTLPSpec struct { - // IndexedResourceAttributes contains the global configuration for resource attributes - // to store them as index labels. + // LogAttributes lists the names of log attributes that should be included in structured metadata. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Indexed Resource Attributes" - IndexedResourceAttributes []string `json:"indexedResourceAttributes,omitempty"` - - OTLPSpec `json:",omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Log Attributes" + LogAttributes []OTLPAttributeReference `json:"logAttributes,omitempty"` } -// OTLPSpec defines which resource, scope and log attributes to -// be stored as index or structured metadata or drop altogether -type OTLPSpec struct { - // ResourceAttributes contains the configuration for resource attributes - // to store them as index labels or structured metadata or drop them altogether. +type OTLPAttributeReference struct { + // Name contains either a verbatim name of an attribute or a regular expression matching many attributes. // - // +optional - // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Attributes" - ResourceAttributes *OTLPResourceAttributesSpec `json:"resourceAttributes,omitempty"` - - // ScopeAttributes contains the configuration for scope attributes - // to store them as structured metadata or drop them altogether. - // - // +optional - // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Scope Attributes" - ScopeAttributes []OTLPAttributesSpec `json:"scopeAttributes,omitempty"` + // +required + // +kubebuilder:validation:Required + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Name" + Name string `json:"name"` - // LogAttributes contains the configuration for log attributes - // to store them as structured metadata or drop them altogether. + // If Regex is true, then Name is treated as a regular expression instead of as a verbatim attribute name. // // +optional // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Log Attributes" - LogAttributes []OTLPAttributesSpec `json:"logAttributes,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Treat name as regular expression" + Regex bool `json:"regex,omitempty"` } // RetentionStreamSpec defines a log stream with separate retention time. @@ -978,13 +938,14 @@ type LimitsTemplateSpec struct { // +kubebuilder:validation:Optional QueryLimits *QueryLimitSpec `json:"queries,omitempty"` - // OTLP to configure which resource, scope and log attributes - // to store as labels or structured metadata or drop them altogether - // for all tenants. + // OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + // + // Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + // enforce the use of some required attributes. // // +optional // +kubebuilder:validation:Optional - OTLP *GlobalOTLPSpec `json:"otlp,omitempty"` + OTLP *OTLPSpec `json:"otlp,omitempty"` // Retention defines how long logs are kept in storage. // @@ -993,7 +954,7 @@ type LimitsTemplateSpec struct { Retention *RetentionLimitSpec `json:"retention,omitempty"` } -// LimitsTemplateSpec defines the limits applied at ingestion or query path. +// PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path. type PerTenantLimitsTemplateSpec struct { // IngestionLimits defines the limits applied on ingested log streams. // @@ -1007,9 +968,12 @@ type PerTenantLimitsTemplateSpec struct { // +kubebuilder:validation:Optional QueryLimits *PerTenantQueryLimitSpec `json:"queries,omitempty"` - // OTLP to configure which resource, scope and log attributes - // to store as labels or structured metadata or drop them altogether - // for a single tenants. + // OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + // + // Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + // enforce the use of some required attributes. + // + // The per-tenant configuration for OTLP attributes will be merged with the global configuration. // // +optional // +kubebuilder:validation:Optional @@ -1463,16 +1427,3 @@ func (t BlockedQueryTypes) String() string { return strings.Join(res, ",") } - -func (a OTLPAttributeAction) Value() string { - switch a { - case OTLPAttributeActionIndexLabel: - return "index_label" - case OTLPAttributeActionStructuredMetadata: - return "structured_metadata" - case OTLPAttributeActionDrop: - return "drop" - default: - return string(a) - } -} diff --git a/operator/api/loki/v1/v1.go b/operator/api/loki/v1/v1.go index a17e7244dfb5..77ae0fa417ce 100644 --- a/operator/api/loki/v1/v1.go +++ b/operator/api/loki/v1/v1.go @@ -84,12 +84,12 @@ var ( // ErrIPv6InstanceAddrTypeNotAllowed when the default InstanceAddrType is used with enableIPv6. ErrIPv6InstanceAddrTypeNotAllowed = errors.New(`instanceAddrType "default" cannot be used with enableIPv6 at the same time`) - // ErrOTLPResourceAttributesEmptyNotAllowed when the OTLP ResourceAttributes are empty even though ignoreDefaults is enabled. - ErrOTLPResourceAttributesEmptyNotAllowed = errors.New(`resourceAttributes cannot be empty when ignoreDefaults is true`) - // ErrOTLPResourceAttributesIndexLabelActionMissing when OTLP ResourceAttributes does not contain at least one index label when ignoreDefaults is enabled. - ErrOTLPResourceAttributesIndexLabelActionMissing = errors.New(`resourceAttributes does not contain at least one attributed mapped to "index_label"`) - // ErrOTLPAttributesSpecInvalid when the OTLPAttributesSpec attibutes and regex fields are both empty. - ErrOTLPAttributesSpecInvalid = errors.New(`attributes and regex cannot be empty at the same time`) + // ErrOTLPGlobalNoStreamLabel when the global OTLP configuration does not define at least one stream label. + ErrOTLPGlobalNoStreamLabel = errors.New("global OTLP configuration needs to define at least one stream label") + // ErrOTLPTenantMissing when a tenant is missing from the OTLP configuration although it has been defined in the tenancy. + ErrOTLPTenantMissing = errors.New("if no global OTLP configuration is present which defines at least one stream label, every tenant must have an OTLP configuration") + // ErrOTLPTenantNoStreamLabel when a tenant is defined but has no stream labels and there also no global stream labels. + ErrOTLPTenantNoStreamLabel = errors.New("if no global OTLP configuration is present which defines at least one stream label, every tenant must define at least one stream label") // ErrRuleMustMatchNamespace indicates that an expression used in an alerting or recording rule is missing // matchers for a namespace. diff --git a/operator/api/loki/v1/zz_generated.deepcopy.go b/operator/api/loki/v1/zz_generated.deepcopy.go index faab229b2a56..99c8caa49432 100644 --- a/operator/api/loki/v1/zz_generated.deepcopy.go +++ b/operator/api/loki/v1/zz_generated.deepcopy.go @@ -504,27 +504,6 @@ func (in *ClusterProxy) DeepCopy() *ClusterProxy { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalOTLPSpec) DeepCopyInto(out *GlobalOTLPSpec) { - *out = *in - if in.IndexedResourceAttributes != nil { - in, out := &in.IndexedResourceAttributes, &out.IndexedResourceAttributes - *out = make([]string, len(*in)) - copy(*out, *in) - } - in.OTLPSpec.DeepCopyInto(&out.OTLPSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalOTLPSpec. -func (in *GlobalOTLPSpec) DeepCopy() *GlobalOTLPSpec { - if in == nil { - return nil - } - out := new(GlobalOTLPSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HashRingSpec) DeepCopyInto(out *HashRingSpec) { *out = *in @@ -602,7 +581,7 @@ func (in *LimitsTemplateSpec) DeepCopyInto(out *LimitsTemplateSpec) { } if in.OTLP != nil { in, out := &in.OTLP, &out.OTLP - *out = new(GlobalOTLPSpec) + *out = new(OTLPSpec) (*in).DeepCopyInto(*out) } if in.Retention != nil { @@ -1084,97 +1063,91 @@ func (in *OPASpec) DeepCopy() *OPASpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OTLPAttributesSpec) DeepCopyInto(out *OTLPAttributesSpec) { +func (in *OTLPAttributeReference) DeepCopyInto(out *OTLPAttributeReference) { *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]string, len(*in)) - copy(*out, *in) - } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPAttributesSpec. -func (in *OTLPAttributesSpec) DeepCopy() *OTLPAttributesSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPAttributeReference. +func (in *OTLPAttributeReference) DeepCopy() *OTLPAttributeReference { if in == nil { return nil } - out := new(OTLPAttributesSpec) + out := new(OTLPAttributeReference) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OTLPResourceAttributesConfigSpec) DeepCopyInto(out *OTLPResourceAttributesConfigSpec) { +func (in *OTLPMetadataSpec) DeepCopyInto(out *OTLPMetadataSpec) { *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]string, len(*in)) + if in.ResourceAttributes != nil { + in, out := &in.ResourceAttributes, &out.ResourceAttributes + *out = make([]OTLPAttributeReference, len(*in)) + copy(*out, *in) + } + if in.ScopeAttributes != nil { + in, out := &in.ScopeAttributes, &out.ScopeAttributes + *out = make([]OTLPAttributeReference, len(*in)) + copy(*out, *in) + } + if in.LogAttributes != nil { + in, out := &in.LogAttributes, &out.LogAttributes + *out = make([]OTLPAttributeReference, len(*in)) copy(*out, *in) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPResourceAttributesConfigSpec. -func (in *OTLPResourceAttributesConfigSpec) DeepCopy() *OTLPResourceAttributesConfigSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPMetadataSpec. +func (in *OTLPMetadataSpec) DeepCopy() *OTLPMetadataSpec { if in == nil { return nil } - out := new(OTLPResourceAttributesConfigSpec) + out := new(OTLPMetadataSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OTLPResourceAttributesSpec) DeepCopyInto(out *OTLPResourceAttributesSpec) { +func (in *OTLPSpec) DeepCopyInto(out *OTLPSpec) { *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]OTLPResourceAttributesConfigSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.StreamLabels != nil { + in, out := &in.StreamLabels, &out.StreamLabels + *out = new(OTLPStreamLabelSpec) + (*in).DeepCopyInto(*out) + } + if in.StructuredMetadata != nil { + in, out := &in.StructuredMetadata, &out.StructuredMetadata + *out = new(OTLPMetadataSpec) + (*in).DeepCopyInto(*out) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPResourceAttributesSpec. -func (in *OTLPResourceAttributesSpec) DeepCopy() *OTLPResourceAttributesSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPSpec. +func (in *OTLPSpec) DeepCopy() *OTLPSpec { if in == nil { return nil } - out := new(OTLPResourceAttributesSpec) + out := new(OTLPSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OTLPSpec) DeepCopyInto(out *OTLPSpec) { +func (in *OTLPStreamLabelSpec) DeepCopyInto(out *OTLPStreamLabelSpec) { *out = *in if in.ResourceAttributes != nil { in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(OTLPResourceAttributesSpec) - (*in).DeepCopyInto(*out) - } - if in.ScopeAttributes != nil { - in, out := &in.ScopeAttributes, &out.ScopeAttributes - *out = make([]OTLPAttributesSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LogAttributes != nil { - in, out := &in.LogAttributes, &out.LogAttributes - *out = make([]OTLPAttributesSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = make([]OTLPAttributeReference, len(*in)) + copy(*out, *in) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPSpec. -func (in *OTLPSpec) DeepCopy() *OTLPSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPStreamLabelSpec. +func (in *OTLPStreamLabelSpec) DeepCopy() *OTLPStreamLabelSpec { if in == nil { return nil } - out := new(OTLPSpec) + out := new(OTLPStreamLabelSpec) in.DeepCopyInto(out) return out } @@ -1251,6 +1224,21 @@ func (in *ObjectStorageTLSSpec) DeepCopy() *ObjectStorageTLSSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenshiftOTLPConfig) DeepCopyInto(out *OpenshiftOTLPConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenshiftOTLPConfig. +func (in *OpenshiftOTLPConfig) DeepCopy() *OpenshiftOTLPConfig { + if in == nil { + return nil + } + out := new(OpenshiftOTLPConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenshiftTenantSpec) DeepCopyInto(out *OpenshiftTenantSpec) { *out = *in @@ -1259,6 +1247,11 @@ func (in *OpenshiftTenantSpec) DeepCopyInto(out *OpenshiftTenantSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.OTLP != nil { + in, out := &in.OTLP, &out.OTLP + *out = new(OpenshiftOTLPConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenshiftTenantSpec. diff --git a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml index a84820defa35..fce1efd9432a 100644 --- a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.2 - createdAt: "2024-10-21T11:24:52Z" + createdAt: "2024-10-21T14:32:40Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. features.operators.openshift.io/disconnected: "true" @@ -373,76 +373,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -548,71 +534,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -1030,6 +1007,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml index d1c01b5cb082..87b204da9736 100644 --- a/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -165,125 +165,101 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for all tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. properties: - indexedResourceAttributes: - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - items: - type: string - type: array - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource attributes + are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names of + the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names of + resource attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of scope + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -363,7 +339,7 @@ spec: type: object tenants: additionalProperties: - description: LimitsTemplateSpec defines the limits applied + description: PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path. properties: ingestion: @@ -430,118 +406,103 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for a single tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. + + The per-tenant configuration for OTLP attributes will be merged with the global configuration. properties: - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource + attributes are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names + of the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names + of resource attributes that should be included + in structured metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of + scope attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -3903,6 +3864,26 @@ spec: items: type: string type: array + otlp: + description: OTLP contains settings for ingesting data using + OTLP in the OpenShift tenancy mode. + properties: + disableRecommendedAttributes: + description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + type: boolean + type: object type: object required: - mode diff --git a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml index 585bdd34b130..8dc0d34e36f6 100644 --- a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.2 - createdAt: "2024-10-21T11:24:51Z" + createdAt: "2024-10-21T14:32:37Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. operators.operatorframework.io/builder: operator-sdk-unknown @@ -366,76 +366,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -541,71 +527,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -1023,6 +1000,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml index 73e3ff4bde67..8dd8ad938683 100644 --- a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml @@ -166,125 +166,101 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for all tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. properties: - indexedResourceAttributes: - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - items: - type: string - type: array - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource attributes + are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names of + the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names of + resource attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of scope + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -364,7 +340,7 @@ spec: type: object tenants: additionalProperties: - description: LimitsTemplateSpec defines the limits applied + description: PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path. properties: ingestion: @@ -431,118 +407,103 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for a single tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. + + The per-tenant configuration for OTLP attributes will be merged with the global configuration. properties: - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource + attributes are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names + of the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names + of resource attributes that should be included + in structured metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of + scope attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -3904,6 +3865,26 @@ spec: items: type: string type: array + otlp: + description: OTLP contains settings for ingesting data using + OTLP in the OpenShift tenancy mode. + properties: + disableRecommendedAttributes: + description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + type: boolean + type: object type: object required: - mode diff --git a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml index 8cbf60130ce1..9d42513fc749 100644 --- a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: quay.io/openshift-logging/loki-operator:0.1.0 - createdAt: "2024-10-21T11:24:54Z" + createdAt: "2024-10-21T14:32:43Z" description: | The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging. ## Prerequisites and Requirements @@ -386,76 +386,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -561,71 +547,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -1043,6 +1020,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml index 6651f96453e2..828a99481535 100644 --- a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -165,125 +165,101 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for all tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. properties: - indexedResourceAttributes: - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - items: - type: string - type: array - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource attributes + are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names of + the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names of + resource attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of scope + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -363,7 +339,7 @@ spec: type: object tenants: additionalProperties: - description: LimitsTemplateSpec defines the limits applied + description: PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path. properties: ingestion: @@ -430,118 +406,103 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for a single tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. + + The per-tenant configuration for OTLP attributes will be merged with the global configuration. properties: - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource + attributes are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names + of the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names + of resource attributes that should be included + in structured metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of + scope attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -3903,6 +3864,26 @@ spec: items: type: string type: array + otlp: + description: OTLP contains settings for ingesting data using + OTLP in the OpenShift tenancy mode. + properties: + disableRecommendedAttributes: + description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + type: boolean + type: object type: object required: - mode diff --git a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml index 6df041245f15..a4ce94922ffe 100644 --- a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml +++ b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml @@ -147,125 +147,101 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for all tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. properties: - indexedResourceAttributes: - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - items: - type: string - type: array - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource attributes + are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names of + the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names of + resource attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of scope + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead of + as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -345,7 +321,7 @@ spec: type: object tenants: additionalProperties: - description: LimitsTemplateSpec defines the limits applied + description: PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path. properties: ingestion: @@ -412,118 +388,103 @@ spec: type: object otlp: description: |- - OTLP to configure which resource, scope and log attributes - to store as labels or structured metadata or drop them altogether - for a single tenants. + OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. + + Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even + enforce the use of some required attributes. + + The per-tenant configuration for OTLP attributes will be merged with the global configuration. properties: - logAttributes: - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array - resourceAttributes: - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + streamLabels: + description: StreamLabels configures which resource + attributes are converted to Loki stream labels. properties: - attributes: - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + resourceAttributes: + description: ResourceAttributes lists the names + of the resource attributes that should be converted + into Loki stream labels. items: - description: |- - OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes - to store them as index labels or structured metadata or drop them altogether. properties: - action: - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - enum: - - index_label - - structured_metadata - - drop + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string - attributes: - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - items: - type: string - type: array regex: - description: Regex allows choosing the attributes - by matching a regular expression. + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + type: object + structuredMetadata: + description: StructuredMetadata configures which attributes + are saved in structured metadata. + properties: + logAttributes: + description: LogAttributes lists the names of log + attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean required: - - action + - name + type: object + type: array + resourceAttributes: + description: ResourceAttributes lists the names + of resource attributes that should be included + in structured metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name + type: object + type: array + scopeAttributes: + description: ScopeAttributes lists the names of + scope attributes that should be included in structured + metadata. + items: + properties: + name: + description: Name contains either a verbatim + name of an attribute or a regular expression + matching many attributes. + type: string + regex: + description: If Regex is true, then Name is + treated as a regular expression instead + of as a verbatim attribute name. + type: boolean + required: + - name type: object type: array - ignoreDefaults: - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - type: boolean type: object - scopeAttributes: - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. - items: - description: |- - OTLPAttributesSpec contains the configuration for a set of attributes - to store them as index labels or structured metadata or drop them altogether. - properties: - action: - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - enum: - - structured_metadata - - drop - type: string - attributes: - description: Attributes allows choosing the attributes - by listing their names. - items: - type: string - type: array - regex: - description: Regex allows choosing the attributes - by matching a regular expression. - type: string - required: - - action - type: object - type: array type: object queries: description: QueryLimits defines the limit applied on querying @@ -3885,6 +3846,26 @@ spec: items: type: string type: array + otlp: + description: OTLP contains settings for ingesting data using + OTLP in the OpenShift tenancy mode. + properties: + disableRecommendedAttributes: + description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + type: boolean + type: object type: object required: - mode diff --git a/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml index 0e6798f255c2..78710b48121d 100644 --- a/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml @@ -288,76 +288,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -463,71 +449,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -945,6 +922,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml index 616d5e653184..77760c0c6633 100644 --- a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml @@ -281,76 +281,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -456,71 +442,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -938,6 +915,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml index f5d6b5efd659..66bcc30f2b52 100644 --- a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml @@ -300,76 +300,62 @@ spec: path: limits.global.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - IndexedResourceAttributes contains the global configuration for resource attributes - to store them as index labels. - displayName: Indexed Resource Attributes - path: limits.global.otlp.indexedResourceAttributes - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.global.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.global.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.global.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.global.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.global.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.global.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.global.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.global.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.global.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.global.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.global.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.global.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.global.otlp.scopeAttributes[0].regex + path: limits.global.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.global.otlp.structuredMetadata.scopeAttributes[0].regex - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -475,71 +461,62 @@ spec: path: limits.tenants.ingestion.perStreamRateLimitBurst x-descriptors: - urn:alm:descriptor:com.tectonic.ui:number - - description: |- - LogAttributes contains the configuration for log attributes - to store them as structured metadata or drop them altogether. + - description: StreamLabels configures which resource attributes are converted + to Loki stream labels. + displayName: Stream Labels + path: limits.tenants.otlp.streamLabels + - description: ResourceAttributes lists the names of the resource attributes + that should be converted into Loki stream labels. + displayName: Resource Attributes + path: limits.tenants.otlp.streamLabels.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.streamLabels.resourceAttributes[0].regex + - description: StructuredMetadata configures which attributes are saved in structured + metadata. + displayName: Structured Metadata + path: limits.tenants.otlp.structuredMetadata + - description: LogAttributes lists the names of log attributes that should be + included in structured metadata. displayName: Log Attributes - path: limits.tenants.otlp.logAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.logAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.logAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.logAttributes[0].regex - - description: |- - ResourceAttributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.logAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.logAttributes[0].regex + - description: ResourceAttributes lists the names of resource attributes that + should be included in structured metadata. displayName: Resource Attributes - path: limits.tenants.otlp.resourceAttributes - - description: |- - Attributes contains the configuration for resource attributes - to store them as index labels or structured metadata or drop them altogether. - displayName: Attributes - path: limits.tenants.otlp.resourceAttributes.attributes - - description: |- - Action defines the indexing action for the selected resoure attributes. They - can be either indexed as labels, added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.resourceAttributes.attributes[0].action - - description: |- - Attributes is the list of attributes to configure indexing or drop them - altogether. - displayName: Attribute Names - path: limits.tenants.otlp.resourceAttributes.attributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.resourceAttributes.attributes[0].regex - - description: |- - IgnoreDefaults controls whether to ignore the global configuration for resource attributes - indexed as labels. - - - If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. - displayName: Ignore Global Defaults - path: limits.tenants.otlp.resourceAttributes.ignoreDefaults - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - - description: |- - ScopeAttributes contains the configuration for scope attributes - to store them as structured metadata or drop them altogether. + path: limits.tenants.otlp.structuredMetadata.resourceAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.resourceAttributes[0].regex + - description: ScopeAttributes lists the names of scope attributes that should + be included in structured metadata. displayName: Scope Attributes - path: limits.tenants.otlp.scopeAttributes - - description: |- - Action defines the indexing action for the selected attributes. They - can be either added to structured metadata or drop altogether. - displayName: Action - path: limits.tenants.otlp.scopeAttributes[0].action - - description: Attributes allows choosing the attributes by listing their names. - displayName: Attribute Names - path: limits.tenants.otlp.scopeAttributes[0].attributes - - description: Regex allows choosing the attributes by matching a regular expression. - displayName: Regular Expression - path: limits.tenants.otlp.scopeAttributes[0].regex + path: limits.tenants.otlp.structuredMetadata.scopeAttributes + - description: Name contains either a verbatim name of an attribute or a regular + expression matching many attributes. + displayName: Name + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].name + - description: If Regex is true, then Name is treated as a regular expression + instead of as a verbatim attribute name. + displayName: Treat name as regular expression + path: limits.tenants.otlp.structuredMetadata.scopeAttributes[0].regex - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked @@ -957,6 +934,28 @@ spec: - dedicated-admin displayName: Admin Groups path: tenants.openshift.adminGroups + - description: OTLP contains settings for ingesting data using OTLP in the OpenShift + tenancy mode. + displayName: OpenTelemetry Protocol + path: tenants.openshift.otlp + - description: |- + DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured + metadata. + + + Enabling this setting removes the "recommended attributes" from the generated Loki configuration. This will cause + meta information to not be available as stream labels or structured metadata, potentially making queries more + expensive and less performant. + + + Note that there is a set of "required attributes", needed for OpenShift Logging to work properly. Those will be + added to the configuration, even if this field is set to true. + + + This option is supposed to be combined with a custom label configuration customizing the labels for the specific + usecase. + displayName: Disable recommended OTLP attributes + path: tenants.openshift.otlp.disableRecommendedAttributes statusDescriptors: - description: Distributor is a map to the per pod status of the distributor deployment diff --git a/operator/docs/operator/api.md b/operator/docs/operator/api.md index 47e690b3888c..8ea65485112d 100644 --- a/operator/docs/operator/api.md +++ b/operator/docs/operator/api.md @@ -1146,51 +1146,6 @@ a secret. This mode is only supported for certain object storage types in certai -## GlobalOTLPSpec { #loki-grafana-com-v1-GlobalOTLPSpec } -
-(Appears on:LimitsTemplateSpec) -
-GlobalOTLPSpec defines which resource, scope and log attributes to -be stored as index or structured metadata or drop altogether for all -tenants.
-Field | -Description | -
---|---|
-indexedResourceAttributes - -[]string - - |
-
-(Optional)
- IndexedResourceAttributes contains the global configuration for resource attributes -to store them as index labels. - |
-
-OTLPSpec - - -OTLPSpec - - - |
-- | -
(Appears on:LokiStackSpec) @@ -1520,16 +1475,16 @@ QueryLimitSpec
otlp
OTLP to configure which resource, scope and log attributes -to store as labels or structured metadata or drop them altogether -for all tenants.
+OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata.
+Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even +enforce the use of some required attributes.
string
alias)
+## OTLPAttributeReference { #loki-grafana-com-v1-OTLPAttributeReference }
-(Appears on:OTLPAttributesSpec, OTLPResourceAttributesConfigSpec) -
-OTLPAttributeAction defines the action to executed when indexing -OTLP resource attributes. Resource attributes can be either added -to the index, the chunk structured metadata or entirely dropped.
-Value | -Description | -
---|---|
"drop" |
-OTLPAttributeActionDrop removes the matching attributes from the log entry. - |
-
"indexLabel" |
-OTLPAttributeActionIndexLabel stores a resource attribute as a label, which is part of the index identifying streams. - |
-
"structuredMetadata" |
-OTLPAttributeActionStructuredMetadata stores an attribute as structured metadata with each log entry. - |
-
-(Appears on:OTLPSpec) +(Appears on:OTLPMetadataSpec, OTLPStreamLabelSpec)
OTLPAttributesSpec contains the configuration for a set of attributes -to store them as index labels or structured metadata or drop them altogether.
-action - - -OTLPAttributeAction - - - |
-
- Action defines the indexing action for the selected attributes. They -can be either added to structured metadata or drop altogether. - |
-
-attributes + name -[]string +string |
-(Optional)
- Attributes allows choosing the attributes by listing their names. +Name contains either a verbatim name of an attribute or a regular expression matching many attributes. |
regex -string +bool |
(Optional)
- Regex allows choosing the attributes by matching a regular expression. +If Regex is true, then Name is treated as a regular expression instead of as a verbatim attribute name. |
-(Appears on:OTLPResourceAttributesSpec) +(Appears on:OTLPSpec)
OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes -to store them as index labels or structured metadata or drop them altogether.
-action + resourceAttributes - -OTLPAttributeAction + +[]OTLPAttributeReference |
- Action defines the indexing action for the selected resoure attributes. They -can be either indexed as labels, added to structured metadata or drop altogether. +(Optional) +ResourceAttributes lists the names of resource attributes that should be included in structured metadata. |
-attributes + scopeAttributes -[]string + +[]OTLPAttributeReference + |
(Optional)
- Attributes is the list of attributes to configure indexing or drop them -altogether. +ScopeAttributes lists the names of scope attributes that should be included in structured metadata. |
-regex + logAttributes -string + +[]OTLPAttributeReference + |
(Optional)
- Regex allows choosing the attributes by matching a regular expression. +LogAttributes lists the names of log attributes that should be included in structured metadata. |
-(Appears on:OTLPSpec) +(Appears on:LimitsTemplateSpec, PerTenantLimitsTemplateSpec)
OTLPResourceAttributesSpec contains the configuration for resource attributes -to store them as index labels or structured metadata or drop them altogether.
+OTLPSpec defines which resource, scope and log attributes should be used as stream labels or +stored as structured metadata.
-ignoreDefaults + streamLabels -bool + +OTLPStreamLabelSpec + |
(Optional)
- IgnoreDefaults controls whether to ignore the global configuration for resource attributes -indexed as labels. -If IgnoreDefaults is true, then this spec needs to contain at least one mapping to a index label. +StreamLabels configures which resource attributes are converted to Loki stream labels. |
-attributes + structuredMetadata - -[]OTLPResourceAttributesConfigSpec + +OTLPMetadataSpec |
(Optional)
- Attributes contains the configuration for resource attributes -to store them as index labels or structured metadata or drop them altogether. +StructuredMetadata configures which attributes are saved in structured metadata. |
-(Appears on:GlobalOTLPSpec, PerTenantLimitsTemplateSpec) +(Appears on:OTLPSpec)
OTLPSpec defines which resource, scope and log attributes to -be stored as index or structured metadata or drop altogether
resourceAttributes - -OTLPResourceAttributesSpec - - - |
-
-(Optional)
- ResourceAttributes contains the configuration for resource attributes -to store them as index labels or structured metadata or drop them altogether. - |
-
-
-scopeAttributes - - -[]OTLPAttributesSpec - - - |
-
-(Optional)
- ScopeAttributes contains the configuration for scope attributes -to store them as structured metadata or drop them altogether. - |
-
-logAttributes - - -[]OTLPAttributesSpec + +[]OTLPAttributeReference |
(Optional)
- LogAttributes contains the configuration for log attributes -to store them as structured metadata or drop them altogether. +ResourceAttributes lists the names of the resource attributes that should be converted into Loki stream labels. |
+(Appears on:OpenshiftTenantSpec) +
+OpenshiftOTLPConfig defines configuration specific to users using OTLP together with an OpenShift tenancy mode.
+Field | +Description | +
---|---|
+disableRecommendedAttributes + +bool + + |
+
+(Optional)
+ DisableRecommendedAttributes can be used to reduce the number of attributes used for stream labels and structured +metadata. +Enabling this setting removes the “recommended attributes” from the generated Loki configuration. This will cause +meta information to not be available as stream labels or structured metadata, potentially making queries more +expensive and less performant. +Note that there is a set of “required attributes”, needed for OpenShift Logging to work properly. Those will be +added to the configuration, even if this field is set to true. +This option is supposed to be combined with a custom label configuration customizing the labels for the specific +usecase. + |
+
(Appears on:TenantsSpec) @@ -3223,6 +3137,20 @@ Setting this to an empty array disables admin groups.
- dedicated-adminotlp
OTLP contains settings for ingesting data using OTLP in the OpenShift tenancy mode.
+LimitsTemplateSpec defines the limits applied at ingestion or query path.
+PerTenantLimitsTemplateSpec defines the limits applied at ingestion or query path.
(Optional)
- OTLP to configure which resource, scope and log attributes -to store as labels or structured metadata or drop them altogether -for a single tenants. +OTLP to configure which resource, scope and log attributes are stored as stream labels or structured metadata. +Tenancy modes can provide a default OTLP configuration, when no custom OTLP configuration is set or even +enforce the use of some required attributes. +The per-tenant configuration for OTLP attributes will be merged with the global configuration. |