Skip to content

HYPERFLEET-1223 - fix: remove WithPrettyPrint from OTel stdout exporter#215

Open
rh-amarin wants to merge 1 commit into
mainfrom
HYPERFLEET-1223
Open

HYPERFLEET-1223 - fix: remove WithPrettyPrint from OTel stdout exporter#215
rh-amarin wants to merge 1 commit into
mainfrom
HYPERFLEET-1223

Conversation

@rh-amarin

Copy link
Copy Markdown
Contributor

Summary

  • Removes stdouttrace.WithPrettyPrint() from the stdout OTel exporter fallback in createExporter() (pkg/telemetry/otel.go)
  • When OTEL_EXPORTER_OTLP_ENDPOINT is not set, the exporter was writing multi-line pretty-printed JSON spans to stdout, interleaving with single-line structured log output
  • Compact JSON output is far less disruptive to log readability in local/dev environments; production always uses OTLP

Test plan

  • make verify-all passes (1143 tests)
  • One-line change, no configuration or API surface affected

Closes https://redhat.atlassian.net/browse/HYPERFLEET-1223

🤖 Generated with Claude Code

Compact JSON output avoids multi-line span data interleaving with
single-line structured log output in local/dev environments.

Co-Authored-By: Claude <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested review from crizzo71 and vkareh June 13, 2026 09:16
@openshift-ci

openshift-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aredenba-rh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 2fffe03e-82df-4f8d-b681-1ec6b24920a9

📥 Commits

Reviewing files that changed from the base of the PR and between 605d870 and 912266e.

📒 Files selected for processing (1)
  • pkg/telemetry/otel.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted trace output formatting for the standard output exporter when endpoint configuration is not explicitly set.

Walkthrough

Line 95 in pkg/telemetry/otel.go changes the stdout trace exporter instantiation from stdouttrace.New(stdouttrace.WithPrettyPrint()) to stdouttrace.New(). This removal of the WithPrettyPrint() option applies only when OTEL_EXPORTER_OTLP_ENDPOINT is unset or empty. No changes to exporter selection logic, sampler initialization, or resource configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: removing WithPrettyPrint from the OTel stdout exporter, which matches the changeset exactly.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for removing WithPrettyPrint, the problem it solves, and providing test coverage information.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sec-02: Secrets In Log Output ✅ Passed Scanned 148 non-_test.go, non-.example Go files for slog/log/logr/zap/fmt.Print* statements containing token/password/credential/secret terms; none found.
No Hardcoded Secrets ✅ Passed Scanned pkg/telemetry/otel.go for hardcoded credentials patterns (Bearer, user:pass@host, private keys, apiKey/secret/token/password string literals); none found (CWE-798).
No Weak Cryptography ✅ Passed PR changes only stdouttrace.WithPrettyPrint removal; scan of changed files and pkg/telemetry/otel.go finds no crypto/md5, crypto/des/rc4, SHA1, or ECB (CWE-327).
No Injection Vectors ✅ Passed PR 215 only changes pkg/telemetry/otel.go by removing stdouttrace.WithPrettyPrint(); modified file contains none of the flagged injection patterns (CWE-78/79/89/79/502).
No Privileged Containers ✅ Passed PR #215 only edits pkg/telemetry/otel.go (removes stdouttrace.WithPrettyPrint); no K8s/Helm/Dockerfile changes introducing privileged containers (CWE-250).
No Pii Or Sensitive Data In Logs ✅ Passed pkg/telemetry/otel.go only logs exporter/resource failures and env protocol/sampler fields; no fmt/slog/zap logging or raw request/response/PII is added by this PR (stdouttrace.New() only).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch HYPERFLEET-1223
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch HYPERFLEET-1223

Comment @coderabbitai help to get the list of available commands and usage tips.

@hyperfleet-ci-bot

Copy link
Copy Markdown

Risk Score: 2 — risk/medium

Signal Detail Points
PR size 4 lines +0
Sensitive paths none +0
Test coverage No _test.go files in diff +2

Computed by hyperfleet-risk-scorer

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant