---
title: "Make Kubernetes logs easier to correlate with traces using the log normalizer operator"
description: "The log normalizer operator for Red Hat OpenShift injects a sidecar into selected pods to normalize heterogeneous log formats without application code changes. It detects formats such as JSON, klog, Zap console, logfmt, and plain text, reassembles multiline entries like stack traces, and emits a consistent structured JSON record. A Drain-style template miner clusters structurally similar lines and assigns template IDs as additional metadata. The sidecar attaches Kubernetes resource attributes and promotes trace and span IDs from common field names to top-level fields for correlation. Normalized records remain available through kubectl logs and can optionally be exported over OTLP to an OpenTelemetry collector."
---

# Make Kubernetes logs easier to correlate with traces using the log normalizer operator

[Red Hat](https://yomu.fyi/company/red-hat) · Denis Moskalenko · Nov 6, 2026

**Type:** Explainer

## Summary

The log normalizer operator for Red Hat OpenShift injects a sidecar into selected pods to normalize heterogeneous log formats without application code changes. It detects formats such as JSON, klog, Zap console, logfmt, and plain text, reassembles multiline entries like stack traces, and emits a consistent structured JSON record. A Drain-style template miner clusters structurally similar lines and assigns template IDs as additional metadata. The sidecar attaches Kubernetes resource attributes and promotes trace and span IDs from common field names to top-level fields for correlation. Normalized records remain available through kubectl logs and can optionally be exported over OTLP to an OpenTelemetry collector.

## Context

Modern Kubernetes applications produce logs in inconsistent formats (JSON, logfmt, klog, plain text), making correlation with traces difficult without shared field names or Kubernetes identity.

## Approach / What changed

The operator reconciles a LogNormalizerConfig into a MutatingWebhookConfiguration that injects a native sidecar and wrapper into selected pods. The wrapper tees stdout/stderr to the sidecar, which detects the input format, normalizes it to consistent JSON fields, reassembles multiline entries, attaches Kubernetes resource attributes from the Downward API, promotes trace/span IDs, and optionally exports normalized records over OTLP gRPC to an OpenTelemetry collector.

## Takeaways

- The sidecar normalizer detects and normalizes multiple log formats (JSON, klog, Zap console, logfmt, plain text) without requiring application code changes or per-component parsing rules in the collector.
- Multiline entries such as Go panic stacks, Java traces, and Python tracebacks are reassembled before parsing, preserving the relationship between an exception message and its stack frames.
- The normalizer promotes trace and span IDs from common field names (e.g., trace\_id, traceID, dd.trace\_id) to top-level fields and attaches Kubernetes resource attributes, enabling correlation tools like Korrel8r to connect logs with traces.

## FAQ

### Should every component use the sidecar?

The architecture proposal recommends a compliance model where components follow a common logging contract, with the sidecar as a means to meet it. Components owned by the platform using Go can standardize natively and still use the sidecar for Kubernetes context; Python, vendor, and upstream components are good candidates to avoid modifying logging code.

### Does the normalizer redact sensitive data or sample high-volume logs?

No production redaction or sampling policy is defined by this operator. The normalizer preserves parsed structured fields and the original message, so teams must decide where to remove personal or secret data and how to control high-volume sources at the application or collector boundary.

### Which fields should production teams standardize?

The proposed contract calls for an RFC 3339 timestamp, a canonical severity, a message body, and a logger or instrumentation name. Trace and span IDs should be present when tracing is active. Kubernetes controllers should also expose service identity such as service.name and service.namespace as resource attributes.

**Tags:** [Kubernetes](https://yomu.fyi/topic/kubernetes), [Logs](https://yomu.fyi/topic/logs), [Observability](https://yomu.fyi/topic/observability), [OpenShift](https://yomu.fyi/topic/openshift), [OpenTelemetry](https://yomu.fyi/topic/opentelemetry)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/11/06/make-kubernetes-logs-easier-to-correlate-with-traces-using-the-log-normalizer-operator)
- Source URL: https://developers.redhat.com/articles/2026/11/06/make-kubernetes-logs-easier-to-correlate-with-traces-using-the-log-normalizer-operator
- Ingested by Yomu: 2026-11-06T15:00:18.137Z

[Read original post](https://developers.redhat.com/articles/2026/11/06/make-kubernetes-logs-easier-to-correlate-with-traces-using-the-log-normalizer-operator)
