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

Protobuf support #83

Merged
merged 75 commits into from Sep 11, 2022
Merged

Protobuf support #83

merged 75 commits into from Sep 11, 2022

Commits on Aug 29, 2022

  1. Rough implementation to encode Counter

    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(&registry));
        |                          ------ ^^^^^^^^^ 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>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    b78dbaf View commit details
    Browse the repository at this point in the history
  2. src/encoding/proto: Construct Registry with proto::EncodeMetric

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    mxinden authored and ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    e2e96f9 View commit details
    Browse the repository at this point in the history
  3. src/encoding/proto: Implement encoding for labels

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    abb66df View commit details
    Browse the repository at this point in the history
  4. src/encoding/proto: Implement encoding for CounterWithExemplar

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    33b527f View commit details
    Browse the repository at this point in the history
  5. Move comment

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    a3e6afc View commit details
    Browse the repository at this point in the history
  6. src/encoding/proto: Implement encoding for Gauge

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    c3bb963 View commit details
    Browse the repository at this point in the history
  7. src/encoding/proto: Implement encoding for Histogram

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    d29e2d3 View commit details
    Browse the repository at this point in the history
  8. src/encoding/proto: Tweak function name according to encoding::text

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    18ca645 View commit details
    Browse the repository at this point in the history
  9. src/encoding/proto: Implement encoding for HistogramWithExemplars

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    9c97af5 View commit details
    Browse the repository at this point in the history
  10. src/encoding/proto: Move function for readability

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    ca45f64 View commit details
    Browse the repository at this point in the history
  11. src/encoding/proto: Implement encoding for Info

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    d76e7a0 View commit details
    Browse the repository at this point in the history
  12. src/encoding/proto: Add tests for Counter

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    4b31a21 View commit details
    Browse the repository at this point in the history
  13. src/encoding/proto: Add assertions for MetricType

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    571c707 View commit details
    Browse the repository at this point in the history
  14. src/encoding/proto: DRY-ed tests with extract_metric_point_value

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    84a0745 View commit details
    Browse the repository at this point in the history
  15. src/encoding/proto: Assert name and help

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    90d8b00 View commit details
    Browse the repository at this point in the history
  16. src/encoding/proto: Refactor: use associated constants

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    03fc057 View commit details
    Browse the repository at this point in the history
  17. src/encoding/proto: Add assertions for counter.exemplar

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    745160c View commit details
    Browse the repository at this point in the history
  18. src/encoding/proto: Add assertion for Unit

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    4b839c9 View commit details
    Browse the repository at this point in the history
  19. src/encoding/proto: Refactoring: extract a method Unit::as_str()

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    202d457 View commit details
    Browse the repository at this point in the history
  20. src/encoding/proto: Remove superfluous comments

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    2e7e35a View commit details
    Browse the repository at this point in the history
  21. src/encoding/proto: Add tests for Family

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    bd90dc3 View commit details
    Browse the repository at this point in the history
  22. src/encoding/proto: Remove redundant test

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    c1b38a2 View commit details
    Browse the repository at this point in the history
  23. src/encoding/proto: Add doc

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    92b4493 View commit details
    Browse the repository at this point in the history
  24. Introduce protobuf feature

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    3cfe085 View commit details
    Browse the repository at this point in the history
  25. src/encoding/proto: Refactoring for loop

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    ee6344a View commit details
    Browse the repository at this point in the history
  26. Implement proc macro EncodeProtobuf

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    cc0df24 View commit details
    Browse the repository at this point in the history
  27. Add impl EncodeGaugeValue for u64

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    7040f2a View commit details
    Browse the repository at this point in the history
  28. Try Associated Type

    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>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    6cf6e09 View commit details
    Browse the repository at this point in the history
  29. Fix life parameter issue

    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>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    887beff View commit details
    Browse the repository at this point in the history
  30. Make EncodeLabel::encode return iterator

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    49a3dfb View commit details
    Browse the repository at this point in the history
  31. src/encoding/proto: Refactor EncodeLabel and EncodeMetric

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    mxinden authored and ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    3b8dc35 View commit details
    Browse the repository at this point in the history
  32. Fix assertions because of changes of the order of result

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    f07148b View commit details
    Browse the repository at this point in the history
  33. Remove unnecessary lifetime parameter

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    0583a66 View commit details
    Browse the repository at this point in the history
  34. Rename EncodeLabel -> EncodeLabels

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    88fe41e View commit details
    Browse the repository at this point in the history
  35. Using Void to indicate the impossible case

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    e5a37a3 View commit details
    Browse the repository at this point in the history
  36. Changed proc macro accordingly since encode returns iterator

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    7d2c6a0 View commit details
    Browse the repository at this point in the history
  37. Rename the proc macro since the name was a bit redundant

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    2e55b46 View commit details
    Browse the repository at this point in the history
  38. Add a test for Family (counter and histogram)

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    83a0b89 View commit details
    Browse the repository at this point in the history
  39. Add benchmark code for proto encoding

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    00dcdd1 View commit details
    Browse the repository at this point in the history
  40. Add a test for Family, Counter and Histogram

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    f20ae6b View commit details
    Browse the repository at this point in the history
  41. Remove Box to reduce allocation count

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    50ca0a9 View commit details
    Browse the repository at this point in the history
  42. Use std::iter::Once on enums as enum returns single element

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    6afc9b7 View commit details
    Browse the repository at this point in the history
  43. encoding/proto: Pass metric and label vec

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    mxinden authored and ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    289241c View commit details
    Browse the repository at this point in the history
  44. derive-proto-encode: Update according to the changes in encoding/proto

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    dd69b89 View commit details
    Browse the repository at this point in the history
  45. Cargo.toml: Make void optional

    void is used in only encoding/proto.
    
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    2f8d1a3 View commit details
    Browse the repository at this point in the history
  46. benches: Update according to the changes in encoding/proto

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    547e1b4 View commit details
    Browse the repository at this point in the history
  47. encoding/proto: same implementation to slice

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    f8c621a View commit details
    Browse the repository at this point in the history
  48. Bump the crate version and add a changelog entry

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    2d169ad View commit details
    Browse the repository at this point in the history
  49. Add --all-features

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    4b7c75f View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. Remove unnecessary generic parameter

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    48745c4 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2022

  1. Merge derive-proto-encode into derive-text-encode

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    f367ebf View commit details
    Browse the repository at this point in the history
  2. protobuf feature requires Display

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    870cdae View commit details
    Browse the repository at this point in the history
  3. Rename prometheus-client-derive-text-encode to `prometheus-client-d…

    …erive-encode`
    
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    26ec648 View commit details
    Browse the repository at this point in the history
  4. derive-encode: Bump up patch version because of adding protobuf feature

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    2fb5f1f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1d70145 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2022

  1. Fix missing docs

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    15dc7a7 View commit details
    Browse the repository at this point in the history
  2. Fix clippy warnings: field assignment outside of initializer for an i…

    …nstance created with Default::default()
    
    https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    bb08122 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    766c650 View commit details
    Browse the repository at this point in the history
  4. Fix redundant clone

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    e99575b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a6c797b View commit details
    Browse the repository at this point in the history
  6. Fix clippy warnings: explicit lifetimes given in parameter types wher…

    …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>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    cc9f739 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d106aa3 View commit details
    Browse the repository at this point in the history
  8. Allow some lint warnings on openmetrics.rs which is an auto-generated…

    … file
    
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    77c9c22 View commit details
    Browse the repository at this point in the history
  9. Remove unnecessary cfg

    `not found in this scope` error occurs when no feature specified
    
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    ec56224 View commit details
    Browse the repository at this point in the history
  10. MoveEncode trait from prometheus_client::encoding::text to `prome…

    …theus_client::encoding`
    
    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    d992bad View commit details
    Browse the repository at this point in the history
  11. Bump up the minor version as the unreleased contains breaking changes

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    8fce756 View commit details
    Browse the repository at this point in the history
  12. Update a link to PR

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    639cb0a View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2022

  1. misc fixes

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    divagant-martian authored and ackintosh committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    ca0f583 View commit details
    Browse the repository at this point in the history
  2. Remove a Display requirement

    Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
    ackintosh committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    8baf256 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3a2190d View commit details
    Browse the repository at this point in the history
  4. Disambiguate Encode

    ackintosh committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    396512f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    20fd62e View commit details
    Browse the repository at this point in the history
  6. Fix clippy warnings

    - `assert!(false, ..)` should probably be replaced
    - redundant clone
    - field assignment outside of initializer for an instance created with Default::default()
    ackintosh committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    8ac25a5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f5b61f1 View commit details
    Browse the repository at this point in the history
  8. Merge pull request #9 from ackintosh/remove-display

    Remove a `Display` requirement and fix CI errors
    ackintosh committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    69f85ba View commit details
    Browse the repository at this point in the history