Skip to content

Complete PLT-910: remove legacy wasm dual metrics - #4075

Open
amir-deris wants to merge 2 commits into
mainfrom
amir/PLT-910-remove-dual-metric-emission
Open

Complete PLT-910: remove legacy wasm dual metrics#4075
amir-deris wants to merge 2 commits into
mainfrom
amir/PLT-910-remove-dual-metric-emission

Conversation

@amir-deris

@amir-deris amir-deris commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Finishes the wasm keeper OTel migration (PLT-910) by removing legacy telemetry/go-metrics emission that duplicated the OpenTelemetry histograms already in place.

  • Drop telemetry.MeasureSince fallbacks from contract duration recorders (instantiate, execute, migrate, sudo, query-smart, query-raw).
  • Remove legacy per-contract execute latency and query-smart invocation/gas-used metrics now covered by OTel.
  • Keep the OTel histograms as the single source of truth for wasm contract timing and gas usage.

Also addresses CON-336 and CON-337 unbounded cardinality issue.

Important:

This PR should only be merged after release 6.7 landed, since its equivalent Otel metrics are only included in release 6.7.
Also there should be a corresponding Platform dashboard migration PR.

@amir-deris amir-deris self-assigned this Sep 2, 2026
@amir-deris amir-deris changed the title Removed PLT-910 metrics + unbounded cardinality fix Complete PLT-910: remove legacy wasm dual metrics Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 2, 2026, 11:14 AM

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.16%. Comparing base (b68026f) to head (ce4cf43).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4075      +/-   ##
==========================================
- Coverage   61.23%   60.16%   -1.08%     
==========================================
  Files        2177     2069     -108     
  Lines      190632   178111   -12521     
==========================================
- Hits       116729   107156    -9573     
+ Misses      62892    60986    -1906     
+ Partials    11011     9969    -1042     
Flag Coverage Δ
sei-chain-pr 75.72% <100.00%> (?)
sei-db 70.02% <ø> (+0.21%) ⬆️
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-wasmd/x/wasm/keeper/keeper.go 86.27% <100.00%> (-0.03%) ⬇️
sei-wasmd/x/wasm/keeper/metrics.go 36.36% <100.00%> (-17.74%) ⬇️
sei-wasmd/x/wasm/keeper/msg_server.go 41.07% <ø> (-2.52%) ⬇️

... and 109 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amir-deris
amir-deris marked this pull request as ready for review September 2, 2026 11:17
@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are observability-only (metric emission and labels); wasm execution paths are unchanged. Risk is operational: dashboards must use OTel metrics after release 6.7, as noted in the PR.

Overview
Completes the wasm keeper PLT-910 migration by dropping legacy telemetry / go-metrics emissions that duplicated existing OpenTelemetry histograms, so OTel is the only source for contract timing and query gas.

Duration recorders no longer call telemetry.MeasureSince alongside OTel for instantiate, execute, migrate, sudo, query-smart, and query-raw. Query-smart no longer emits a separate per-contract invocation counter or legacy gas gauge; gas is recorded only via wasm_contract_query_smart_gas_used without a contract_address label (avoids unbounded series cardinality). ExecuteContract in the msg server no longer defers a per-contract wasmd/execute/contract/latency metric—execute latency is covered by keeper-level OTel wasm_contract_execute_duration.

Reviewed by Cursor Bugbot for commit ce4cf43. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid 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.

Clean removal of the duplicated telemetry/go-metrics wasm emission: the OTel histograms already cover every removed timing/gas signal, the contract_address-labeled series that drove the cardinality issue are gone, no callers or imports are left dangling, and the removed contractAddress parameter has no remaining users. Only note is that a rationale comment guarding against re-adding a per-contract attribute was deleted along with the legacy code.

Findings: 0 blocking | 1 non-blocking | 1 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • None at the file/PR level.
  • 1 suggestion(s)/nit(s) flagged inline on specific lines.

// contract_address omitted on the OTel histogram: unlike the legacy Prometheus sink, the
// OTel SDK has no series expiration, so a per-contract label here would retain one series
// per distinct contract address queried for the process lifetime.
func recordContractQuerySmartGasUsed(ctx context.Context, gasUsed uint64) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] The deleted comment carried a load-bearing constraint, not just legacy context: "the OTel SDK has no series expiration, so a per-contract label here would retain one series per distinct contract address queried for the process lifetime." That is exactly the cardinality problem this PR (CON-336/337) closes, and with the comment gone nothing stops the next change from re-adding a contract_address attribute to this histogram. Consider keeping a one-line version of the rationale on recordContractQuerySmartGasUsed (or on the contractQuerySmartGasUsed histogram definition), dropping only the reference to the removed Prometheus sink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant