Skip to content

feat: api and indexer instrumented with metrics#221

Open
dhyaniarun1993 wants to merge 23 commits intomainfrom
feat/api-indexer-metrics
Open

feat: api and indexer instrumented with metrics#221
dhyaniarun1993 wants to merge 23 commits intomainfrom
feat/api-indexer-metrics

Conversation

@dhyaniarun1993
Copy link
Copy Markdown
Member

@dhyaniarun1993 dhyaniarun1993 commented Apr 17, 2026

Closes #205

@dhyaniarun1993 dhyaniarun1993 self-assigned this Apr 17, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 11.39896% with 684 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@523cfdb). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/indexer/store/instrumented.go 0.00% 143 Missing ⚠️
pkg/ethrpc/store/instrumented.go 0.00% 110 Missing ⚠️
pkg/userstore/instrumented.go 0.00% 86 Missing ⚠️
pkg/indexer/client/instrumented.go 0.00% 53 Missing ⚠️
pkg/app/api/server.go 0.00% 44 Missing ⚠️
pkg/app/indexer/server.go 0.00% 28 Missing ⚠️
pkg/app/http/metrics.go 0.00% 25 Missing ⚠️
pkg/ethrpc/store/metrics.go 0.00% 22 Missing ⚠️
pkg/indexer/store/metrics.go 0.00% 22 Missing ⚠️
pkg/transfer/cache_instrumented.go 0.00% 21 Missing ⚠️
... and 11 more

❌ Your patch status has failed because the patch coverage (11.39%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #221   +/-   ##
=======================================
  Coverage        ?   30.65%           
=======================================
  Files           ?      140           
  Lines           ?     9246           
  Branches        ?        0           
=======================================
  Hits            ?     2834           
  Misses          ?     6175           
  Partials        ?      237           
Flag Coverage Δ
unittests 30.65% <11.39%> (?)

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

Files with missing lines Coverage Δ
pkg/config/config.go 71.69% <ø> (ø)
pkg/ethrpc/miner/metrics.go 100.00% <100.00%> (ø)
pkg/ethrpc/miner/miner.go 97.50% <100.00%> (ø)
pkg/indexer/engine/metrics.go 100.00% <100.00%> (ø)
pkg/indexer/engine/processor.go 83.33% <100.00%> (ø)
pkg/relayer/engine/metrics.go 94.95% <100.00%> (ø)
internal/metrics/metrics.go 0.00% <0.00%> (ø)
pkg/cantonsdk/client/options.go 0.00% <0.00%> (ø)
pkg/relayer/store/metrics.go 0.00% <0.00%> (ø)
pkg/app/relayer/server.go 0.00% <0.00%> (ø)
... and 17 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements comprehensive Prometheus metrics instrumentation across the API server, indexer, relayer, and Canton SDK, including dedicated monitoring endpoints and updated deployment configurations. It also introduces a robust suite of end-to-end tests covering user registration, JSON-RPC facades, and bridge deposit/withdrawal flows. Feedback highlights the need to remove an outdated compile-time guard in the API middleware, address a risky type assertion in the instrumented indexer store to prevent potential panics, and refactor the indexer's monitoring server initialization to ensure architectural consistency across the codebase.

Comment thread pkg/app/api/middleware.go Outdated
Comment thread pkg/indexer/store/instrumented.go Outdated
Comment thread pkg/app/indexer/server.go
Base automatically changed from feat/docker-compose-monitoring to main April 17, 2026 09:05
@dhyaniarun1993 dhyaniarun1993 marked this pull request as ready for review April 17, 2026 11:06
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.

Add Prometheus metrics to API Server and Indexer

2 participants