diff --git a/operator/apis/loki/v1/lokistack_types.go b/operator/apis/loki/v1/lokistack_types.go index 90cee75d9447..41f4ad95e6a8 100644 --- a/operator/apis/loki/v1/lokistack_types.go +++ b/operator/apis/loki/v1/lokistack_types.go @@ -791,6 +791,140 @@ 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. + // + // +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. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Regular Expression" + Regex string `json:"regex,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,omitempty"` + + // 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. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Regular Expression" + Regex string `json:"regex,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. + // + // +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"` + + // Attributes contains the configuration for resource attributes + // to store them as index labels or structured metadata or drop them altogether. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Attributes" + Attributes []OTLPResourceAttributesConfigSpec `json:"attributes,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 or structured metadata or drop them altogether. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Indexed Resource Attributes" + IndexedResourceAttributes []string `json:"indexedResourceAttributes,omitempty"` + + OTLPSpec `json:",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. + // + // +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 index labels or structured metadata or drop them altogether. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Scope Attributes" + ScopeAttributes []OTLPAttributesSpec `json:"scopeAttributes,omitempty"` + + // LogAttributes contains the configuration for log attributes + // to store them as index labels or structured metadata or drop them altogether. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Log Attributes" + LogAttributes []OTLPAttributesSpec `json:"logAttributes,omitempty"` +} + // RetentionStreamSpec defines a log stream with separate retention time. type RetentionStreamSpec struct { // Days contains the number of days logs are kept. @@ -844,6 +978,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. + // + // +optional + // +kubebuilder:validation:Optional + OTLP *GlobalOTLPSpec `json:"otlp,omitempty"` + // Retention defines how long logs are kept in storage. // // +optional @@ -865,6 +1007,14 @@ 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. + // + // +optional + // +kubebuilder:validation:Optional + OTLP *OTLPSpec `json:"otlp,omitempty"` + // Retention defines how long logs are kept in storage. // // +optional @@ -1313,3 +1463,16 @@ 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/apis/loki/v1/v1.go b/operator/apis/loki/v1/v1.go index 8e86ea4b2498..a17e7244dfb5 100644 --- a/operator/apis/loki/v1/v1.go +++ b/operator/apis/loki/v1/v1.go @@ -84,6 +84,13 @@ 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`) + // ErrRuleMustMatchNamespace indicates that an expression used in an alerting or recording rule is missing // matchers for a namespace. ErrRuleMustMatchNamespace = errors.New("rule needs to have a matcher for the namespace") diff --git a/operator/apis/loki/v1/zz_generated.deepcopy.go b/operator/apis/loki/v1/zz_generated.deepcopy.go index c7206c5ab660..faab229b2a56 100644 --- a/operator/apis/loki/v1/zz_generated.deepcopy.go +++ b/operator/apis/loki/v1/zz_generated.deepcopy.go @@ -504,6 +504,27 @@ 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 @@ -579,6 +600,11 @@ func (in *LimitsTemplateSpec) DeepCopyInto(out *LimitsTemplateSpec) { *out = new(QueryLimitSpec) **out = **in } + if in.OTLP != nil { + in, out := &in.OTLP, &out.OTLP + *out = new(GlobalOTLPSpec) + (*in).DeepCopyInto(*out) + } if in.Retention != nil { in, out := &in.Retention, &out.Retention *out = new(RetentionLimitSpec) @@ -1057,6 +1083,102 @@ func (in *OPASpec) DeepCopy() *OPASpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OTLPAttributesSpec) DeepCopyInto(out *OTLPAttributesSpec) { + *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 { + if in == nil { + return nil + } + out := new(OTLPAttributesSpec) + 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) { + *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 OTLPResourceAttributesConfigSpec. +func (in *OTLPResourceAttributesConfigSpec) DeepCopy() *OTLPResourceAttributesConfigSpec { + if in == nil { + return nil + } + out := new(OTLPResourceAttributesConfigSpec) + 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) { + *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]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPResourceAttributesSpec. +func (in *OTLPResourceAttributesSpec) DeepCopy() *OTLPResourceAttributesSpec { + if in == nil { + return nil + } + out := new(OTLPResourceAttributesSpec) + 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) { + *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]) + } + } +} + +// 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(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 *ObjectStorageSchema) DeepCopyInto(out *ObjectStorageSchema) { *out = *in @@ -1162,6 +1284,11 @@ func (in *PerTenantLimitsTemplateSpec) DeepCopyInto(out *PerTenantLimitsTemplate *out = new(PerTenantQueryLimitSpec) (*in).DeepCopyInto(*out) } + if in.OTLP != nil { + in, out := &in.OTLP, &out.OTLP + *out = new(OTLPSpec) + (*in).DeepCopyInto(*out) + } if in.Retention != nil { in, out := &in.Retention, &out.Retention *out = new(RetentionLimitSpec) diff --git a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml index 89db0644458c..9df0d3707f9b 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.1 - createdAt: "2024-09-04T13:09:06Z" + createdAt: "2024-09-06T17:56:05Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. features.operators.openshift.io/disconnected: "true" @@ -361,6 +361,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -457,6 +517,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked 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 7cfeec6d074f..e58e23492e5a 100644 --- a/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community-openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -164,6 +164,127 @@ spec: format: int32 type: integer 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. + properties: + indexedResourceAttributes: + description: |- + IndexedResourceAttributes contains the global configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + items: + type: string + type: array + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. @@ -307,6 +428,120 @@ spec: format: int32 type: integer 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. + properties: + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. diff --git a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml index c431273519e6..305ab8785d31 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.1 - createdAt: "2024-09-04T13:09:04Z" + createdAt: "2024-09-06T17:56:04Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. operators.operatorframework.io/builder: operator-sdk-unknown @@ -354,6 +354,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -450,6 +510,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked diff --git a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml index 234ec782eb1b..e4f08108b696 100644 --- a/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/community/manifests/loki.grafana.com_lokistacks.yaml @@ -164,6 +164,127 @@ spec: format: int32 type: integer 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. + properties: + indexedResourceAttributes: + description: |- + IndexedResourceAttributes contains the global configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + items: + type: string + type: array + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. @@ -307,6 +428,120 @@ spec: format: int32 type: integer 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. + properties: + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. diff --git a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml index f943d3921ff3..62548fa8217d 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-09-04T13:09:07Z" + createdAt: "2024-09-06T17:56:07Z" description: | The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging. ## Prerequisites and Requirements @@ -374,6 +374,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -470,6 +530,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked diff --git a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml index 4ab2f8aaba2a..2084694a6db8 100644 --- a/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml +++ b/operator/bundle/openshift/manifests/loki.grafana.com_lokistacks.yaml @@ -164,6 +164,127 @@ spec: format: int32 type: integer 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. + properties: + indexedResourceAttributes: + description: |- + IndexedResourceAttributes contains the global configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + items: + type: string + type: array + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. @@ -307,6 +428,120 @@ spec: format: int32 type: integer 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. + properties: + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. diff --git a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml index 2429338bd3a6..0180fe98e7ae 100644 --- a/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml +++ b/operator/config/crd/bases/loki.grafana.com_lokistacks.yaml @@ -146,6 +146,127 @@ spec: format: int32 type: integer 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. + properties: + indexedResourceAttributes: + description: |- + IndexedResourceAttributes contains the global configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + items: + type: string + type: array + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. @@ -289,6 +410,120 @@ spec: format: int32 type: integer 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. + properties: + logAttributes: + description: |- + LogAttributes contains the configuration for log attributes + to store them as index labels or 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. + properties: + attributes: + description: |- + Attributes contains the configuration for resource attributes + to store them as index labels or structured metadata or drop them altogether. + 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 + 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. + type: string + 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 index labels or 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 log streams. 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 b655b250aea3..35946e8e05d9 100644 --- a/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml @@ -274,6 +274,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -370,6 +430,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked diff --git a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml index 7d12fc8ddaad..8e42ee8f4770 100644 --- a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml @@ -267,6 +267,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -363,6 +423,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked diff --git a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml index d55686c3addc..3d25c9f4c244 100644 --- a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml @@ -286,6 +286,66 @@ 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 or structured metadata + or drop them altogether. + displayName: Indexed Resource Attributes + path: limits.global.otlp.indexedResourceAttributes + - description: LogAttributes contains the configuration for log attributes to + store them as index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: CardinalityLimit defines the cardinality limit for index queries. displayName: Cardinality Limit path: limits.global.queries.cardinalityLimit @@ -382,6 +442,61 @@ 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 index labels or structured metadata or drop them altogether. + 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. + 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. \n 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 index labels or structured metadata or drop them altogether. + 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 - description: Blocked defines the list of rules to block matching queries. displayName: Blocked path: limits.tenants.queries.blocked diff --git a/operator/docs/operator/api.md b/operator/docs/operator/api.md index 3e2cb6a850ac..ee4ee5c5a62b 100644 --- a/operator/docs/operator/api.md +++ b/operator/docs/operator/api.md @@ -1146,6 +1146,51 @@ 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 or structured metadata or drop them altogether. + |
+
+OTLPSpec + + +OTLPSpec + + + |
++ | +
(Appears on:LokiStackSpec) @@ -1473,6 +1518,22 @@ 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.
+retention
string
alias)
++(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) +
+OTLPAttributesSpec contains the configuration for a set of attributes +to store them as index labels or structured metadata or drop them altogether.
+Field | +Description | +
---|---|
+action + + +OTLPAttributeAction + + + |
+
+ Action defines the indexing action for the selected attributes. They +can be either added to structured metadata or drop altogether. + |
+
+attributes + +[]string + + |
+
+(Optional)
+ Attributes allows choosing the attributes by listing their names. + |
+
+regex + +string + + |
+
+(Optional)
+ Regex allows choosing the attributes by matching a regular expression. + |
+
+(Appears on:OTLPResourceAttributesSpec) +
+OTLPResourceAttributesConfigSpec contains the configuration for a set of resource attributes +to store them as index labels or structured metadata or drop them altogether.
+Field | +Description | +
---|---|
+action + + +OTLPAttributeAction + + + |
+
+ Action defines the indexing action for the selected resoure attributes. They +can be either indexed as labels, added to structured metadata or drop altogether. + |
+
+attributes + +[]string + + |
+
+(Optional)
+ Attributes is the list of attributes to configure indexing or drop them +altogether. + |
+
+regex + +string + + |
+
+(Optional)
+ Regex allows choosing the attributes by matching a regular expression. + |
+
+(Appears on:OTLPSpec) +
+OTLPResourceAttributesSpec contains the configuration for resource attributes +to store them as index labels or structured metadata or drop them altogether.
+Field | +Description | +
---|---|
+ignoreDefaults + +bool + + |
+
+(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. + |
+
+attributes + + +[]OTLPResourceAttributesConfigSpec + + + |
+
+(Optional)
+ Attributes contains the configuration for resource attributes +to store them as index labels or structured metadata or drop them altogether. + |
+
+(Appears on:GlobalOTLPSpec, PerTenantLimitsTemplateSpec) +
+OTLPSpec defines which resource, scope and log attributes to +be stored as index or structured metadata or drop altogether
+Field | +Description | +
---|---|
+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 index labels or structured metadata or drop them altogether. + |
+
+logAttributes + + +[]OTLPAttributesSpec + + + |
+
+(Optional)
+ LogAttributes contains the configuration for log attributes +to store them as index labels or structured metadata or drop them altogether. + |
+
(Appears on:LokiStackStorageStatus, ObjectStorageSpec) @@ -2953,6 +3270,22 @@ PerTenantQueryLimitSpec
otlp
OTLP to configure which resource, scope and log attributes +to store as labels or structured metadata or drop them altogether +for a single tenants.
+retention