From 14f63a9f8c22e74873e0e016f3f1253aae18040a Mon Sep 17 00:00:00 2001 From: Ashwin Mehendale Date: Tue, 3 Mar 2026 14:49:01 +0530 Subject: [PATCH] OBSDOCS-3174: Document Review default set of stream labels for "openshift-logging" tenant --- configuring/configuring-lokistack-otlp.adoc | 40 ++++++++--------- ...sole-labels-for-openshift-web-console.adoc | 43 +++++++++++++++++++ 2 files changed, 62 insertions(+), 21 deletions(-) create mode 100644 modules/enabling-console-labels-for-openshift-web-console.adoc diff --git a/configuring/configuring-lokistack-otlp.adoc b/configuring/configuring-lokistack-otlp.adoc index 7a00f445234e..8b18b944cd69 100644 --- a/configuring/configuring-lokistack-otlp.adoc +++ b/configuring/configuring-lokistack-otlp.adoc @@ -107,31 +107,29 @@ Attributes that are not explicitly set as stream labels or dropped from the entr [id="customizing-openshift-defaults_{context}"] === Customizing OpenShift defaults -In the `openshift-logging` mode, certain attributes are required and cannot be removed from the configuration due to their role in OpenShift functions. Other attributes, labeled *recommended*, might be dropped if performance is impacted. For information about the attributes, see xref:../configuring/opentelemetry-data-model.adoc#attributes_opentelemetry-data-model[OpenTelemetry data model attributes]. +In the `openshift-logging` mode, the configuration requires certain attributes that you must not remove due to their role in OpenShift functions. +Other attributes, called console labels, need to be enabled. +The {ocp-product-title} web console uses console labels to provide a simplified UI for querying logs. +Enabling console labels adds the following attributes to stream labels: + +* `k8s.container.name` +* `k8s.cronjob.name` +* `k8s.daemonset.name` +* `k8s.deployment.name` +* `k8s.job.name` +* `k8s.node.name` +* `k8s.pod.name` +* `k8s.statefulset.name` +* `kubernetes.container_name` +* `kubernetes.host` +* `kubernetes.pod_name` +* `service.name` When using the `openshift-logging` mode without custom attributes, you can achieve immediate compatibility with OpenShift tools. If additional attributes are needed as stream labels or some attributes need to be dropped, use custom configuration. Custom configurations can merge with default configurations. -[id="removing-recommended-attributes_{context}"] -=== Removing recommended attributes +For information about the attributes, see xref:../configuring/opentelemetry-data-model.adoc#attributes_opentelemetry-data-model[OpenTelemetry data model attributes]. -To reduce default attributes in the `openshift-logging` mode, disable recommended attributes: - -[source,yaml] ----- -# ... -spec: - tenants: - mode: openshift-logging - openshift: - otlp: - disableRecommendedAttributes: true # <1> ----- -<1> Set `disableRecommendedAttributes: true` to remove recommended attributes, which limits default attributes to the required attributes or stream labels. -+ -[NOTE] -==== -This setting might negatively impact query performance, as it removes default stream labels. You must pair this option with a custom attribute configuration to retain attributes essential for queries. -==== +include::modules/enabling-console-labels-for-openshift-web-console.adoc[leveloffset=+2] [role="_additional-resources"] [id="additional-resources_{context}"] diff --git a/modules/enabling-console-labels-for-openshift-web-console.adoc b/modules/enabling-console-labels-for-openshift-web-console.adoc new file mode 100644 index 000000000000..175d22d091c0 --- /dev/null +++ b/modules/enabling-console-labels-for-openshift-web-console.adoc @@ -0,0 +1,43 @@ +:_newdoc-version: 2.18.4 +:_template-generated: 2026-03-03 +:_mod-docs-content-type: PROCEDURE + +[id="enabling-console-labels-for-openshift-web-console_{context}"] += Enabling console labels for OpenShift web console + +Enable stream labels for OpenShift web console, called console labels, for a simplified UI for querying logs. +The log viewer in the {ocp-product-title} web console uses the console labels for its integrated filters. + +[IMPORTANT] +===== +Currently, the OpenShift web console only supports filtering on attributes by using stream labels. +Therefore, if you do not enable all the console labels, the filters in the log viewer might not function correctly. +However, including all the console labels can lead to performance issues. +If you know that you use only a subset of the filters, add only those stream labels to the configuration instead of using the full set. +This behavior might change in the future. +===== + +.Prerequisites +* You have created a `ClusterLogForwarder` custom resource (CR) with an OpenTelemetry Protocol (OTLP) output. + +.Procedure + +. Update the ClusterLogForwarder custom resource (CR): ++ +[source,yaml] +---- +# ... +spec: + tenants: + mode: openshift-logging + openshift: + otlp: + enableConsoleLabels: true +---- + +. Apply the CR object by using the following command: ++ +[source,terminal] +---- +$ oc apply -f .yaml +----