Skip to content

mips: EncodeCounterValue implementation missing for u32? #172

Closed

Description

@brocaar

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.

Activity

  1. added 2 commits that reference this issue on Oct 28, 2023
    3fd3a1b
    a96a61a
  2. added a commit that references this issue on Nov 21, 2023
    53d02ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions