Skip to content

docs: report component-attribute override bug in DiagnosticsMetrics - #712

Open
juliobguedes wants to merge 1 commit into
masterfrom
docs/diagnostics-metrics-component-attribute-bug
Open

juliobguedes wants to merge 1 commit into
masterfrom
docs/diagnostics-metrics-component-attribute-bug

Conversation

@juliobguedes

Copy link
Copy Markdown
Contributor

Summary

  • Documents a bug found while validating the 6.x diagnostics-metrics backport (docs(openspec): propose observability diagnostics for node-vtex-api@6.x #710/feat(telemetry): backport diagnostics metrics observability to 6.x #711) against production ClickHouse data: DiagnosticsMetrics's base-attribute precedence rule silently relabels every outbound HTTP client call's component attribute as 'http-handler' when it happens inside a request's timings.ts-scoped runWithBaseAttributes call.
  • Confirmed with real production numbers (vtex.search-resolver@1.114.0, cluster iostore-f3t): http_handler_requests_total = 72,587 vs. io_app_operation_duration_milliseconds filtered to component='http-handler' = 16,104,556 — a ~222x mismatch.
  • Reproducible on master today, independent of the 6.x work — this is a pre-existing latent bug in code both branches share verbatim, not a regression.
  • No code changes in this PR — this is purely the write-up, meant as input for a future spec/change fixing it on both master and 6.x.

Test plan

  • N/A (documentation only). Follow-up work: run the remaining verification query in the doc, then scope and implement the actual fix as a separate change on each branch.

🤖 Generated with Claude Code

Found while validating the 6.x diagnostics-metrics backport against
production ClickHouse data: DiagnosticsMetrics.mergeAttributes gives
base attributes precedence over conflicting custom attributes, and
timings.ts sets component: 'http-handler' as a base attribute for the
whole request scope. Every outbound HTTP client call made while
handling that request (metrics.ts's own component: 'http-client')
gets silently relabeled as 'http-handler' in the shared
io_app_operation_duration_milliseconds histogram.

Confirmed via production data: for vtex.search-resolver@1.114.0 in
cluster iostore-f3t over 1 hour, http_handler_requests_total shows
72,587 while io_app_operation_duration_milliseconds filtered to
component='http-handler' shows 16,104,556 (~222x).

Reproducible on master today, independent of the 6.x backport -- not
a regression, a pre-existing latent bug in code both branches share
verbatim. This document is input for a future spec/change fixing it
on both branches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonar-workflows

Copy link
Copy Markdown

@dk-pr-review

dk-pr-review Bot commented Sep 18, 2026

Copy link
Copy Markdown

DK Review — Audit Summary

Verdict: ⏳ INCOMPLETE

Severity Count
BLOCK 0
RESTRICT 0
SUGGEST 2

Only BLOCK and RESTRICT findings anchored to a changed line are commented inline on the diff. The 2 findings below open no review thread.

Scenarios evaluated: general-review
Scenarios skipped: dependency-governance (no matching files), pipeline-config (no matching files), agent-skills-review (no matching files), quality-ratchet (no matching files)


📋 Findings (2)

SUGGEST

  1. [governance.unverifiable] docs/bugs/diagnostics-metrics-component-attribute-override.md — goldenPathGetRules returned zero rules for repository vtex/node-vtex-api, both scoped and unscoped. Governance compliance for this PR could not be verified against Golden Path policy.
    Re-run governance review once goldenPathGetRules has an active rule set for this repository, or confirm with the platform team why no rules are indexed for vtex/node-vtex-api.
  2. [general.broken-references] docs/bugs/diagnostics-metrics-component-attribute-override.md:3 — The doc asserts the 6.x code was "ported verbatim from master during the diagnostics-metrics backport (PRs docs(openspec): propose observability diagnostics for node-vtex-api@6.x #710/feat(telemetry): backport diagnostics metrics observability to 6.x #711)" but doesn't link these PRs, and the root-cause section cites specific file paths (src/metrics/DiagnosticsMetrics.ts, src/service/worker/runtime/http/middlewares/timings.ts, src/HttpClient/middlewares/metrics.ts) and production identifiers (cluster iostore-f3t, app vtex.search-resolver@1.114.0) without a way for a reviewer to confirm they're current/correct.
    Add direct links to PRs docs(openspec): propose observability diagnostics for node-vtex-api@6.x #710/feat(telemetry): backport diagnostics metrics observability to 6.x #711 and to the exact commit/line permalinks for the three cited files so reviewers and future readers can verify the claims without re-deriving them.

DK Review v1.0.0 | To dismiss a finding: reply /dk-review dismiss [reason] under its comment

@juliobguedes juliobguedes self-assigned this Sep 19, 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.

1 participant