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

src/collector: Introduce Collector abstraction #82

Merged
merged 14 commits into from Dec 29, 2022

Commits on Dec 2, 2022

  1. encoding/: Adopt serde style encoding

    Adopt encoding style similar to serde. `EncodeXXX` for a type that can be
    encoded (see serde's `Serialize`) and `XXXEncoder` for a supported encoding i.e.
    text and protobuf (see serde's `Serializer`).
    
    - Compatible with Rust's additive features. Enabling the `protobuf` feature does
    not change type signatures.
    - `EncodeMetric` is trait object safe, and thus `Registry` can use dynamic dispatch.
    - Implement a single encoding trait `EncodeMetric` per metric type instead of
    one implementation per metric AND per encoding format.
    - Leverage `std::fmt::Write` instead of `std::io::Write`. The OpenMetrics text
    format has to be unicode compliant. The OpenMetrics Protobuf format requires
    labels to be valid strings.
    
    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    f0aa084 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2022

  1. src/encoding: Generate EncodeLabelValue for integers

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    4b2d00f View commit details
    Browse the repository at this point in the history
  2. src/encoding: Take reference for value

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    d11c977 View commit details
    Browse the repository at this point in the history
  3. src/collector: Introduce Collector abstraction

    The `Collector` abstraction allows users to provide additional metrics
    and their description on each scrape.
    
    See also:
    
    - https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#hdr-Custom_Collectors_and_constant_Metrics
    - prometheus#49
    - prometheus#29
    
    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    c337017 View commit details
    Browse the repository at this point in the history
  4. src/metrics: Introduce const types

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    c9f59eb View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2022

  1. src/collector: Don't require Send and Sync

    Iterators returned by a Collector don't have to cross thread boundaries, nor doe
    their references.
    mxinden committed Dec 17, 2022
    Configuration menu
    Copy the full SHA
    723f86f View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2022

  1. Configuration menu
    Copy the full SHA
    83a2cb6 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Configuration menu
    Copy the full SHA
    5f70f0c View commit details
    Browse the repository at this point in the history
  2. *: Bump version and add changelog entry

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    d90c797 View commit details
    Browse the repository at this point in the history
  3. Rename collector::Metric to LocalMetric similar to futures box_local

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    50ce9c9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3b3aef2 View commit details
    Browse the repository at this point in the history
  5. Fix intra doc links

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    5032236 View commit details
    Browse the repository at this point in the history
  6. Fix clippy warnings

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    66f2982 View commit details
    Browse the repository at this point in the history
  7. Fix collector doc test

    Signed-off-by: Max Inden <mail@max-inden.de>
    mxinden committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    ff36682 View commit details
    Browse the repository at this point in the history