client_rust icon indicating copy to clipboard operation
client_rust copied to clipboard

feat(prometheus-client-derive): initial implemenation

Open ADD-SP opened this issue 10 months ago • 2 comments

Summary

This PR implements features proposed by #140, supersedes #218 (which doesn't makes new progress in the past several months).

This PR adds and publishes (to crates.io) a new crate prometheus-client-derive, and re-exports its macros in crate prometheus-client, so the user should use prometheus-client instead of prometheus-client-derive. This re-export pattern is also used by serde.

The new crate only has one macros Registrant derive the trait that allows structs to be registered in a registry.

Futures of derive-encode

This PR doesn't touch it, but I think we should merge it into prometheus-client-derive eventually as the first one's functionalities is a subset of the second one.

Since this is a breaking change, this is not the call should be made by outside contributor, even if we can do breaking change when releasing 0.24.0 based on the Rust semantic version.

Issues

close #140, supersede #218

ADD-SP avatar Apr 19 '25 08:04 ADD-SP

Interesting idea, would you be interested in porting this PR to my openmetrics library?

koushiro avatar Apr 21 '25 07:04 koushiro

@mxinden Could you take a look?

ADD-SP avatar May 10 '25 10:05 ADD-SP