AthanorLabs / atomic-swap

💫 ETH-XMR atomic swap implementation
GNU Lesser General Public License v3.0
341 stars 44 forks source link

add prometheus metrics #464

Closed stubbrn closed 1 year ago

stubbrn commented 1 year ago

closes #240

Adds the following prometheus metrics

# HELP swapdaemon_avg_swap_duration_seconds The average swap duration
# TYPE swapdaemon_avg_swap_duration_seconds gauge
swapdaemon_avg_swap_duration_seconds 18
# HELP swapdaemon_balance Balance
# TYPE swapdaemon_balance gauge
swapdaemon_balance{coin="eth"} 1.0000985748404711e+21
swapdaemon_balance{coin="xmr"} 2.251284930376617e+15
# HELP swapdaemon_ongoing_swaps_count The number of ongoing swaps
# TYPE swapdaemon_ongoing_swaps_count gauge
swapdaemon_ongoing_swaps_count 0
# HELP swapdaemon_owned_offers_count The number of offers
# TYPE swapdaemon_owned_offers_count gauge
swapdaemon_owned_offers_count 0
# HELP swapdaemon_past_swaps_count The number of past swaps by status
# TYPE swapdaemon_past_swaps_count gauge
swapdaemon_past_swaps_count{status="abort"} 0
swapdaemon_past_swaps_count{status="refund"} 0
swapdaemon_past_swaps_count{status="success"} 1
# HELP swapdaemon_peers_count The number of connected peers
# TYPE swapdaemon_peers_count gauge
swapdaemon_peers_count 2

The Metrics returned by SetupMetrics is currently not used, but could be useful if we add metrics that are not determined at collect time.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 26.36% and project coverage change: -0.06 :warning:

Comparison is base (864d814) 57.96% compared to head (376600c) 57.91%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #464 +/- ## ========================================== - Coverage 57.96% 57.91% -0.06% ========================================== Files 124 125 +1 Lines 11898 12008 +110 ========================================== + Hits 6897 6954 +57 - Misses 4279 4327 +48 - Partials 722 727 +5 ``` | [Impacted Files](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/464?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [rpc/prometheus.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/464?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cnBjL3Byb21ldGhldXMuZ28=) | `24.27% <24.27%> (ø)` | | | [rpc/server.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/464?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cnBjL3NlcnZlci5nbw==) | `74.38% <57.14%> (-1.06%)` | :arrow_down: | ... and [11 files with indirect coverage changes](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/464/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.