Comments (7)
Unfortunately there is no good documentation. And the MetricsRegister
interface is very opinionated and overly dependent on https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/metrics/utils/registryMetricCreator.ts#L12, requires implementing some specific methods (gauge, histogram, avgMinMax). This could/should be cleaned up cc @dapplion @tuyennhv
If you'd like an example, take a look here:
https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/metrics/utils/registryMetricCreator.ts#L12
You can create a RegistryMetricCreator
instance and pass that as the metricsRegister
in the gossipsub constructor / init function.
Then, with a reference to the instance, you should be able to consume the metrics with methods described here: https://github.com/siimon/prom-client#register
from js-libp2p-gossipsub.
Thank you @wemeetagain
I'll have a look 👍
from js-libp2p-gossipsub.
Would you happen to know why the instrument types(Gauge, Histogram, AvgMinMax) and their config types are not exported? (Since they are being used in the exported MetricsRegister interface).
Since we are using this library in a browser application, we are not planning on adding a dependency to the promclient lib.
![image](https://private-user-images.githubusercontent.com/124408005/259485994-126e6b38-2878-4074-b7cf-8e3f394beacc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MDg3NDksIm5iZiI6MTcyMTQwODQ0OSwicGF0aCI6Ii8xMjQ0MDgwMDUvMjU5NDg1OTk0LTEyNmU2YjM4LTI4NzgtNDA3NC1iN2NmLThlM2YzOTRiZWFjYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOVQxNzAwNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMGY2ZmEzMTVhOTY2YTFjNjEyMzk1ZDZhY2VlMDU3MGEzMzFiOGQ3MTgxNGNjMjVlYTk0ZDUwOTk3YzI5N2MzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.yqe8vS4yzG7t4VbaHMrDjoXQ4mmgLxOA_NwdTV8v5Tw)
Thank you!
PS: For now, I have copied the types in my code just to get me going but I really wish I didn't have to do that :)
from js-libp2p-gossipsub.
@cristianmadularu the types you requested are now exported as of v10.1.0
from js-libp2p-gossipsub.
Thank you! :)
from js-libp2p-gossipsub.
We should drop avgMinMax
and have a regular prometheus interface that's generic
from js-libp2p-gossipsub.
That would be very nice :) I would also suggest considering exposing an OTLP set of metrics in order to avoid being locked in any particular set of tools/vendors.
from js-libp2p-gossipsub.
Related Issues (20)
- Missed Iwant messages from Lodestar to Nimbus HOT 2
- Export Metrics
- Unbundle metrics with 2 labels
- TypeError when setting direct peers in @chainsafe/libp2p-gossipsub with new libp2p peerStore structure HOT 1
- No recepient after message sent HOT 3
- Unregister protocol on gossipsub.stop
- Do not select backoff peers to graft HOT 1
- Track backoff times in connected peers
- No fanout peers HOT 2
- feat: Support WebRTC Browser-to-Browser HOT 7
- example doesn't work in the browser (insufficent peers) HOT 3
- vuln prototype pollution in dependency protobufjs HOT 2
- GossipSub treats Stream reset as Peer Disconnect HOT 2
- Make `PublishError.InsufficientPeers` a bit more self-explanatory?
- 11.0.0 not working with bug : CodeError: logger not set HOT 1
- Memory leak in streamsOutbound HOT 2
- new found discovered peers not added to peers HOT 3
- Message delivery not working if publisher is sending message to early after connect
- Track publish time after messages are sent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-libp2p-gossipsub.