Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Expose the same metrics as Kubo #8

Closed
lidel opened this issue Feb 2, 2023 · 7 comments
Closed

Expose the same metrics as Kubo #8

lidel opened this issue Feb 2, 2023 · 7 comments
Milestone

Comments

@lidel
Copy link
Collaborator

lidel commented Feb 2, 2023

Kubo Gateway exposes a bunch of metrics on RPC port: http://127.0.0.1:5001/debug/metrics/prometheus

bifrost-gateway should do the same

Details

We already have the some code extracted from Kubo:

https://github.com/ipfs/go-libipfs/blob/302b2799386dea7afb72ba0b4c32a5c427215d06/gateway/handler.go#L220-L262

We need to also move things from MetricsCollectionOption:

https://github.com/ipfs/kubo/blob/14649aa8ba8d7612ce9e35bba776fe7e7498b343/core/corehttp/metrics.go#L79

While at it, we should fill the gaps mentioned in ipfs/boxo#154

@lidel
Copy link
Collaborator Author

lidel commented Feb 2, 2023

@gmasgras is that all you need for drop-in replacement? Is there a place we can find all necessary metrics, to double-check we did not miss anything?

@willscott
Copy link
Collaborator

for caboose preference for using Prometheus metrics directly versus opencensus?

@gmasgras
Copy link
Collaborator

gmasgras commented Feb 3, 2023

Here is a list of metrics we're currently using for our dashboards and alerts

ipfs_bitswap_active_block_tasks
ipfs_bitswap_active_tasks
ipfs_bitswap_pending_block_tasks
ipfs_bitswap_pending_tasks
ipfs_bitswap_recv_all_blocks_bytes_count
ipfs_bitswap_recv_dup_blocks_bytes_count
ipfs_bitswap_sent_all_blocks_bytes_sum
ipfs_bitswap_wantlist_total
ipfs_http_response_size_bytes_sum
ipfs_http_unixfs_get_latency_seconds_sum
ipfs_p2p_peers_total
libp2p_rcmgr_conns_blocked_total
libp2p_rcmgr_memory_allocations_blocked_total
libp2p_rcmgr_peer_blocked_total
libp2p_rcmgr_protocols_for_peer_blocked_total
libp2p_rcmgr_services_blocked_total
libp2p_rcmgr_streams_blocked_total

@lidel lidel added this to the M1: Feb 17 milestone Feb 3, 2023
@lidel lidel moved this to 📋 Backlog in bifrost-gateway Feb 3, 2023
@willscott
Copy link
Collaborator

Of these, only

ipfs_http_response_size_bytes_sum
ipfs_http_unixfs_get_latency_seconds_sum

are relevant

@lidel
Copy link
Collaborator Author

lidel commented Feb 6, 2023

Thanks!

Hm.. it looks like we don't use existing metrics for directory listings, nor blocks, cars, and miss metrics for newly added types like JSON/CBOR/IPNS.

We'll clean this up in ipfs/boxo#154 and then document all metrics exposed by bifrost-gateway in its readme.

@lidel
Copy link
Collaborator Author

lidel commented Feb 8, 2023

@hacdias #10 exposes ipfs_http_unixfs_get_latency_seconds_sum but ipfs_http_response_size_bytes_sum is missing, because it was not part of gateway code. Mind tracking down how it is exposed in Kubo and adding it to bifrost-gateway? We need parity here. 🙏

@lidel
Copy link
Collaborator Author

lidel commented Feb 11, 2023

Last one landed in #18

@lidel lidel closed this as completed Feb 11, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in bifrost-gateway Feb 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants