Skip to content

HYPERFLEET-1224 - fix: remove WithPrettyPrint from OTel stdout exporter#172

Open
rh-amarin wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rh-amarin:HYPERFLEET-1224
Open

HYPERFLEET-1224 - fix: remove WithPrettyPrint from OTel stdout exporter#172
rh-amarin wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rh-amarin:HYPERFLEET-1224

Conversation

@rh-amarin

Copy link
Copy Markdown
Contributor

Summary

  • Removes stdouttrace.WithPrettyPrint() from the stdout OTel exporter fallback in InitTraceProvider() (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 less disruptive to log readability in local/dev environments; production always uses OTLP
  • Mirrors the same fix applied to hyperfleet-api in HYPERFLEET-1223 / hyperfleet-api#215

Test plan

  • make verify passes
  • make test passes (telemetry package tests pass including TestStartSpan, TestSetTraceContext)
  • One-line change, no configuration or API surface affected

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

🤖 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 jsell-rh and ma-hill June 14, 2026 16:23
@openshift-ci

openshift-ci Bot commented Jun 14, 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 ma-hill 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 14, 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: 3bfb01c8-a722-4924-abb4-3672fd0e18f1

📥 Commits

Reviewing files that changed from the base of the PR and between 4dccc18 and 5da42cf.

📒 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

  • Chores
    • Updated trace output formatting to use standard export settings instead of pretty-printed format.

Walkthrough

InitTraceProvider in pkg/telemetry/otel.go removes stdouttrace.WithPrettyPrint() from the stdout trace exporter constructor, leaving it with no explicit options. No exported function or type signatures changed. No other control flow or provider logic was modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: removing WithPrettyPrint from OTel stdout exporter, which aligns with the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation for removing WithPrettyPrint and its impact on log output formatting.
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 No log statements in pkg/telemetry/otel.go include tokens, passwords, credentials, or secrets. All logged values are safe configuration parameters (protocol type, sampler names, sampling rates) and...
No Hardcoded Secrets ✅ Passed No hardcoded secrets found. Change removes WithPrettyPrint() option from stdouttrace.New() call—telemetry configuration only, no credentials or sensitive data introduced.
No Weak Cryptography ✅ Passed PR removes pretty-print option from OTel stdout exporter in pkg/telemetry/otel.go. No cryptographic primitives, weak cryptography, or custom crypto implementations are present in this change.
No Injection Vectors ✅ Passed No injection vectors found. Code uses safe switch/case validation for environment variables, standard library initialization calls without user input, and parameterized/type-safe operations. The Wi...
No Privileged Containers ✅ Passed PR modifies only pkg/telemetry/otel.go (Go source code), not any Kubernetes manifests, Helm templates, or Dockerfiles. Check is not applicable.
No Pii Or Sensitive Data In Logs ✅ Passed No logging statements in the modified file expose PII, session IDs, raw request/response bodies, or credentials. Logged values are non-sensitive configuration/protocol values (service name, version...

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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