-
Notifications
You must be signed in to change notification settings - Fork 974
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
protocols/gossipsub: Enable the protobuf
feature of prometheus-client
#2911
Conversation
…the `protobuf` feature
Interesting, I wasn't aware that I guess for
|
metrics were added some good time ago to analyze mesh health and scoring behaviour. Back then we discussed using events as the rest of the protocols but the amount of new events that we would need for this make no sense in general. About being optional, I don't remember why we went this route instead of a compile flag. We should probably revisit that option but I also think that is outside the scope of this PR |
Okay, thanks for the explanation :) I still don't understand why we need this PR. The protobuf feature of |
I've opened an issue about feature-gating the metrics support: #2923 |
Because the default Registry that prometheus exposes has a generic that uses the default text encoder. There is no way right now to use the new proto encoder using gossipsub. With this I mean, gossipsub as is does not use a registry generic over the encoder, but with a fixed one (text encoding) I've edited the paragraph above way too many times, I hope I manage to communicate the idea Of course if you think / find a better option we should explore it |
Okay that makes sense, thanks for explaining :) I hacked something together here: https://github.com/libp2p/rust-libp2p/tree/hack-templated-metric-gossip-sub It doesn't compile because the
|
This is unfortunate and very much my fault. I think we should move away from the generic type parameter on |
That was my fault when I added the protobuf encoding to |
Okay cool! That should allow my PoC to compile. I don't plan on working on this any time soon but feel free to take whatever you find useful :) |
I have copied the hack as is on my fork of Now I'm facing the compile error in
It looks no conflict for me because the two |
@thomaseizinger @mxinden By the way, here is another attempt to allow the two (text and proto) encoder by Diva: ackintosh#55 What do you think? |
Ah damn. It is conflicting because you could have a type that implements both traits and then it is no longer clear, which implementation to chose. One would need negative traits bounds to express this. |
It seems like it would require each user of a |
I saw the PR: prometheus/client_rust#100 |
Oh yeah that was a quick dirty attempt to get things working. No investment on particular solutions. Tho the current situation is definitely somewhat annoying |
With prometheus/client_rust#105 and the latest |
👷 This PR is a work in progress 👷
Description
The latest revision of prometheus-client has OpenMetrics protobuf support. Which will be released in v0.19.
Prior to the release, I'm working to enable the
protobuf
feature on gossipsub metrics.Open Questions
Change checklist