Skip to content

feat(operator)!: switch default for OpenShift stream labels - #21001

Merged
xperimental merged 1 commit into
grafana:mainfrom
xperimental:otlp-default-labels
Mar 4, 2026
Merged

feat(operator)!: switch default for OpenShift stream labels#21001
xperimental merged 1 commit into
grafana:mainfrom
xperimental:otlp-default-labels

Conversation

@xperimental

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

This changes the stream labels configured by default for the OpenShift Logging tenancy mode to not include all the labels needed for the OpenShift Logging Console. The console labels can still be enabled by setting a configuration parameter on the LokiStack resource.
We found that having all these stream labels may lead to an excessive number of streams, especially if customers only have a few namespaces but a lot of containers (or a lot of container churn).

As of now the stream labels are required by the console, so some filters stop working when the labels are not available. This might be mitigated in future versions of the console though. Because the OTLP feature will become a GA feature for Red Hat customers soon it might be hard or impossible to change the defaults again soon.

Which issue(s) this PR fixes:

LOG-8319

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
@xperimental xperimental changed the title feat!(operator): switch default for OpenShift stream labels Feb 27, 2026
@@ -32,13 +32,13 @@ var (
)

// DefaultOTLPAttributes provides the required/recommended set of OTLP attributes for OpenShift Logging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// DefaultOTLPAttributes provides the required/recommended set of OTLP attributes for OpenShift Logging.
// DefaultOTLPAttributes provides the required set of OTLP attributes for OpenShift Logging, and optionally includes console labels when enabled
for _, label := range otlp.DefaultOTLPAttributes(enableConsoleLabels) {
requiredAttributes[label] = true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a validation test on dropping a console label when enabled?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test for trying to remove one of the requiredAttributes in otlp_test.go. The console labels are part of that list (even though "required" is not the wording we use in the other parts of the code), so I don't think we need to explicitly test for this.

@btaani btaani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit and a small question but looks good overall 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants