Skip to content

fix(processors): retire dead MetricSuffix field — no sketch processor renames metric names - #382

Merged
zzylol merged 1 commit into
mainfrom
retire-metric-suffix
May 17, 2026
Merged

zzylol merged 1 commit into
mainfrom
retire-metric-suffix

Conversation

@zzylol

@zzylol zzylol commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the audit thread on "do asapcollector processors add a metric-name suffix on the wire?". Runtime answer: no. The 2026-05 refactor moved sketch-type identification from name suffixes to the OTLP `pdata.Metric` variant tag (DDSketch / KLLSketch / HLLSketch / CountSketch / CountMinSketch), and every production-path encode site preserves the input metric name:

Processor Encode site Behavior
DDSketch `shim_helpers.go::appendSketchMetrics` `env.MetricName = inputName`
KLL transmit_sketch=true `encode.go::sketchMetricName(base) → base` preserves
HLL `encode.go::cardinalityMetricName(base) → base` preserves
CountSketch n/a no MetricSuffix field exists
CountMin n/a no MetricSuffix field exists

But the dead `MetricSuffix string` config field plus the configuration plumbing left behind made the code look like a suffix SHOULD be applied. This PR removes the dead field across DDSketch / KLL / HLL, deletes the only remaining application site (the KLL fallback `transmit_sketch=false` quantile-CDF path that production never enables), and strips `metric_suffix:` lines from every agent + gateway YAML in `deploy/mvp-{singlenode,multinode}/`.

What's removed

  • `ddsketchprocessor/{config,shim_helpers,processor_test}.go` — field + 12 test references gone
  • `kllprocessor/{config,factory,encode,processor_test}.go` — field + fallback application + test references gone
  • `hllprocessor/{config,factory,processor_test}.go` — field + dedicated `TestBatchModeMetricSuffix` test gone
  • Stale doc table in `processor/ddsketchprocessor/README.md`
  • 13 agent yamls + 2 gateway yamls: `metric_suffix:` lines stripped
  • README + inline-comment updates calling out the refactor

Net: 27 files, +45 / -123.

Build verification

  • `bash build_asap_otel.sh --skip-patches` — full OCB build of the asap-otel binary succeeds with the patched processors compiled in (binary written to `opentelemetry-collector-contrib-patch/cmd/asap-otel/asap-otel`)
  • `go build ./...` per-processor passes
  • `go test ./...` per-processor has pre-existing failures from the SAME 2026-05 proto refactor (tests still reference removed wire fields `dp.Count`, `dp.Cardinality`, `dp.Precision` etc) — verified identical on clean main; out of scope for this PR

Residual

A few yaml comment lines still mention `metric_suffix` historically (`README-allsketches-demo.md`, `backend-inference-kll.yaml`, `asap-otel-agent-allsketches.yaml`, `backend-inference.yaml`) — they're inline comments documenting the previous behavior, harmless at runtime.

Related

Companion to ASAPQuery-backend #275 (`revert+retire(query): delete dead resolve_sketch_metric_alias rewrite`) which removed the backend-side counterpart of this same retired suffix scheme.

🤖 Generated with Claude Code

… renames metric names

Closes the audit thread on "do asapcollector processors add a metric-
name suffix on the wire?" The runtime answer is no — the 2026-05
refactor moved sketch-type identification from name suffixes to the
OTLP `pdata.Metric` variant tag (DDSketch / KLLSketch / HLLSketch /
CountSketch / CountMinSketch), and every production-path encode site
now preserves the input metric name:

  * DDSketch (`shim_helpers.go::appendSketchMetrics`): `env.MetricName = inputName`
  * KLL transmit_sketch=true (`encode.go::sketchMetricName`): returns base
  * HLL (`encode.go::cardinalityMetricName`): returns base
  * CountSketch / CountMin: no MetricSuffix field at all

But the dead `MetricSuffix string` config field plus the
configuration plumbing left behind made the code look like a suffix
SHOULD be applied. This PR removes the dead config field across
DDSketch / KLL / HLL, deletes the only remaining application site
(the KLL fallback `transmit_sketch=false` quantile-CDF path that
production never enables), and strips `metric_suffix:` lines from
every agent + gateway YAML in `deploy/mvp-{singlenode,multinode}/`.

Code touched:

  * `ddsketchprocessor/{config,shim_helpers,processor_test}.go` —
    field + 12 test references gone
  * `kllprocessor/{config,factory,encode,processor_test}.go` —
    field + fallback application + test references gone
  * `hllprocessor/{config,factory,processor_test}.go` —
    field + dedicated TestBatchModeMetricSuffix test gone
  * Stale doc table in `processor/ddsketchprocessor/README.md`
  * 13 agent yamls + 2 gateway yamls: `metric_suffix:` lines stripped
  * README + inline-comment updates calling out the refactor

Build verification:

  * `bash build_asap_otel.sh --skip-patches` — full OCB build of the
    asap-otel binary succeeds with the patched processors compiled
    in (binary written to opentelemetry-collector-contrib-patch/cmd/asap-otel/asap-otel)
  * `go build ./...` per-processor passes
  * `go test ./...` per-processor has pre-existing failures from the
    SAME 2026-05 proto refactor (tests still reference removed wire
    fields `dp.Count`, `dp.Cardinality`, `dp.Precision` etc) —
    verified unchanged on clean main; out of scope for this PR.

A few yaml comment lines still mention `metric_suffix` historically
(README-allsketches-demo.md, backend-inference-kll.yaml,
asap-otel-agent-allsketches.yaml, backend-inference.yaml) — they're
inline comments documenting the previous behavior, harmless at runtime.

Companion to ASAPQuery-backend #275 (`revert+retire(query): delete
dead resolve_sketch_metric_alias rewrite`) which removed the
backend-side counterpart of this same retired suffix scheme.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 9f87966 into main May 17, 2026
@zzylol
zzylol deleted the retire-metric-suffix branch May 17, 2026 19:38
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