Emit per-individual-table ETS memory/size telemetry#4636
Emit per-individual-table ETS memory/size telemetry#4636erik-the-implementer wants to merge 5 commits into
Conversation
Wire the already-present EtsTables.top_tables/1 to a new [:ets, :table] telemetry event, emitting ets.table.memory and ets.table.size tagged by table_name + table_type for the top N tables by memory. N is the new top_ets_individual_count option (default 10). Complements the existing per-table_type ets.memory.total aggregate, which is left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Every metrics reporter already stringifies tag values itself — OTel
(OtlpUtils.to_kv_value has an is_atom clause), Prometheus (exporter
escape/1 starts with to_string/1), and StatsD (both standard and datadog
formatters to_string the value). So the to_string/1 at the telemetry
call site was a no-op. Pass the raw atom/binary tag values through for
ets.memory.total and ets.table.{memory,size}.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Same as the ETS tag cleanup: every reporter that carries these tagged metrics (OTel, Prometheus, StatsD) stringifies tag values itself, and the CallHomeReporter doesn't carry the process.* metrics at all. So the to_string/1 on process_type in process_memory/1 and process_bin_memory/1 was a no-op. Pass map.type through raw. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4636 +/- ##
==========================================
+ Coverage 59.46% 59.66% +0.20%
==========================================
Files 385 400 +15
Lines 43039 43637 +598
Branches 12383 12383
==========================================
+ Hits 25591 26037 +446
- Misses 17371 17524 +153
+ Partials 77 76 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Claude Code ReviewSummaryThis PR adds a per-individual-table ETS telemetry event ( What's Working Well
Issues FoundCritical (Must Fix)None. Important (Should Fix)None remaining. Suggestions (Nice to Have)
Issue ConformanceStill no linked issue (per repo convention PRs should reference one — minor; the author notes this is a small telemetry enhancement rather than a tracked bug). Implementation matches the PR description; commits are accurately scoped. No scope creep. Previous Review Status
This PR looks ready to merge. Review iteration: 3 | 2026-06-19 |
ets.table.memory/size are tagged by the raw table name (per-shape/stack ids), so the top-N set rotates over time. OTel clears series between exports and StatsD is per-scrape, so a rotating high-cardinality set is fine there (and is the intended trade-off for Honeycomb). But TelemetryMetricsPrometheus.Core has no series TTL, so those series would accumulate in the local registry indefinitely and report stale frozen last_values for tables that drop out of the top N. Exclude ets.table.* from the Prometheus reporter's metric list (the bounded ets.memory.total by table_type still goes to Prometheus). Add a routing test asserting ets.table.* reach OTel + StatsD but not Prometheus. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks — addressed the cardinality issue and verified the rest. Important #1 (Prometheus cardinality) — fixed in Suggestion #1 (double Suggestion #2 (to_string at reporter boundary) — verified by source. Prometheus Suggestion #3 (option naming) — left as-is to avoid churning the existing No linked issue — this is a small telemetry enhancement rather than a tracked bug. |
What
Adds per-individual-table ETS memory/size telemetry so we can drill into which specific tables dominate ETS memory in Honeycomb, beyond the existing per-
table_typeaggregate.Details
[:ets, :table]telemetry event emittingets.table.memoryandets.table.size, tagged bytable_name+table_type, for the top N tables by memory.top_ets_individual_countoption (default 10).EtsTables.top_tables/1(no new gathering code); the existingtop_by_type/ets.memory.totalpath is untouched.:ets.all()walk (kept separate from the type rollup so the two counts stay independently configurable — a cheap second scan, not worth disturbing the working type path to merge).Two follow-up cleanup commits remove redundant
to_string/1calls on telemetry tag values for the ETS and process emitters. Every reporter that carries these tagged metrics (OTel, Prometheus, StatsD) stringifies tag values itself, and the CallHomeReporter doesn't carry them at all — so the call-siteto_string/1was a no-op. Tag values are now passed through raw (atom table name, string type).Testing
[:ets, :table]fires withmemory/sizemeasurements andtable_name/table_typemetadata.electric-telemetrysuite: 124 tests, 0 failures; cleanmix compile --warnings-as-errors.Changeset included (
@core/electric-telemetry, patch).🤖 Generated with Claude Code