Skip to content

fix(telemetry): retry idle connection failures - #99

Merged
tbhb-agent merged 1 commit into
mainfrom
agent/gm-j2-codex
Nov 23, 2026
Merged

tbhb-agent merged 1 commit into
mainfrom
agent/gm-j2-codex

Conversation

@tbhb-dev-agent-pull-requests

@tbhb-dev-agent-pull-requests tbhb-dev-agent-pull-requests Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Why

A collector or proxy can close an idle connection at about the same time as the next scheduled metric export. A reset or end-of-file then loses that interval's data point (D-R4).

Behavior change

The exporter closes idle HTTP connections after 45 seconds. If an export fails with a connection reset or end-of-file, it retries that export once within the original deadline and returns any error from the retry.

Decisions

The exporter uses a clone of Go's default HTTP transport. A small exporter wrapper handles the retry because OpenTelemetry's retry option treats end-of-file as terminal and sets a time budget rather than an attempt limit.

Deviations from the task

The requested custom client takes precedence over OpenTelemetry's HTTP timeout and certificate environment settings. The client uses Go's system trust store and the SDK's export deadline.

Needs human judgment

Check whether any collector deployment depends on an OpenTelemetry certificate or timeout setting.

Risk

If the collector accepts an export and the connection closes before the client receives its response, the retry can deliver the same cumulative data point twice.

Verification

  • bazelisk run //:gazelle and bazelisk run //:format completed.
  • bazelisk test //:golangci_lint_test --test_output=errors passed.
  • bazelisk test --test_output=errors -- //... -//:gitleaks_test -//:zizmor_test passed. The deploy test passed on macOS, and Bazel skipped the Windows workspace status test. The run instructions excluded the two security scans.
  • bazelisk run @tbhb_rules//lint:pr_size -- origin/main HEAD reported pr_size: code=135/400 raw=176/1500.

Human steering

The brief specified the 45-second idle timeout and capped connection-error recovery at one retry.

Assisted-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:6507fa80a17e0653;surface=cli

Generated-by: LLM effort=high;harness=codex:0.166.0;model=openai:gpt-6.2-sol;session=sha-256-64:01b1b8c921aa92f9;surface=exec
@tbhb-agent
tbhb-agent merged commit 91e590b into main Nov 23, 2026
8 checks passed
@tbhb-agent
tbhb-agent deleted the agent/gm-j2-codex branch November 23, 2026 18:39
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.

1 participant