Skip to content

feat(ircrc-rosetta): add token-specific metrics #4790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fsodre
Copy link
Contributor

@fsodre fsodre commented Apr 11, 2025

This introduces a token-specific contextualized metrics class, used to emit metrics associated with a particular token when running multi-token rosetta.

Metrics now look like this, with token labels associated with the metrics:

# HELP ledger_sync_blocks_fetched_total Number of blocks fetched from the ledger
# TYPE ledger_sync_blocks_fetched_total counter
ledger_sync_blocks_fetched_total{token_display_name="ckBTC-mxzaz"} 47047
ledger_sync_blocks_fetched_total{token_display_name="ckETH-ss2fx"} 16
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 10
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1048576
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 21
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 46743552
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1744382003
# HELP process_threads Number of OS threads in the process.
# TYPE process_threads gauge
process_threads 18
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1213968384
# HELP rosetta_api_status_total Response status for ic-rosetta-api endpoints
# TYPE rosetta_api_status_total counter
rosetta_api_status_total{status_code="200",token_display_name="ckETH-ss2fx"} 1
# HELP rosetta_http_request_duration_seconds HTTP request latency in seconds
# TYPE rosetta_http_request_duration_seconds histogram
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.005"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.01"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.025"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.05"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.1"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.25"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="0.5"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="1"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="2.5"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="5"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="10"} 1
rosetta_http_request_duration_seconds_bucket{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx",le="+Inf"} 1
rosetta_http_request_duration_seconds_sum{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx"} 0.000276049
rosetta_http_request_duration_seconds_count{endpoint="/block",method="POST",status="200",token_display_name="ckETH-ss2fx"} 1
# HELP rosetta_verified_block_height Verified block height
# TYPE rosetta_verified_block_height gauge
rosetta_verified_block_height{token_display_name="ckETH-ss2fx"} 805409

@fsodre fsodre requested a review from a team as a code owner April 11, 2025 14:35
@github-actions github-actions bot added the feat label Apr 11, 2025
Copy link
Member

@mbjorkqvist mbjorkqvist left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @fsodre!

@fsodre fsodre enabled auto-merge April 15, 2025 09:11
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.

2 participants