Skip to content
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

feat: metrics: Expose libp2p traffic metrics using prometheus #12401

Closed
wants to merge 3 commits into from

Conversation

Kubuxu
Copy link
Contributor

@Kubuxu Kubuxu commented Aug 16, 2024

Related Issues

Resolves filecoin-project/go-f3#575

Proposed Changes

Expose libp2p trafic metrics over prometheus

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

@Kubuxu Kubuxu requested a review from Stebalien August 16, 2024 13:45
@Kubuxu
Copy link
Contributor Author

Kubuxu commented Aug 16, 2024

Metrics are exposed as follows:

# HELP lotus_libp2p_traffic_bytes_total Number of bytes transferred over libp2p streams
# TYPE lotus_libp2p_traffic_bytes_total counter
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/chain/ipfs/bitswap/1.2.0"} 486267
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/fil/chain/xchg/0.0.1"} 6.76525828e+08
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/fil/hello/1.0.0"} 2.590733e+06
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/fil/kad/testnetnet/kad/1.0.0"} 1.1884009e+07
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/ipfs/id/1.0.0"} 5.625354e+06
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/ipfs/id/push/1.0.0"} 1.173708e+06
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/ipfs/ping/1.0.0"} 1344
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/libp2p/autonat/1.0.0"} 2428
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="/meshsub/1.1.0"} 6.58878e+06
lotus_libp2p_traffic_bytes_total{direction="inbound",proto="unknown"} 1.126299e+06
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/chain/ipfs/bitswap/1.2.0"} 295014
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/fil/chain/xchg/0.0.1"} 797754
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/fil/hello/1.0.0"} 987845
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/fil/kad/testnetnet/kad/1.0.0"} 1.2802145e+07
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/ipfs/id/1.0.0"} 9.693344e+06
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/ipfs/id/push/1.0.0"} 7.695159e+06
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/ipfs/ping/1.0.0"} 1344
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/libp2p/autonat/1.0.0"} 13800
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="/meshsub/1.1.0"} 2.561056e+06
lotus_libp2p_traffic_bytes_total{direction="outbound",proto="unknown"} 1.109935e+06

Signed-off-by: Jakub Sztandera <[email protected]>
@Stebalien
Copy link
Member

Stebalien commented Aug 16, 2024

I'm not seeing any CPU impact from this change, but it's responsible for 6% of object allocations on an otherwise idle node. I'm going to see if we can do this lazily.

profile.zip

(I'd upload it as an SVG, but GitHub doesn't react very well).

@Stebalien
Copy link
Member

Testing #12402 as an alternative.

@Kubuxu
Copy link
Contributor Author

Kubuxu commented Aug 19, 2024

Superseded by #12402

@Kubuxu Kubuxu closed this Aug 19, 2024
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.

Expose bandwidth traffic metrics in lotus
2 participants