Skip to content

push metrics: Please expose functionality to get push url and encoded metrics (without push feature) #536

@aawsome

Description

@aawsome

Is your feature request related to a problem? Please describe.
We would like to push metrics to a pushgateway. The push feature however is quite restricted to a special reqwest configuration which does not comply to our dependency situation

Describe the solution you'd like
Within the code in https://github.com/tikv/rust-prometheus/blob/master/src/push.rs#L80, most work involves creating the exact url to use and to create and validate the encoded metrics.
I wonder if we could simply refactor this in its own public function which is independent from the push feature, meaning which does not involve any external dependency.

Describe alternatives you've considered
There is the crate prometheus-push but is has its own compromises and pulls other dependencies.
An alternative would be to add similar functionality to this crate.

The solution I have currently chosen is to copy&paste the code into my own codebase.

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