-
Notifications
You must be signed in to change notification settings - Fork 80
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
Protobuf support #83
Protobuf support #83
Conversation
Compile error: error[E0277]: the trait bound `Box<dyn text::SendEncodeMetric>: proto::EncodeMetric` is not satisfied --> src/encoding/proto.rs:151:33 | 151 | println!("{:?}", encode(®istry)); | ------ ^^^^^^^^^ the trait `proto::EncodeMetric` is not implemented for `Box<dyn text::SendEncodeMetric>` | | | required by a bound introduced by this call Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Build error below occurs: error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> src/encoding/proto.rs:199:6 | 199 | impl<'a, N, A> EncodeMetric for Counter<N, A> | ^^ unconstrained lifetime parameter Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Build error: error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> src/encoding/proto.rs:199:6 | 199 | impl<'a, N, A> EncodeMetric for Counter<N, A> | ^^ unconstrained lifetime parameter Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
…e they could be elided https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
… file Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
`not found in this scope` error occurs when no feature specified Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
…theus_client::encoding` Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
@mxinden Please have another look. 🙏 |
Thanks for the follow-ups. I kicked off CI, which is complaining. Can you take a look? |
most if not all the problems are tackled in ackintosh#7 |
derive-encode/src/lib.rs
Outdated
quote! { | ||
let mut label = prometheus_client::encoding::proto::Label::default(); | ||
label.name = #ident_string.to_string(); | ||
label.value = format!("{}", self.#ident); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This imposes a Display
requirement on the fields of a struct. Is this actually needed? if so it would be good to document it somewhere because it's unexpected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing it out. I'm working on that in ackintosh#9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ackintosh#9 has been merged into this PR.
Ahh, Signed-off-by is required... |
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
- `assert!(false, ..)` should probably be replaced - redundant clone - field assignment outside of initializer for an instance created with Default::default()
Remove a `Display` requirement and fix CI errors
Removed a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful work. I will cut a release soonish.
Thank you @ackintosh for tackling this large project!
|
||
### Changed | ||
|
||
- Move`Encode` trait from `prometheus_client::encoding::text` to `prometheus_client::encoding`. See [PR 83]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
Thank you so much for your help! ✨ @mxinden @divagant-martian |
Closes #46
This PR adds protobuf support to the client, which provides functionality to encode metrics to an instance of the OpenMetrics protobuf format.