Skip to content

feat(metrics): migrate x/oracle, x/epoch, x/mint to OpenTelemetry#3439

Merged
amir-deris merged 2 commits into
mainfrom
amir/plt-335-migrate-x-oracle-epoch-mint-to-otel
May 15, 2026
Merged

feat(metrics): migrate x/oracle, x/epoch, x/mint to OpenTelemetry#3439
amir-deris merged 2 commits into
mainfrom
amir/plt-335-migrate-x-oracle-epoch-mint-to-otel

Conversation

@amir-deris
Copy link
Copy Markdown
Contributor

@amir-deris amir-deris commented May 14, 2026

Adds OTel instrumentation to x/oracle, x/epoch, and x/mint following the same pattern as PLT-329 (#3396) and PLT-330 (#3423). Legacy calls are kept with dual-emit until dashboards are verified (tracked in PLT-336).

New instruments

x/oracle (meter oracle)

  • oracle_mid_blocker_duration — histogram, seconds, fine-grained buckets
  • oracle_end_blocker_duration — histogram, seconds, fine-grained buckets
  • oracle_price_update — counter, denom label

x/oracle/keeper (meter oracle_keeper)

  • oracle_vote_penalty_count — gauge, validator + type (miss/abstain/success) labels
  • oracle_validator_slashed — counter, validator + type labels

x/epoch/keeper (meter epoch_keeper)

  • epoch_begin_blocker_duration — histogram, seconds, fine-grained buckets
  • epoch_new — gauge, current epoch number

x/mint/types (meter mint)

  • mint_coins_minted — gauge, denom label

Note

Low Risk
Primarily adds instrumentation (new OTel meters and metric emissions) with dual-emitting legacy metrics; minimal behavioral change beyond extra work in hot paths (begin/mid/end blockers).

Overview
Adds OpenTelemetry instrumentation for x/oracle, x/oracle/keeper, x/epoch/keeper, and x/mint/types, introducing new histograms/counters/gauges for blocker durations, epoch transitions, mint amounts, oracle price updates, vote penalty counts, and validator slashes.

Updates the relevant execution points (epoch begin blocker, oracle mid/end blockers, oracle vote-penalty updates/deletes, oracle slashing, and mint success recording) to emit the new OTel metrics while temporarily dual-emitting the existing telemetry/utils/metrics metrics behind TODO(PLT-336) for dashboard verification.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 14, 2026, 8:48 PM

@amir-deris amir-deris changed the title Added new metric packages for x/oracle, x/mint and x/epoch feat(metrics): migrate x/oracle, x/epoch, x/mint to OpenTelemetry May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 84.90566% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.31%. Comparing base (5060dcd) to head (36215f2).

Files with missing lines Patch % Lines
x/epoch/keeper/metrics.go 50.00% 1 Missing and 1 partial ⚠️
x/mint/types/metrics.go 50.00% 1 Missing and 1 partial ⚠️
x/oracle/keeper/metrics.go 50.00% 1 Missing and 1 partial ⚠️
x/oracle/metrics.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3439   +/-   ##
=======================================
  Coverage   59.31%   59.31%           
=======================================
  Files        2120     2124    +4     
  Lines      175523   175567   +44     
=======================================
+ Hits       104106   104141   +35     
- Misses      62338    62343    +5     
- Partials     9079     9083    +4     
Flag Coverage Δ
sei-chain-pr 86.87% <84.90%> (?)
sei-db 70.41% <ø> (-0.22%) ⬇️

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

Files with missing lines Coverage Δ
x/epoch/keeper/abci.go 100.00% <100.00%> (ø)
x/mint/types/minter.go 90.24% <100.00%> (+0.12%) ⬆️
x/oracle/abci.go 100.00% <100.00%> (ø)
x/oracle/keeper/keeper.go 96.04% <100.00%> (+0.13%) ⬆️
x/oracle/keeper/slash.go 86.48% <100.00%> (+0.37%) ⬆️
x/epoch/keeper/metrics.go 50.00% <50.00%> (ø)
x/mint/types/metrics.go 50.00% <50.00%> (ø)
x/oracle/keeper/metrics.go 50.00% <50.00%> (ø)
x/oracle/metrics.go 50.00% <50.00%> (ø)

... and 1 file 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.

Copy link
Copy Markdown
Contributor

@bdchatham bdchatham left a comment

Choose a reason for hiding this comment

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

Generally looks good to me. I think there are similar, very small improvements to use constants or one-time initialized vals for our dimensions to prevent from instantiating an identical copy every time we collect a metric but it's a non-blocker

@amir-deris amir-deris requested a review from masih May 14, 2026 23:56
@amir-deris amir-deris added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 823a78d May 15, 2026
43 checks passed
@amir-deris amir-deris deleted the amir/plt-335-migrate-x-oracle-epoch-mint-to-otel branch May 15, 2026 17:19
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.

3 participants