Skip to content

fix(telemetry): reject invalid endpoints and drop inactive rates - #217

Open
prd-carapulse[bot] wants to merge 1 commit into
hermes/pr206-readme-merge-fixfrom
hermes/pr206-telemetry-review-fixes
Open

prd-carapulse[bot] wants to merge 1 commit into
hermes/pr206-readme-merge-fixfrom
hermes/pr206-telemetry-review-fixes

Conversation

@prd-carapulse

@prd-carapulse prd-carapulse Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Why

Additional review of #206 reproduced three problems beyond the README conflict handled by #216:

  • Malformed effective OTLP endpoints silently fall back to localhost, forwarding configured exporter headers there. The regression intercepts HTTP before opening a socket and reproduces the fallback with fake credentials only.
  • Collector tests inherit signal-specific endpoints and credentials. A second loopback collector received the unchanged test spans, even though the test configured its own general endpoint.
  • A one-sided ladder quote projects state: empty with centerRateBps for the inactive side. The rate registry still exports that center rate beside quoting=0.

Changes

  • Validate each effective HTTP(S) exporter URL before registration and pass it explicitly to the exporter; malformed configuration disables only that signal through the existing sanitized warning path. Preserve signal override precedence, general endpoint base paths and query strings.
  • Clear and restore inherited OTEL_* settings in the collector fixture. A subprocess regression checks that the actual collector test runs, passes, and does not contact an inherited loopback endpoint.
  • Delete the empty-side rate snapshot while retaining explicit zero quoting/rung/asset gauges. Regression runs the real monitoring projection through the real SDK exporter across a one-sided transition.

Stack: #206#216 ← this PR. This PR targets hermes/pr206-readme-merge-fix and changes only telemetry configuration, metric observation, and their tests. No transaction execution, signing, contract, Helm, or workflow changes.

Verification

  • Observed malformed-endpoint and one-sided-book regressions fail before their fixes, then pass.
  • Isolation probe failed against the original fixture and passed after the fix; removing the clearing fixture also makes the committed subprocess regression fail.
  • Node 24.14.1: 1,402 tests passed across telemetry, observability, and quoter-bot; fork e2e excluded locally.
  • Scoped typechecks, root lint, format check, knip, quoter-bot JSDoc check, contracts build, quoter-bot build, built CLI version smoke, and diff check passed.
  • Published file contents, GitHub-verified signature and requester co-author trailer read back. CI will run on this new head; local results are not a CI-completion claim.

Requested by: @julien-devatom (GitHub), via #206 (comment)


Devin Review

Validate effective OTLP destinations before exporter registration,
isolate collector tests from inherited configuration, and remove rate
observations for empty book sides. Add regression and isolation controls.

Co-authored-by: Julien <61523188+julien-devatom@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ad62626af

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

export const resolveOtlpHttpEndpoint = (env: Environment, signal: 'traces' | 'metrics'): string => {
const specific = env[`OTEL_EXPORTER_OTLP_${signal.toUpperCase()}_ENDPOINT`]?.trim()
const endpoint = specific || env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim()
if (!endpoint || !/^https?:\/\//i.test(endpoint)) throw new TypeError('Invalid OTLP endpoint')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Classify invalid endpoints with a named configuration error

When an operator supplies a malformed OTLP endpoint, this expected configuration failure is thrown as a generic TypeError; startSignal consequently emits only errorName: "TypeError", making the disabled signal indistinguishable from an unrelated programming error. Normalize every invalid-endpoint path, including failures from new URL, to a named exported configuration error and preserve that safe classification in the warning, as required by the repository's typed-error convention and operator-reconstructable logging invariant.

AGENTS.md reference: AGENTS.md:L55-L56

Useful? React with 👍 / 👎.

julien-devatom added a commit that referenced this pull request Sep 14, 2026
Applies prd-carapulse's #216 (resolves the README table left with
committed conflict markers by the last merge) and #217 (per-signal
OTLP endpoint validation so a malformed endpoint disables that signal
instead of forwarding headers to the SDK's localhost fallback,
OTEL_* fixture isolation with a subprocess regression, and empty-side
rate snapshots deleted using the real ladder projection). Adds a
compile-time never assertion to the metric mapper's default branch and
documents the transaction.lifecycle counter in the README inventory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@julien-devatom

Copy link
Copy Markdown
Collaborator

Absorbed into #206 at 45779db (cherry-picked verbatim, credited in the commit message) — this PR's diff should now be empty against its base; safe to close. The endpoint-validation and projection-driven regressions were exactly right.

🤖 Addressed by Claude Code

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