Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions configuring/configuring-lokistack-otlp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
Expand Down
43 changes: 43 additions & 0 deletions modules/enabling-console-labels-for-openshift-web-console.adoc
Original file line number Diff line number Diff line change
@@ -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 <file-name>.yaml
----