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

mips: EncodeCounterValue implementation missing for u32? #172

Open
brocaar opened this issue Oct 27, 2023 · 0 comments · May be fixed by #173
Open

mips: EncodeCounterValue implementation missing for u32? #172

brocaar opened this issue Oct 27, 2023 · 0 comments · May be fixed by #173

Comments

@brocaar
Copy link

brocaar commented Oct 27, 2023

Code that compiles fine for ARMv7 and AMD64, fails when compiling for MIPS (mipsel-unknown-linux-musl):

...
the trait `EncodeCounterValue` is not implemented for `u32`
   |
   = help: the following other types implement trait `EncodeCounterValue`:
             u64
             f64
   = note: required for `prometheus_client::metrics::counter::Counter` to implement `EncodeMetric`
   = note: 1 redundant requirement hidden
...

It looks like that mips targets are using u32 instead of u64 for counter values:

https://github.com/prometheus/client_rust/blob/master/src/metrics/counter.rs#L51

And indeed there is no EncodeCounterValue implementation for u32:

https://github.com/prometheus/client_rust/blob/master/src/encoding.rs#L537

Edit: This issue might apply to other types as well, e.g. Gauge. I have not tested this.

brocaar added a commit to brocaar/client_rust that referenced this issue Oct 28, 2023
@brocaar brocaar linked a pull request Oct 28, 2023 that will close this issue
brocaar added a commit to brocaar/client_rust that referenced this issue Oct 28, 2023
Fixes prometheus#172.

Signed-off-by: Orne Brocaar <info@brocaar.com>
brocaar added a commit to brocaar/client_rust that referenced this issue Nov 21, 2023
Fixes prometheus#172.

Signed-off-by: Orne Brocaar <info@brocaar.com>
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 a pull request may close this issue.

1 participant