Skip to content

fix: keep the once-per-process metrics warning on a single line - #1196

Closed
panavenue wants to merge 1 commit into
feature/client-side-metricsfrom
metrics-single-line-warning
Closed

panavenue wants to merge 1 commit into
feature/client-side-metricsfrom
metrics-single-line-warning

Conversation

@panavenue

Copy link
Copy Markdown
Collaborator

Observed in the final fail-open verification against the real API (identity without roles/monitoring.metricWriter): the single warnLogger.Printf rendered as two physical lines because the gRPC status text embeds a newline before error details: name = DebugInfo …. Log collectors (Cloud Logging agent, journald) treat the second line as a separate, prefix-less entry.

singleLine(err) collapses whitespace in the error text; content is unchanged. TestPermanentErrorWarningIsOneLine reproduces it with a DebugInfo detail and asserts one line.

Verification run that found it: 105 dials / 0 failures / p99 11 ms / Close 1 ms, exactly one warning, one deduplicated debug line, over 3.5 min with production export timings.

gRPC status errors embed newlines ("error details: name = DebugInfo ..."),
so the warning rendered as two physical lines; log collectors treat the
second as an orphan entry. Collapse whitespace in the error text.
@panavenue

Copy link
Copy Markdown
Collaborator Author

Folded into #1199 (combined with the final-flush fix) at the reviewers' request.

@panavenue panavenue closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants